@seatlayer/core 0.75.1 → 0.76.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{categoryInventory-DFp26meo.d.cts → categoryInventory-CBuJy9KM.d.cts} +1 -1
- package/dist/{categoryInventory-C5I2U-EM.d.ts → categoryInventory-Cy5pQ0KW.d.ts} +1 -1
- package/dist/chunk-24O23MNB.js +1 -0
- package/dist/chunk-BT2KJXQC.js +1 -0
- package/dist/{chunk-3L4M7L5I.js → chunk-BXU5D2Q5.js} +1 -1
- package/dist/chunk-FGMGDTMR.js +1 -0
- package/dist/{chunk-KHFCTR3V.js → chunk-JQL77POQ.js} +1 -1
- package/dist/{chunk-UVAV3E7K.js → chunk-NQZAZFAC.js} +1 -1
- package/dist/{chunk-OGIAQX62.js → chunk-O5UH442K.js} +1 -1
- package/dist/{chunk-TN6DFYEV.js → chunk-PRED5KHO.js} +1 -1
- package/dist/{chunk-N3DPHRJ3.js → chunk-Q3U3F4YJ.js} +1 -1
- package/dist/{chunk-YACNGDTE.js → chunk-WXGW2SYC.js} +1 -1
- package/dist/{chunk-FMZ6HLDH.js → chunk-XD2P4ZS4.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +7 -5
- package/dist/core/chart-ops/index.d.ts +7 -5
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.d.cts +4 -4
- package/dist/core/inventory/index.d.ts +4 -4
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +18 -14
- package/dist/core/quality/index.d.ts +18 -14
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.d.cts +1 -1
- package/dist/core/render-assets/index.d.ts +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.d.cts +5 -5
- package/dist/core/sections/index.d.ts +5 -5
- package/dist/core/sections/index.js +1 -1
- package/dist/{eventConfigurations-DAaOaKJK.d.cts → eventConfigurations-CqfrYWAb.d.cts} +1 -1
- package/dist/{eventConfigurations-BQGuLLv0.d.ts → eventConfigurations-Dhauc9V3.d.ts} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +61 -18
- package/dist/index.d.ts +61 -18
- package/dist/index.js +1 -1
- package/dist/{labeling-BZp91HiS.d.cts → labeling-B1xsmowB.d.cts} +1 -1
- package/dist/{labeling-Duul2sao.d.ts → labeling-BwPEI5JN.d.ts} +1 -1
- package/dist/{renderedQuality-CEPse8ir.d.cts → renderedQuality-1E9KuJvY.d.cts} +1 -1
- package/dist/{renderedQuality-BYhJ3Cer.d.ts → renderedQuality-ChAZNV2N.d.ts} +1 -1
- package/dist/{renderer-Cv_gzYvT.d.cts → renderer-BRmVrITG.d.cts} +1 -1
- package/dist/{renderer-BlLKrW-U.d.ts → renderer-q7viZLGZ.d.ts} +1 -1
- package/dist/{sections-DIVvr8QN.d.ts → sections-ByTMouG8.d.ts} +1 -1
- package/dist/{sections-CRSGPI3T.d.cts → sections-CA-bBex5.d.cts} +1 -1
- package/dist/{segmentedRowModel-CvyOS6Bx.d.cts → segmentedRowModel-C7XOEjHk.d.cts} +1 -1
- package/dist/{segmentedRowModel-CD-YT9bT.d.ts → segmentedRowModel-DcvJVKLD.d.ts} +1 -1
- package/dist/{layout-Gkx3fo5_.d.cts → tableSizing-BdCyNeqX.d.cts} +14 -4
- package/dist/{layout-DGbWo5fV.d.ts → tableSizing-D8e8QAJ-.d.ts} +14 -4
- package/dist/{ticketRestrictions-C31mrE97.d.cts → ticketRestrictions-CPZglNvw.d.cts} +2 -2
- package/dist/{ticketRestrictions-DXO2eckD.d.ts → ticketRestrictions-CorjMY49.d.ts} +2 -2
- package/dist/{types-BVRza86Q.d.ts → types-CqaNLbU6.d.cts} +10 -4
- package/dist/{types-BVRza86Q.d.cts → types-CqaNLbU6.d.ts} +10 -4
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +6 -6
- package/dist/view3d/index.d.cts +3 -3
- package/dist/view3d/index.d.ts +3 -3
- 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-QUOAQQMP.js +0 -1
- package/dist/chunk-X2GZ5O7C.js +0 -1
package/dist/view3d/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var gs=Object.create;var Kt=Object.defineProperty;var xs=Object.getOwnPropertyDescriptor;var vs=Object.getOwnPropertyNames;var Ss=Object.getPrototypeOf,Ms=Object.prototype.hasOwnProperty;var Ct=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Oo=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})},Vo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vs(t))!Ms.call(e,o)&&o!==n&&Kt(e,o,{get:()=>t[o],enumerable:!(r=xs(t,o))||r.enumerable});return e};var lt=(e,t,n)=>(n=e!=null?gs(Ss(e)):{},Vo(t||!e||!e.__esModule?Kt(n,"default",{value:e,enumerable:!0}):n,e)),ws=e=>Vo(Kt({},"__esModule",{value:!0}),e);function Ad(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Rd(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function An(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Rd(t?.deviceMemory)}}function Rn(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 r={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...r,reason:"save-data"};let o=[...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,u)=>c.width*c.height-u.width*u.height);if(!o.length)return{...r,upgradeUrl:e.url,reason:"progressive"};let i=o.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...r,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Ad(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...r,reason:"memory-limit"};let s=a[a.length-1];return{...r,upgradeUrl:s.url,reason:"progressive"}}function za(){return new DOMException("Panorama image load aborted","AbortError")}function Ht(e,t){return new Promise((n,r)=>{if(t?.aborted){r(za());return}let o=new Image;o.crossOrigin="anonymous";let i=!1,a=()=>{o.onload=null,o.onerror=null,t?.removeEventListener("abort",c)},s=u=>{i||(i=!0,a(),u?r(u):n(o))},c=()=>{o.src="",s(za())};o.onload=()=>{(typeof o.decode=="function"?o.decode():Promise.resolve()).then(()=>s(),()=>s())},o.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),o.src=e})}function In(e){let t=globalThis;if(t.requestIdleCallback){let r=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(r)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var Io=Ct(()=>{"use strict"});function Ua(e){let t=e.mediaKind==="demo-render",n=e.generated||e.mediaKind==="model"?"Live 3D \xB7 chart-derived seat-eye":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",r=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,r?`${t?"created":"captured"} ${r}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function Eo(e){return Math.max(Id,Math.min(Ed,e))}function Td(e,t,n){let r=(.5+e/360)*n;return t/2-r}function _d(e,t=Tn){return e*(180/t)}function Ha(e,t,n){return(e-t)/2+En(n,t)}function En(e,t){let n=ke/180*t;return Math.max(-n,Math.min(n,e))}function kd(){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 To(e){return e||(kd()?"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 ja(e,t,n={}){let r=n.fadeMs??400,o=t.initialBearingDeg??0,i=Rn(t,An()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),u=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 ${r}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let d=document.createElement("div");Object.assign(d.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(d);let p=document.createElement("button");if(p.type="button",p.setAttribute("aria-label","Close"),p.textContent="\u2715",Object.assign(p.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(p),n.disclosure){let N=document.createElement("div");N.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.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)"}),c.appendChild(N)}let m=document.createElement("div");m.textContent=To(n.lookAroundHint),Object.assign(m.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(m),e.appendChild(c),p.focus({preventScroll:!0});let l=0,f=0,h=0,y=0,b=Tn,x=()=>{let N=c.clientHeight||1,F=c.clientWidth||1,K=P.naturalWidth||F*2,X=P.naturalHeight||N,Q=l>0?(F/2-h)/l:0,W=f>0?y/f:0;f=_d(N,b),l=f*(K/X),d.style.backgroundSize=`${l}px ${f}px`,g?h=F/2-Q*l:(h=Td(o,F,l),y=En((t.initialPitchDeg??0)/180*f,f),g=!0),y=En(W*f,f),d.style.backgroundPosition=`${h}px ${Ha(N,f,y)}px`},g=!1,v=()=>{let N=c.clientHeight||1;y=En(y,f),d.style.backgroundPosition=`${h}px ${Ha(N,f,y)}px`},P=new Image;P.onload=x,P.src=i.initialUrl;let S=()=>{};i.upgradeUrl&&(S=In(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(F=>!F||a.signal.aborted?null:Ht(F,a.signal).then(K=>({full:K,url:F}))).then(F=>{F&&(w||a.signal.aborted||(P=F.full,d.style.backgroundImage=`url("${F.url}")`,x()))}).catch(()=>{})})),requestAnimationFrame(x);let C=!1,T=0,B=0,z=0,D=new Map,k=()=>{let[N,F]=[...D.values()];return N&&F?Math.hypot(N.x-F.x,N.y-F.y):0},A=N=>{let F=Eo(N);F!==b&&(b=F,x())},_=N=>{D.set(N.pointerId,{x:N.clientX,y:N.clientY}),C=D.size===1,T=N.clientX,B=N.clientY,D.size===2&&(z=k()),d.style.cursor="grabbing";try{d.setPointerCapture?.(N.pointerId)}catch{}},V=N=>{if(D.has(N.pointerId)){if(D.set(N.pointerId,{x:N.clientX,y:N.clientY}),D.size>=2){let F=k();z>0&&F>0&&A(b*(z/F)),z=F,C=!1;return}C&&(h+=N.clientX-T,y+=N.clientY-B,T=N.clientX,B=N.clientY,v())}},M=N=>{D.delete(N.pointerId),z=D.size===2?k():0;let F=D.values().next().value;C=D.size===1,F?(T=F.x,B=F.y):d.style.cursor="grab";try{d.releasePointerCapture?.(N.pointerId)}catch{}},R=N=>{N.preventDefault(),A(b+N.deltaY*.04)};d.addEventListener("pointerdown",_),d.addEventListener("pointermove",V),d.addEventListener("pointerup",M),d.addEventListener("pointercancel",M),d.addEventListener("wheel",R,{passive:!1});let E=!1,w=!1,L=0,I=()=>{d.removeEventListener("pointerdown",_),d.removeEventListener("pointermove",V),d.removeEventListener("pointerup",M),d.removeEventListener("pointercancel",M),d.removeEventListener("wheel",R),window.removeEventListener("keydown",U)},O=()=>{S(),a.abort(),n.signal?.removeEventListener("abort",s),L&&(window.clearTimeout(L),L=0),I(),c.parentNode&&c.parentNode.removeChild(c),u?.isConnected&&u.focus({preventScroll:!0})},j=()=>{if(E)return;E=!0,c.style.opacity="0";let N=()=>{L=0,!w&&(O(),n.onClose?.())};L=window.setTimeout(N,r)},U=N=>{if(N.key==="Tab"){N.preventDefault(),p.focus({preventScroll:!0});return}if(N.key==="Escape"){N.stopPropagation(),j();return}if(N.key==="ArrowLeft"||N.key==="ArrowRight")h+=N.key==="ArrowLeft"?-32:32;else if(N.key==="ArrowUp"||N.key==="ArrowDown")y+=(N.key==="ArrowUp"?4:-4)*(f/180);else if(N.key==="+"||N.key==="="){A(b-5),N.preventDefault();return}else if(N.key==="-"){A(b+5),N.preventDefault();return}else return;N.preventDefault(),v()};return window.addEventListener("keydown",U),p.addEventListener("click",j),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:j,dispose(){E=!0,w=!0,O()}}}var Tn,Id,Ed,ke,_n=Ct(()=>{"use strict";Io();Tn=70,Id=35,Ed=90;ke=35});function Od(e=Ld,t=Fd,n=Dd){let r=e+1,o=t+1,i=r*o,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let d=0;d<o;d++){let p=d/t,m=p*Math.PI,l=Math.sin(m),f=Math.cos(m);for(let h=0;h<r;h++){let y=h/e,b=(y-.5)*Math.PI*2,x=d*r+h;a[x*3]=n*l*Math.sin(b),a[x*3+1]=n*f,a[x*3+2]=-n*l*Math.cos(b),s[x*2]=y,s[x*2+1]=p}}let c=new Uint16Array(e*t*6),u=0;for(let d=0;d<t;d++)for(let p=0;p<e;p++){let m=d*r+p,l=m+r;c[u++]=m,c[u++]=l,c[u++]=m+1,c[u++]=m+1,c[u++]=l,c[u++]=l+1}return{position:a,uv:s,index:c}}function Ya(e,t){let n=e*Math.PI/180,r=t*Math.PI/180,o=Math.cos(r);return[o*Math.sin(n),Math.sin(r),-o*Math.cos(n)]}function Xa(e,t){let{position:n,uv:r,index:o}=Od(),i=new Ke.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:r},index:{data:o}}),a=new Ke.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Ke.Program(e,{vertex:Vd,fragment:Bd,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Ke.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(u){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,u))},setImage(u){a.image=u,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Ke,Ld,Fd,Dd,Vd,Bd,Wa=Ct(()=>{"use strict";Ke=require("ogl"),Ld=64,Fd=32,Dd=500;Vd=`#version 300 es
|
|
1
|
+
"use strict";var gs=Object.create;var Kt=Object.defineProperty;var xs=Object.getOwnPropertyDescriptor;var vs=Object.getOwnPropertyNames;var Ss=Object.getPrototypeOf,Ms=Object.prototype.hasOwnProperty;var Ct=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Vo=(e,t)=>{for(var n in t)Kt(e,n,{get:t[n],enumerable:!0})},Bo=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vs(t))!Ms.call(e,o)&&o!==n&&Kt(e,o,{get:()=>t[o],enumerable:!(r=xs(t,o))||r.enumerable});return e};var lt=(e,t,n)=>(n=e!=null?gs(Ss(e)):{},Bo(t||!e||!e.__esModule?Kt(n,"default",{value:e,enumerable:!0}):n,e)),ws=e=>Bo(Kt({},"__esModule",{value:!0}),e);function Ad(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Rd(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function An(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Rd(t?.deviceMemory)}}function Rn(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 r={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...r,reason:"save-data"};let o=[...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,u)=>c.width*c.height-u.width*u.height);if(!o.length)return{...r,upgradeUrl:e.url,reason:"progressive"};let i=o.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...r,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Ad(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...r,reason:"memory-limit"};let s=a[a.length-1];return{...r,upgradeUrl:s.url,reason:"progressive"}}function za(){return new DOMException("Panorama image load aborted","AbortError")}function Ht(e,t){return new Promise((n,r)=>{if(t?.aborted){r(za());return}let o=new Image;o.crossOrigin="anonymous";let i=!1,a=()=>{o.onload=null,o.onerror=null,t?.removeEventListener("abort",c)},s=u=>{i||(i=!0,a(),u?r(u):n(o))},c=()=>{o.src="",s(za())};o.onload=()=>{(typeof o.decode=="function"?o.decode():Promise.resolve()).then(()=>s(),()=>s())},o.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),o.src=e})}function In(e){let t=globalThis;if(t.requestIdleCallback){let r=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(r)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var Eo=Ct(()=>{"use strict"});function Ua(e){let t=e.mediaKind==="demo-render",n=e.generated||e.mediaKind==="model"?"Live 3D \xB7 chart-derived seat-eye":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",r=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,r?`${t?"created":"captured"} ${r}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function To(e){return Math.max(Id,Math.min(Ed,e))}function Td(e,t,n){let r=(.5+e/360)*n;return t/2-r}function _d(e,t=Tn){return e*(180/t)}function Ha(e,t,n){return(e-t)/2+En(n,t)}function En(e,t){let n=ke/180*t;return Math.max(-n,Math.min(n,e))}function kd(){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 _o(e){return e||(kd()?"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 ja(e,t,n={}){let r=n.fadeMs??400,o=t.initialBearingDeg??0,i=Rn(t,An()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),u=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 ${r}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let d=document.createElement("div");Object.assign(d.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(d);let p=document.createElement("button");if(p.type="button",p.setAttribute("aria-label","Close"),p.textContent="\u2715",Object.assign(p.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(p),n.disclosure){let N=document.createElement("div");N.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.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)"}),c.appendChild(N)}let m=document.createElement("div");m.textContent=_o(n.lookAroundHint),Object.assign(m.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(m),e.appendChild(c),p.focus({preventScroll:!0});let l=0,f=0,h=0,y=0,b=Tn,x=()=>{let N=c.clientHeight||1,F=c.clientWidth||1,K=P.naturalWidth||F*2,X=P.naturalHeight||N,Q=l>0?(F/2-h)/l:0,W=f>0?y/f:0;f=_d(N,b),l=f*(K/X),d.style.backgroundSize=`${l}px ${f}px`,g?h=F/2-Q*l:(h=Td(o,F,l),y=En((t.initialPitchDeg??0)/180*f,f),g=!0),y=En(W*f,f),d.style.backgroundPosition=`${h}px ${Ha(N,f,y)}px`},g=!1,v=()=>{let N=c.clientHeight||1;y=En(y,f),d.style.backgroundPosition=`${h}px ${Ha(N,f,y)}px`},P=new Image;P.onload=x,P.src=i.initialUrl;let S=()=>{};i.upgradeUrl&&(S=In(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(F=>!F||a.signal.aborted?null:Ht(F,a.signal).then(K=>({full:K,url:F}))).then(F=>{F&&(w||a.signal.aborted||(P=F.full,d.style.backgroundImage=`url("${F.url}")`,x()))}).catch(()=>{})})),requestAnimationFrame(x);let C=!1,T=0,B=0,z=0,D=new Map,k=()=>{let[N,F]=[...D.values()];return N&&F?Math.hypot(N.x-F.x,N.y-F.y):0},A=N=>{let F=To(N);F!==b&&(b=F,x())},_=N=>{D.set(N.pointerId,{x:N.clientX,y:N.clientY}),C=D.size===1,T=N.clientX,B=N.clientY,D.size===2&&(z=k()),d.style.cursor="grabbing";try{d.setPointerCapture?.(N.pointerId)}catch{}},V=N=>{if(D.has(N.pointerId)){if(D.set(N.pointerId,{x:N.clientX,y:N.clientY}),D.size>=2){let F=k();z>0&&F>0&&A(b*(z/F)),z=F,C=!1;return}C&&(h+=N.clientX-T,y+=N.clientY-B,T=N.clientX,B=N.clientY,v())}},M=N=>{D.delete(N.pointerId),z=D.size===2?k():0;let F=D.values().next().value;C=D.size===1,F?(T=F.x,B=F.y):d.style.cursor="grab";try{d.releasePointerCapture?.(N.pointerId)}catch{}},R=N=>{N.preventDefault(),A(b+N.deltaY*.04)};d.addEventListener("pointerdown",_),d.addEventListener("pointermove",V),d.addEventListener("pointerup",M),d.addEventListener("pointercancel",M),d.addEventListener("wheel",R,{passive:!1});let E=!1,w=!1,L=0,I=()=>{d.removeEventListener("pointerdown",_),d.removeEventListener("pointermove",V),d.removeEventListener("pointerup",M),d.removeEventListener("pointercancel",M),d.removeEventListener("wheel",R),window.removeEventListener("keydown",U)},O=()=>{S(),a.abort(),n.signal?.removeEventListener("abort",s),L&&(window.clearTimeout(L),L=0),I(),c.parentNode&&c.parentNode.removeChild(c),u?.isConnected&&u.focus({preventScroll:!0})},j=()=>{if(E)return;E=!0,c.style.opacity="0";let N=()=>{L=0,!w&&(O(),n.onClose?.())};L=window.setTimeout(N,r)},U=N=>{if(N.key==="Tab"){N.preventDefault(),p.focus({preventScroll:!0});return}if(N.key==="Escape"){N.stopPropagation(),j();return}if(N.key==="ArrowLeft"||N.key==="ArrowRight")h+=N.key==="ArrowLeft"?-32:32;else if(N.key==="ArrowUp"||N.key==="ArrowDown")y+=(N.key==="ArrowUp"?4:-4)*(f/180);else if(N.key==="+"||N.key==="="){A(b-5),N.preventDefault();return}else if(N.key==="-"){A(b+5),N.preventDefault();return}else return;N.preventDefault(),v()};return window.addEventListener("keydown",U),p.addEventListener("click",j),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:j,dispose(){E=!0,w=!0,O()}}}var Tn,Id,Ed,ke,_n=Ct(()=>{"use strict";Eo();Tn=70,Id=35,Ed=90;ke=35});function Od(e=Ld,t=Fd,n=Dd){let r=e+1,o=t+1,i=r*o,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let d=0;d<o;d++){let p=d/t,m=p*Math.PI,l=Math.sin(m),f=Math.cos(m);for(let h=0;h<r;h++){let y=h/e,b=(y-.5)*Math.PI*2,x=d*r+h;a[x*3]=n*l*Math.sin(b),a[x*3+1]=n*f,a[x*3+2]=-n*l*Math.cos(b),s[x*2]=y,s[x*2+1]=p}}let c=new Uint16Array(e*t*6),u=0;for(let d=0;d<t;d++)for(let p=0;p<e;p++){let m=d*r+p,l=m+r;c[u++]=m,c[u++]=l,c[u++]=m+1,c[u++]=m+1,c[u++]=l,c[u++]=l+1}return{position:a,uv:s,index:c}}function Ya(e,t){let n=e*Math.PI/180,r=t*Math.PI/180,o=Math.cos(r);return[o*Math.sin(n),Math.sin(r),-o*Math.cos(n)]}function Xa(e,t){let{position:n,uv:r,index:o}=Od(),i=new Ke.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:r},index:{data:o}}),a=new Ke.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Ke.Program(e,{vertex:Vd,fragment:Bd,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Ke.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(u){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,u))},setImage(u){a.image=u,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Ke,Ld,Fd,Dd,Vd,Bd,Wa=Ct(()=>{"use strict";Ke=require("ogl"),Ld=64,Fd=32,Dd=500;Vd=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec3 position;
|
|
4
4
|
in vec2 uv;
|
|
@@ -17,13 +17,13 @@ out vec4 fragColor;
|
|
|
17
17
|
void main() {
|
|
18
18
|
vec3 rgb = texture(uPano, vUv).rgb;
|
|
19
19
|
fragColor = vec4(rgb, uOpacity);
|
|
20
|
-
}`});async function qa(e,t,n,r={}){let o=r.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-ke,Math.min(ke,t?.initialPitchDeg??0)),s=Tn,c=!1,u=new AbortController,d=()=>u.abort();r.signal?.addEventListener("abort",d,{once:!0});let p=()=>{},m=[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 I=n.camera.position,O=n.focalWorld[0]-I.x,j=n.focalWorld[1]-I.y,U=n.focalWorld[2]-I.z,N=Math.hypot(O,U);N>.001&&(i=Math.atan2(O,-U)*180/Math.PI,a=Math.max(-ke,Math.min(ke,Math.atan2(j,N)*180/Math.PI)))}let l=null;if(t){let I=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),O=Rn(t,An(I)),j;try{let U=t.resolveUrl?await t.resolveUrl(O.initialUrl):O.initialUrl;if(!U)throw new Error("panorama_asset_unavailable");j=await Ht(U,u.signal)}catch{return r.signal?.removeEventListener("abort",d),null}try{l=Xa(n.gl,j)}catch{return u.abort(),r.signal?.removeEventListener("abort",d),null}l.mesh.renderOrder=999,l.mesh.setParent(n.scene),O.upgradeUrl&&(p=In(()=>{(t.resolveUrl?t.resolveUrl(O.upgradeUrl):Promise.resolve(O.upgradeUrl)).then(N=>!N||u.signal.aborted?null:Ht(N,u.signal)).then(N=>{N&&(c||u.signal.aborted||(l?.setImage(N),n.requestRender()))}).catch(()=>{})}))}let f=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let h=n.camera.quaternion.slice(),y=()=>{let I=n.camera.position;l?.mesh.position.set(I.x,I.y,I.z);let[O,j,U]=Ya(i,a);n.camera.lookAt([I.x+O,I.y+j,I.z+U]),n.requestRender()};y();let b=document.createElement("div"),x=document.activeElement instanceof HTMLElement?document.activeElement:null;b.setAttribute("role","dialog"),b.setAttribute("aria-modal","true"),b.setAttribute("aria-label",r.seatLabel?`View from ${r.seatLabel}`:"View from seat"),b.tabIndex=-1,Object.assign(b.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let g=document.createElement("button");if(g.type="button",g.setAttribute("aria-label","Close"),g.textContent="\u2715",Object.assign(g.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"}),b.appendChild(g),r.disclosure){let I=document.createElement("div");I.textContent=`${r.disclosurePrefix??"360\xB0 panorama"} \xB7 ${r.disclosure}`,Object.assign(I.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)"}),b.appendChild(I)}let v=document.createElement("div");v.textContent=To(r.lookAroundHint),Object.assign(v.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"}),b.appendChild(v),e.appendChild(b),g.focus({preventScroll:!0});let P=!1,S=0,C=0,T=0,B=new Map,z=()=>{let[I,O]=[...B.values()];return I&&O?Math.hypot(I.x-O.x,I.y-O.y):0},D=I=>{let O=Eo(I);O!==s&&(s=O,n.camera.perspective({fov:s,aspect:n.camera.aspect}),y())},k=I=>{I.target!==g&&(B.set(I.pointerId,{x:I.clientX,y:I.clientY}),P=B.size===1,S=I.clientX,C=I.clientY,B.size===2&&(T=z()),b.setPointerCapture?.(I.pointerId),b.style.cursor="grabbing")},A=I=>{if(B.has(I.pointerId)){if(B.set(I.pointerId,{x:I.clientX,y:I.clientY}),B.size>=2){let O=z();T>0&&O>0&&D(s*(T/O)),T=O,P=!1;return}P&&(i+=(I.clientX-S)*Ka,a=Math.max(-ke,Math.min(ke,a+(I.clientY-C)*Ka)),S=I.clientX,C=I.clientY,y())}},_=I=>{B.delete(I.pointerId),T=B.size===2?z():0;let O=B.values().next().value;P=B.size===1,O?(S=O.x,C=O.y):b.style.cursor="grab";try{b.releasePointerCapture?.(I.pointerId)}catch{}},V=I=>{I.preventDefault(),D(s+I.deltaY*.04)};b.addEventListener("pointerdown",k),b.addEventListener("pointermove",A),b.addEventListener("pointerup",_),b.addEventListener("pointercancel",_),b.addEventListener("wheel",V,{passive:!1});let M=I=>{if(!c){if(I.key==="Tab"){I.preventDefault(),g.focus({preventScroll:!0});return}if(I.key==="Escape"){I.stopPropagation(),L.close();return}if(I.key==="ArrowLeft"||I.key==="ArrowRight")i+=I.key==="ArrowLeft"?-4:4;else if(I.key==="ArrowUp"||I.key==="ArrowDown")a=Math.max(-ke,Math.min(ke,a+(I.key==="ArrowUp"?4:-4)));else if(I.key==="+"||I.key==="="){D(s-5),I.preventDefault();return}else if(I.key==="-"){D(s+5),I.preventDefault();return}else return;I.preventDefault(),y()}};window.addEventListener("keydown",M);let R=0,E=(I,O)=>{if(!l){O?.();return}let j=I===1?0:1,U=performance.now(),N=()=>{if(c)return;let F=o<=0?1:Math.min(1,(performance.now()-U)/o);l?.setOpacity(j+(I-j)*F),n.requestRender(),F<1?R=requestAnimationFrame(N):O?.()};R=requestAnimationFrame(N)};E(1);let w=()=>{c||(c=!0,p(),u.abort(),r.signal?.removeEventListener("abort",d),cancelAnimationFrame(R),b.removeEventListener("pointerdown",k),b.removeEventListener("pointermove",A),b.removeEventListener("pointerup",_),b.removeEventListener("pointercancel",_),b.removeEventListener("wheel",V),window.removeEventListener("keydown",M),b.remove(),x?.isConnected&&x.focus({preventScroll:!0}),l?.dispose(),n.camera.position.set(m[0],m[1],m[2]),n.camera.perspective({fov:f,aspect:n.camera.aspect}),n.camera.quaternion.set(h[0],h[1],h[2],h[3]),n.requestRender())},L={close(){if(c)return;let I=()=>{w(),r.onClose?.()};cancelAnimationFrame(R),E(0,I)},dispose:w};return g.addEventListener("click",()=>L.close()),L}var Ka,Qa=Ct(()=>{"use strict";Wa();_n();_n();Io();Ka=.15});var Za={};Oo(Za,{createOpenPanorama:()=>Nd});function Nd(e){let{container:t,model:n,opts:r,analytics:o,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:u,gpu:d,gl:p,isContextLost:m,isDisposed:l,flightGen:f,setPanorama:h,getLoadAbort:y,setLoadAbort:b,setPanoramaSphereVisible:x,setFrozen:g,raisePanoramaLayer:v,restorePanoramaLayer:P,getOverviewChip:S,labelOverlay:C,reducedMotion:T,removeArriveChip:B,showArriveChip:z}=e;return async(D,k,A)=>{y()?.abort();let _=new AbortController;b(_);let V=n.seats.idToIndex.get(D);if(V===void 0){i.syncFromCamera();return}let M=s.get(D)?.label??D,R=u(D,V),E=c(D);if(!E){_.abort(),y()===_&&b(null),i.syncFromCamera();return}g(!0),a.stop();let w;try{w=await E}catch{if(y()===_&&b(null),o.panoramaFailed(D,"source"),!l()&&A===f()){g(!1),i.resumeAfterFlight(R.focal),a.requestRender();let K=z(D,A,!0);requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus())}return}if(l()||A!==f()){_.abort(),y()===_&&b(null);return}B();let L=S(),I=()=>{_.abort(),y()===_&&b(null),h(null),x(!1),P(),L.style.display="",C.setVisible(!r.arriveAtSeatEye),g(!1),o.panoramaClosed(),i.resumeAfterFlight(R.focal),a.requestRender();let K=z(D,f());requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus())},O=w.generated===!0,j=Ua(w);v(),x(!O),L.style.display="none";let U=T()?0:k,N=d(),F=N&&!m()?await qa(t,O?null:w,{gl:p,scene:N.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:O?R.eye:void 0,focalWorld:R.focal},{fadeMs:U,seatLabel:M,disclosure:j,disclosurePrefix:O?"Live seat-eye view":"360\xB0 panorama",lookAroundHint:r.lookAroundHint,onClose:I,signal:_.signal}):null;if(l()||A!==f()){_.abort(),x(!1),y()===_&&b(null),F?.dispose(),L.style.display="",P();return}if(F)i.syncFromCamera(),C.setVisible(!1),g(!1),a.requestRender(),h(F);else if(O){P(),L.style.display="",g(!1),i.resumeAfterFlight(R.focal),a.requestRender(),h(null),x(!1),o.panoramaFailed(D,"mount");let K=z(D,f(),!0);requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus()),y()===_&&b(null);return}else x(!1),o.panoramaFallback(D),h(ja(t,w,{fadeMs:U,seatLabel:M,disclosure:j,onClose:I,signal:_.signal,lookAroundHint:r.lookAroundHint}));o.panoramaOpened()}}var $a=Ct(()=>{"use strict";_n();Qa()});var Xd={};Oo(Xd,{VENUE3D_QUALITY_REPORT_VERSION:()=>qi,buildSceneModel:()=>gt,inspectVenue3DQualityEvidence:()=>xn,mountVenue3D:()=>Yd,prepareVenue3D:()=>ls,prepareVenue3DFromChart:()=>us});module.exports=ws(Xd);var zo=require("ogl");var Ps=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Cs(e){let t=Ps.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(o=>o+o).join(""):t[1],r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]}function ne(e){let t=Cs(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function Nn(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function As(e){return .2126*Nn(e[0])+.7152*Nn(e[1])+.0722*Nn(e[2])}function Bo(e){return As([e[0]*255,e[1]*255,e[2]*255])}function Rs(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=Rs(e);return ge(e,[n,n,n],t)}var fe=["available","held","sold","selected","dimmed"];function Rt(e){let t=fe.indexOf(e);return t<0?0:t}var No={available:[.24,.82,.52],held:[.95,.66,.22],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function Go(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.42,r=.62;return[(t+(e[0]-t)*n)*r,(t+(e[1]-t)*n)*r,(t+(e[2]-t)*n)*r]}var Gn={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]},Je={top:[.05,.06,.08],bottom:[.1,.12,.15]};function Me(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function Is(){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 qt=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 zo.Renderer({canvas:this.canvas,dpr:Is(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Je.top[0],Je.top[1],Je.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=r=>{r.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 dt=require("ogl"),pe=Math.PI/180,zn=15*pe,Hn=80*pe,ut=.12,Ho=35,Uo=1.25,Qt=class{constructor(t,n,r,o){this.fovY=Ho;this.target=new dt.Vec3;this.azimuth=-30*pe;this.polar=55*pe;this.distance=10;this.azT=-30*pe;this.polT=55*pe;this.distT=10;this.minDist=1;this.maxDist=100;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 dt.Vec3;this.panAnchor=new dt.Vec3;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new dt.Camera(t,{fov:Ho,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=o,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=i.button===2||i.button===1,s=i.button===0&&(i.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=a||s,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();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 c=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-c)*.005)),this.fireGesture()),this.pinchDist=c;let u=this.pinchCentroid();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}this.dragging&&(this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture(),this.azT-=a*.006,this.polT=Math.max(zn,Math.min(Hn,this.polT-s*.006)),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.dollyBy(Math.exp(s*.22)),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*pe;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(zn,Math.min(Hn,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(.82);else if(i.key==="-"||i.key==="_")this.dollyBy(1.22);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,r=0;for(let o of t)n+=o.x,r+=o.y;return{x:n/t.length,y:r/t.length}}panBy(t,n){let r=this.canvas.clientHeight||1,o=2*this.distance*Math.tan(this.fovY*pe/2)/r,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,u=Math.cos(this.polar),d=Math.sin(this.polar),p=-i*u,m=-a*u;this.targetT.x+=(-t*s+n*p)*o,this.targetT.z+=(-t*c+n*m)*o,this.targetT.y+=n*d*o,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,o=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(o-t,Math.min(o+t,this.targetT.z)),this.targetT.y=Math.max(r-t*.5,Math.min(r+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}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()}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}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,r,o=!1,i){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,t.radius)*1.5;let a=Math.max(1,t.radius),s=this.fovY*pe/2,c=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,u=Math.atan(Math.tan(s)*c);this.azT=r??-30*pe,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*pe;let d=this.fitDistance(t,s,u,this.azT,this.polT);this.distT=d*Math.max(1.05,Math.min(2,i?.margin??Uo)),this.minDist=Math.max(2,a*.12),this.maxDist=d*4,n?(this.azimuth=this.azT,this.polar=12*pe,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){this.camera.perspective({aspect:t})}frameSoft(t,n,r=!1,o){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,t.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*pe/2,a=r?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,o?.polarDeg??55))*pe;let c=this.fitDistance(t,i,s,this.azT,this.polT);this.distT=c*Math.max(1.05,Math.min(2,o?.margin??Uo))}fitDistance(t,n,r,o,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(r)),c=t.box;if(!c)return s;let u=Math.sin(i),d=-u*Math.sin(o),p=-Math.cos(i),m=-u*Math.cos(o);if(Math.abs(p)>.999)return s;let l=-m,f=d,h=Math.hypot(l,f);l/=h,f/=h;let y=-f*p,b=f*d-l*m,x=l*p,g=Math.tan(r),v=Math.tan(n),P=1;for(let S=0;S<8;S++){let C=(S&1?c.max[0]:c.min[0])-t.center[0],T=(S&2?c.max[1]:c.min[1])-t.center[1],B=(S&4?c.max[2]:c.min[2])-t.center[2],z=C*d+T*p+B*m,D=Math.abs(C*l+B*f),k=Math.abs(C*y+T*b+B*x);P=Math.max(P,D/g-z,k/v-z)}return Math.min(s,Math.max(P,a*.35))}updateClipping(t){let n=this.camera.position.x-t.center[0],r=this.camera.position.y-t.center[1],o=this.camera.position.z-t.center[2],i=Math.hypot(n,r,o),a=Math.max(1,t.radius)*1.18,s=Math.max(.05,i-a),c=Math.max(s+10,i+a);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,o=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(r)>1e-4||Math.abs(o)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*ut,this.polar+=n*ut,this.distance+=r*ut,this.target.x+=o*ut,this.target.y+=i*ut,this.target.z+=a*ut,c&&this.applyPosition(),c}get currentDistance(){return this.distance}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,o=Math.hypot(t,n,r)||1,i=Math.max(zn,Math.min(Hn,Math.acos(Math.max(-1,Math.min(1,n/o)))));this.distance=this.distT=o,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,r)}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),r=this.target.y+this.distance*Math.cos(this.polar),o=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,r,o),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()}};var Zt=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 o=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+o*.1:o}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 jo(e,t,n){return Math.max(t,Math.min(n,e))}var mt=2.5,Es=1.15,It=6,ft=10,Yo=6,Xo=9.5,Wo=.9,Ko=2.2,Un=30,jn=4,$t=8192;var nm=ft+jn;function qo(e,t){let n=t*1.4,r=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:mt};let o=Math.min(1,(e-n)/Math.max(.001,r-n));return{scale:1-o*.4,fade:o*.55,minPixels:mt+o*(Es-mt)}}function Qo(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}function Zo(e,t,n,r,o){if(!(e>0)||!(t>0)||!(n>0)||!(r>0)||!(o>0))return!1;let i=Math.tan(r/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(o/2);return Math.PI*a*a/e>=64}var Ts=[{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"}],rm=new Map(Ts.map(e=>[e.key,e]));var _s={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&&_s[t]||"#3b82f6"}var ks=[{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"}],im=new Map(ks.map(e=>[e.key,e]));var Ls=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],am=new Set(Ls);var er=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds: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}},{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}},{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}},{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}},{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}},{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}},{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}}],tr=er.map(e=>e.key),Fs=new Map(er.map(e=>[e.key,e]));function Jo(e){return typeof e=="string"&&Fs.has(e)}function nr(e,t){return Jo(e)?e:Jo(t?.seatGlyph)?t.seatGlyph:"circle"}var he=.02291666666666667,Ue=1/he,Ds=58,Os=Ds*he;var Vs=3,or=0,Yn=120,Bs=0,Ns=45,Gs=7,Ee=1.2;function Xn(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function zs(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Gs?e:Vs}function Jt(e,t={}){let n=Xn(t.floorBaseHeightM,or,Yn,0),r=Math.min(Yn,n+zs(e.elevation)*Os),o=e.height===void 0?r:Xn(e.height,or,Yn,r),i=Xn(e.rake,Bs,Ns,0);return{height:o,rake:i}}var ir=lt(require("earcut"),1),ar=lt(require("polygon-clipping"),1);var mm=Math.PI/180;function Wn(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;let r=e.length||1;return{x:t/r,y:n/r}}function Et(e){return e.length?Wn(e):null}function et(e){let t=0;for(let n=0,r=e.length;n<r;n+=1){let o=e[n],i=e[(n+1)%r];t+=o.x*i.y-i.x*o.y}return t/2}function Tt(e,t,n){let r=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){let a=e[o],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}var G=he,Hs=.002;function Us(e,t,n){let r=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),o=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(r,o,i);if(a<1e-9)return!0;let s=(r+o+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-r)*(s-o)*(s-i)))/a<Hs}var tt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,r){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++]=r}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 r=new Float32Array(n);r.set(this.buf.subarray(0,this.len)),this.buf=r}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},nn=class{constructor(){this.pos=new tt;this.nor=new tt;this.col=new tt;this.flr=new tt;this.mat=new tt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,r,o,i,a=i,s=i){Us(t,n,r)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.col.push3(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,r,o,i,a,s,c=s,u=s){[...t,...n,...r].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[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(u[0],u[1],u[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function js(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],u=o*c-i*s,d=i*a-r*c,p=r*s-o*a,m=Math.hypot(u,d,p)||1;return u/=m,d/=m,p/=m,[u,d,p]}function Ys(e,t){let n=[...e],r=[];for(let a of e)r.push(a.x,a.y);let o=[];if(t){for(let a of t)if(!(a.length<3)){o.push(n.length);for(let s of a)n.push(s),r.push(s.x,s.y)}}let i=(0,ir.default)(r,o.length?o:void 0,2);return{pts:n,tris:i}}function Kn(e){return et(e)<0?[...e].reverse():e}var Xs=3;function Ws(e,t,n,r){let o=r(e),i=r(t),a=r(n),s=(l,f,h,y)=>Math.abs(r({x:(l.x+f.x)/2,y:(l.y+f.y)/2})-(h+y)/2),c=(e.x+t.x+n.x)/3,u=(e.y+t.y+n.y)/3,d=(o+i+a)/3,p=Math.max(s(e,t,o,i),s(t,n,i,a),s(n,e,a,o),Math.abs(r({x:c,y:u})-d)),m=(l,f,h)=>{let y=Math.abs(r({x:(l+c)/2,y:(f+u)/2})-(h+d)/2);y>p&&(p=y)};return m((e.x+t.x)/2,(e.y+t.y)/2,(o+i)/2),m((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),m((n.x+e.x)/2,(n.y+e.y)/2,(a+o)/2),p}function _t(e,t,n,r,o){if(o<=0)return Ws(e,t,n,r);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(_t(e,i,s,r,o-1),_t(i,t,a,r,o-1),_t(s,a,n,r,o-1),_t(i,a,s,r,o-1))}function kt(e,t,n,r,o,i,a,s){if(a>0){let m={x:(t.x+n.x)/2,y:(t.y+n.y)/2},l={x:(n.x+r.x)/2,y:(n.y+r.y)/2},f={x:(r.x+t.x)/2,y:(r.y+t.y)/2};kt(e,t,m,f,o,i,a-1,s),kt(e,m,n,l,o,i,a-1,s),kt(e,f,l,r,o,i,a-1,s),kt(e,m,l,f,o,i,a-1,s);return}let c=[t.x*G,o(t),t.y*G],u=[n.x*G,o(n),n.y*G],d=[r.x*G,o(r),r.y*G];if(s){e.triN(c,u,d,s(t),s(n),s(r),i);return}let p=js(c,u,d);p[1]<0&&(p=[-p[0],-p[1],-p[2]]),e.tri(c,u,d,p,i)}var Ks=8;function rr(e,t,n){if(!Number.isFinite(n))return e;let r=[],o=(i,a,s,c,u)=>{if(u>0){let d={x:(i.x+a.x)/2,y:(i.y+a.y)/2},p=t(d);if(Math.abs(p-(s+c)/2)>n){o(i,d,s,p,u-1),o(d,a,p,c,u-1);return}}r.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];o(a,s,t(a),t(s),Ks)}return r}function en(e,t){if(e.length<3)return e;let n=[];for(let o of e){let i=n[n.length-1];i&&Math.hypot(o.x-i.x,o.y-i.y)<t||n.push(o)}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 r=[];for(let o=0;o<n.length;o++){let i=r.length?r[r.length-1]:n[(o-1+n.length)%n.length],a=n[o],s=n[(o+1)%n.length],c=s.x-i.x,u=s.y-i.y,d=Math.hypot(c,u);d>t&&Math.abs((a.x-i.x)*u-(a.y-i.y)*c)/d<t||r.push(a)}return r.length>=3?r:n}var tn=.001*Ue*.1;function ue(e,t,n,r,o,i,a,s,c=1/0,u){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs(et(t))<1e-4))return;let d=en(rr(en(Kn(t),tn),r,c),tn),p=n?.map(S=>en(rr(en(Kn(S),tn),r,c),tn)).filter(S=>S.length>=3&&Math.abs(et(S))>=1e-4),{pts:m,tris:l}=Ys(d,p),f=[i[0]*s.top,i[1]*s.top,i[2]*s.top],h=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],y=[a[0]*s.top,a[1]*s.top,a[2]*s.top],b=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],x=0;if(Number.isFinite(c))for(;x<Xs;x++){let S=0;for(let C=0;C<l.length;C+=3){let T=_t(m[l[C]],m[l[C+1]],m[l[C+2]],r,x);T>S&&(S=T)}if(S<=c)break}for(let S=0;S<l.length;S+=3){let C=m[l[S]],T=m[l[S+1]],B=m[l[S+2]];kt(e,C,T,B,r,f,x,u);let z=[C.x*G,o,C.y*G],D=[T.x*G,o,T.y*G],k=[B.x*G,o,B.y*G];e.tri(z,k,D,[0,-1,0],h)}let g=S=>{if(x<=0)return S;let C=1<<x,T=[];for(let B=0;B<S.length;B++){let z=S[B],D=S[(B+1)%S.length];for(let k=0;k<C;k++){let A=k/C;T.push({x:z.x+(D.x-z.x)*A,y:z.y+(D.y-z.y)*A})}}return T},v=Wn(d),P=[{ring:g(d),flip:!1}];if(p)for(let S of p)S.length>=3&&P.push({ring:g(S),flip:!0});for(let{ring:S,flip:C}of P)for(let T=0;T<S.length;T++){let B=S[T],z=S[(T+1)%S.length],D=(z.x-B.x)*G,A=(z.y-B.y)*G,_=-D,V=Math.hypot(A,_)||1;A/=V,_/=V;let M=(B.x+z.x)/2-v.x,R=(B.y+z.y)/2-v.y,E=A*M+_*R;C&&(E=-E),E<0&&(A=-A,_=-_);let w=[A,0,_],L=[B.x*G,r(B),B.y*G],I=[z.x*G,r(z),z.y*G],O=[B.x*G,o,B.y*G],j=[z.x*G,o,z.y*G];e.tri(L,I,j,w,y,y,b),e.tri(L,j,O,w,y,b,b)}}function sr(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),r=new Float32Array(t*3),o=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),r.set(c.normal,s*3),o.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:r,color:o,floor:i,material:a,count:t}}function on(e,t,n=2.5){if(t<=0||e.length<3)return e;let r=Kn(e),o=r.length,i=[];for(let s=0;s<o;s++){let c=r[s],u=r[(s+1)%o],d=u.x-c.x,p=u.y-c.y,m=Math.hypot(d,p)||1;i.push({x:p/m,y:-d/m})}let a=[];for(let s=0;s<o;s++){let c=r[s],u=i[(s-1+o)%o],d=i[s],p=u.x+d.x,m=u.y+d.y,l=Math.hypot(p,m),f=()=>{a.push([c.x+u.x*t,c.y+u.y*t]),a.push([c.x+d.x*t,c.y+d.y*t])};if(l<1e-9){f();continue}p/=l,m/=l;let h=p*u.x+m*u.y,y=1/Math.max(h,1e-6);if(!Number.isFinite(y)||y>n){f();continue}a.push([c.x+p*t*y,c.y+m*t*y])}if(a.length<3)return e;try{let s=ar.default.union([[...a,a[0]]]),c=null,u=-1/0;for(let p of s){let m=Math.abs(et(p[0].map(([l,f])=>({x:l,y:f}))));m>u&&(u=m,c=p[0])}if(!c)return e;let d=c.map(([p,m])=>({x:p,y:m}));if(d.length>1){let p=d[0],m=d[d.length-1];Math.abs(p.x-m.x)<1e-9&&Math.abs(p.y-m.y)<1e-9&&d.pop()}return d.length>=3?d:e}catch{return e}}function rn(e,t,n,r,o=28){let i=[];for(let a=0;a<o;a++){let s=a/o*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+r*Math.sin(s)})}return i}function Lt(e,t,n,r){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+r},{x:e,y:t+r}]}var ae={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},qs=.44,Qs=.15,cr=.3,Zs=.24;function lr(e){return e===void 0||!Number.isFinite(e)||e<=0?Zs:Math.min(cr,Math.max(Qs,e*qs))}var qn=.21,$s=.05,Qn=.45,an=Qn+$s,ur=.92,Zn=1.205,dr=-.23,mr=.38,Js=[{part:ae.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:ae.pad,min:[-1,.36,-.95],max:[1,Qn,1]},{part:ae.back,min:[-1,an,-1],max:[1,ur,-.72]},{part:ae.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:ae.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:ae.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:ae.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:ae.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:ae.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:ae.leg,min:[.62,0,.48],max:[.82,.37,.7]}],ec=[{part:ae.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:ae.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:ae.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:ae.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:ae.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],tc=[{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 fr(){let e=[],t=[],n=[],r=[],o=(V,M,R)=>{let E=n.length,[w,L,I]=V,O=[L[0]-w[0],L[1]-w[1],L[2]-w[2]],j=[I[0]-w[0],I[1]-w[1],I[2]-w[2]],U=O[1]*j[2]-O[2]*j[1],N=O[2]*j[0]-O[0]*j[2],F=O[0]*j[1]-O[1]*j[0],K=Math.hypot(U,N,F);K>1e-9?(U/=K,N/=K,F/=K):[U,N,F]=M,U*M[0]+N*M[1]+F*M[2]<0&&(U=-U,N=-N,F=-F);for(let X of V)e.push(...X),t.push(U,N,F),n.push(R);r.push(E,E+1,E+2,E,E+2,E+3)},i=V=>{for(let M of tc){let R=M.c.map(E=>E.map((w,L)=>w?V.max[L]:V.min[L]));o(R,M.n,V.part)}};for(let V of Js)i(V);for(let V of ec)i(V);let a=Qn,s=1.08,c=.47,u=.69,d=-.55,p=.08,m=-.48,l=.01,f=[-c,a,d],h=[c,a,d],y=[-c,a,p],b=[c,a,p],x=[-u,s,m],g=[u,s,m],v=[-u,s,l],P=[u,s,l];o([h,g,P,b],[1,0,0],ae.body),o([y,v,x,f],[-1,0,0],ae.body),o([v,P,g,x],[0,1,0],ae.body),o([f,h,b,y],[0,-1,0],ae.body),o([b,P,v,y],[0,0,1],ae.body),o([f,x,g,h],[0,0,-1],ae.body);let S=10,C=8,T=[0,Zn,dr],B=[.42,.115,mr],z=n.length;for(let V=0;V<=C;V++){let M=Math.PI*V/C,R=Math.cos(M),E=Math.sin(M);for(let w=0;w<=S;w++){let L=Math.PI*2*w/S,I=E*Math.cos(L),O=E*Math.sin(L);e.push(T[0]+B[0]*I,T[1]+B[1]*R,T[2]+B[2]*O);let j=I/B[0],U=R/B[1],N=O/B[2],F=Math.hypot(j,U,N)||1;j/=F,U/=F,N/=F,t.push(j,U,N),n.push(ae.head)}}for(let V=0;V<C;V++)for(let M=0;M<S;M++){let R=z+V*(S+1)+M,E=R+S+1;r.push(R,E,R+1,R+1,E,E+1)}let D=new Float32Array(e),k=new Float32Array(t),A=new Float32Array(n),_=new Uint16Array(r);return{position:D,normal:k,part:A,index:_,vertexCount:n.length,indexCount:r.length}}function pr(e,t,n,r){let o=new Float32Array(t),i=u=>e[u*3],a=u=>e[u*3+2],s=0,c=(u,d)=>{let p=d-u;for(let m=u;m<d;m++){let[l,f]=r(m),h=l-i(m),y=f-a(m);if(p>=2){let b=Math.max(u,m-1),x=Math.min(d-1,m+1),g=i(x)-i(b),v=a(x)-a(b),P=Math.hypot(g,v);if(P>1e-6){let S=-v/P,C=g/P;S*h+C*y<0&&(S=-S,C=-C),h=S,y=C}}o[m]=h===0&&y===0?0:Math.atan2(h,y)}};for(let u=1;u<=t;u++)(u===t||n(u)!==n(s))&&(c(s,u),s=u);return o}var De=.22;function hr(e,t){let n=fe[e];if(n!=="sold"&&n!=="held")return-1;let r=(t+1)*2654435761;return r^=r>>>15,r=Math.imul(r,2246822519),r^=r>>>13,(r>>>0)%1e5/1e5}var nc=.42;function oc(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let r=1/0,o=1/0,i=-1/0,a=-1/0;for(let f of e)f.x<r&&(r=f.x),f.y<o&&(o=f.y),f.x>i&&(i=f.x),f.y>a&&(a=f.y);let s=Math.max(i-r,1e-6),c=Math.max(a-o,1e-6),u=Math.max(Math.sqrt(s*c/t),1e-6),d=Math.max(1,Math.ceil(s/u)+1),p=Math.max(1,Math.ceil(c/u)+1),m=new Map,l=(f,h)=>{let y=Math.min(d-1,Math.max(0,Math.floor((f-r)/u)));return Math.min(p-1,Math.max(0,Math.floor((h-o)/u)))*d+y};for(let f=0;f<t;f++){let h=l(e[f].x,e[f].y),y=m.get(h);y?y.push(f):m.set(h,[f])}for(let f=0;f<t;f++){let h=e[f],y=Math.min(d-1,Math.max(0,Math.floor((h.x-r)/u))),b=Math.min(p-1,Math.max(0,Math.floor((h.y-o)/u))),x=1/0;for(let g=1;g<=4;g++){for(let v=b-g;v<=b+g;v++)if(!(v<0||v>=p))for(let P=y-g;P<=y+g;P++){if(P<0||P>=d||g>1&&Math.abs(v-b)<g&&Math.abs(P-y)<g)continue;let S=m.get(v*d+P);if(S)for(let C of S){if(C===f)continue;let T=Math.hypot(e[C].x-h.x,e[C].y-h.y);T<x&&(x=T)}}if(Number.isFinite(x)&&x<=g*u)break}n[f]=x}return n}function rc(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-Ee):0}function br(e,t,n,r,o,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),u=new Float32Array(a*3),d=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),l=new Float32Array(a),f=new Float32Array(a*3),h=new Map,y=oc(e);for(let b=0;b<a;b++){let x=e[b],v=(n?.seatPitchU(b)??y[b])*G;d[b]=Number.isFinite(v)?Math.max(.06,Math.min(De,v*nc)):De,p[b]=lr(Number.isFinite(v)?v:void 0);let P=nr(x.glyph,{seatGlyph:i?.get(x.categoryKey)});m[b]=tr.indexOf(P),l[b]=x.wheelchairSpaceType==="no-seat"?0:1,s[b*3]=x.x*G,s[b*3+1]=n?n.seatDeckY(b):rc(x),s[b*3+2]=x.y*G,c[b]=Rt(t?t(x):"available");let S=ne(o?.get(x.categoryKey)??"#6e7bff")??[.43,.48,1];if(u[b*3]=S[0],u[b*3+1]=S[1],u[b*3+2]=S[2],x.accessibility?.length){let C=ne($o(x.accessibility));C&&(f[b*3]=C[0],f[b*3+1]=C[1],f[b*3+2]=C[2])}h.set(x.id,b)}return{count:a,iPosition:s,iState:c,iCategory:u,iMaxRadius:d,iRing:f,idToIndex:h,iChairWidth:p,iGlyph:m,iPhysicalSeat:l,iFloor:r??new Float32Array(a),iYaw:new Float32Array(a)}}var ic=64;function $n(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=Rt(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let r=[],o=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+ic){i=s;continue}r.push({start:o,length:i-o+1}),o=s,i=s}}return r.push({start:o,length:i-o+1}),r}var ac=.15,sc=1.6;function yr(e){return jo(e??1,ac,sc)}var cc=.15,lc=.9,uc=1.76;function dc(){return{background:{top:[...Je.top],bottom:[...Je.bottom]},structure:Gn,seatStates:{...No},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function gr(e){let t=dc();if(!e)return t;let n=ne(e.background);if(n){t.background={top:Me(n,lc),bottom:Me(n,uc)};let a={};for(let[s,c]of Object.entries(Gn))a[s]=ge(c,n,cc);t.structure=a}let r=ne(e.selectionColor)??ne(e.accent);r&&(t.seatStates={...t.seatStates,selected:r});let o=e.seatScale;typeof o=="number"&&Number.isFinite(o)&&(t.seatScale=yr(o));let i=e.venue3d;if(i){let a=ne(i.deck),s=ne(i.fascia);a&&(t.structure={...t.structure,tierTop:a,gaTop:a}),s&&(t.structure={...t.structure,tierWall:s,gaWall:s}),t.materials.seat=ne(i.seat),t.materials.shell=ne(i.shell),typeof i.roughness=="number"&&Number.isFinite(i.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,i.roughness)))}return t}function xr(e,t){let n=[];for(let r of t)n.push(...e.seatStates[r]);return n}function vr(e,t){let n=1-t,r=n*n*n,o=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:r*e.start.x+o*e.control1.x+i*e.control2.x+a*e.end.x,y:r*e.start.y+o*e.control1.y+i*e.control2.y+a*e.end.y}}function Sr(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[vr(e,.5)];let r=Array.from({length:n+1},(c,u)=>vr(e,u/n)),o=new Float64Array(r.length);for(let c=1;c<r.length;c+=1){let u=r[c].x-r[c-1].x,d=r[c].y-r[c-1].y;o[c]=o[c-1]+Math.hypot(u,d)}let i=o[o.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 u=i*c/(t-1);for(;s<o.length-1&&o[s]<u;)s+=1;let d=o[s-1],p=o[s],m=p===d?0:(u-d)/(p-d);a.push({x:r[s-1].x+(r[s].x-r[s-1].x)*m,y:r[s-1].y+(r[s].y-r[s-1].y)*m})}return a}function Mr(e){let t=new Map,n=new Map;for(let r of e){if(r.type!=="row"||!r.segmentedRow)continue;let o=n.get(r.segmentedRow.groupId)??[];o.push(r),n.set(r.segmentedRow.groupId,o)}for(let[r,o]of n){let i=o.slice().sort((m,l)=>m.segmentedRow.componentIndex-l.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((m,l)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===r&&m.segmentedRow.componentCount===a&&m.segmentedRow.componentIndex===l&&m.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(l===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===s.displayLabel)))continue;let u=i.reduce((m,l)=>m+l.seatCount,0),d=0,p=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(d+=1),t.set(m.id,{groupId:r,adjacencyOffset:d,displayOffset:p,displayLabel:s.displayLabel,totalSeats:u,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),d+=m.seatCount,p+=m.seatCount}return t}var mc="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var fc="abcdefghijklmnopqrstuvwxyz";function pc(e,t){let n=t.length,r=e+1,o="";for(;r>0;){r-=1;let i=r%n;o=t[i]+o,r=Math.floor(r/n)}return o}function Jn(e,t=!1){let n=t?fc:mc;return pc(Math.max(0,Math.floor(e)-1),n)}var hc=[[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 wr(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[r,o]of hc)for(;t>=r;)n+=o,t-=r;return n}function bc(e){let t=new Array(e);return Array.from({length:e},(n,r)=>r).sort((n,r)=>Math.abs(2*n-(e-1))-Math.abs(2*r-(e-1))||n-r).forEach((n,r)=>t[n]=r),t}function eo(e,t){let n=e.seatLabelStart??1,r=e.seatNumbering?.direction??"ltr",o=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 l=Math.ceil(c/2),f=i==="updown"?t<l?n+2*t:n-1+2*(c-t):t<l?n+2*(l-1-t):n+1+2*(t-l);return`${a}${f}`}let u=i==="odd"||i==="even"?2:o,d=s!=null&&Number.isFinite(s)?s-(c-1)*u:n,p=r==="center"?bc(c)[t]:r==="rtl"?c-1-t:t,m;switch(i){case"odd":{let l=d%2===1?d:d+1;m=String(l+p*2);break}case"even":{let l=d%2===0?d:d+1;m=String(l+p*2);break}case"roman":m=wr(d+p*o);break;case"letters-upper":m=Jn(d+p*o,!1);break;case"letters-lower":m=Jn(d+p*o,!0);break;default:m=String(d+p*o);break}return`${a}${m}`}function yc(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Pr(e,t,n){return n?.label??`${e.label}-${eo(e,t)}`}function to(e,t,n,r){if(r?.displayLabel)return r.displayLabel;if(!n)return`${e.displayLabel||e.label}-${eo(e,t)}`;let o=yc(n),i=n.displayOffset+t;return`${n.displayLabel}-${eo(o,i)}`}function Cr(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 pt(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 r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],s=a.x-i.x,c=a.y-i.y,u=s*s+c*c,d=u>1e-12?((t-i.x)*s+(n-i.y)*c)/u:0;d<0?d=0:d>1&&(d=1);let p=Math.hypot(t-(i.x+d*s),n-(i.y+d*c));p<r&&(r=p)}return r}function gc(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let r=e.length||1;t/=r,n/=r;let o=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>o&&(o=a)}return{cx:t,cy:n,r:o}}function Ar(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function no(e,t){let n=1/0;for(let r of Cr(e)){let o=pt(t,r.x,r.y);o<n&&(n=o)}for(let r of Cr(t)){let o=pt(e,r.x,r.y);o<n&&(n=o)}return n}function xc(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,r=0;for(let d of e)n+=d.x,r+=d.y;n/=e.length,r/=e.length;let o=-1,i=e[0];for(let d of e){let p=Math.hypot(d.x-n,d.y-r);p>o&&(o=p,i=d)}let a=i.x-n,s=i.y-r,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let u=e.map((d,p)=>({p:d,i:p,t:(d.x-n)*a+(d.y-r)*s})).sort((d,p)=>d.t-p.t);return{pts:u.map(d=>d.p),seatIndices:u.map(d=>t[d.i])}}function oo(e){let t=e.length;if(t<3)return null;let n=0,r=0;for(let x of e)n+=x.x,r+=x.y;n/=t,r/=t;let o=0,i=0,a=0,s=0,c=0,u=0,d=0;for(let x of e){let g=x.x-n,v=x.y-r;o+=g*g,a+=v*v,i+=g*v,s+=g*g*g,c+=v*v*v,u+=g*v*v,d+=v*g*g}let p=o*a-i*i;if(Math.abs(p)<1e-9)return null;let m=(s+u)/2,l=(c+d)/2,f=(m*a-l*i)/p,h=(l*o-m*i)/p,y=f+n,b=h+r;return!Number.isFinite(y)||!Number.isFinite(b)?null:{cx:y,cy:b}}var vc=.15;function Sc(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,v=0;for(let P of x.pts)g+=P.x,v+=P.y;return{x:g/x.pts.length,y:v/x.pts.length}}),n=0,r=0;for(let x of t)n+=x.x,r+=x.y;n/=t.length,r/=t.length;let o=0,i=0,a=0;for(let x of t){let g=x.x-n,v=x.y-r;o+=g*g,i+=g*v,a+=v*v}let s=o+a,c=o*a-i*i,u=s/2+Math.sqrt(Math.max(0,s*s/4-c)),d,p;Math.abs(i)>1e-12?(d=u-a,p=i):o>=a?(d=1,p=0):(d=0,p=1);let m=Math.hypot(d,p);if(!(m>1e-12))return null;d/=m,p/=m;let l=1/0,f=-1/0,h=[];for(let x of e){let g=1/0,v=-1/0;for(let P of x.pts){let S=P.x*d+P.y*p;S<g&&(g=S),S>v&&(v=S),S<l&&(l=S),S>f&&(f=S)}h.push(v-g)}let y=f-l;return y>1e-9?(h.sort((x,g)=>x-g),h[Math.min(h.length-1,Math.floor(h.length*.9))]/y<=Mc?{x:d,y:p}:null):null}var Mc=.35;function sn(e,t,n,r){let o=new Map;for(let y of n){let b=t[y],x=b.rowId||`__seat-${y}`,g=o.get(x);g||(g={pts:[],idx:[]},o.set(x,g)),g.pts.push({x:b.x,y:b.y}),g.idx.push(y)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[y,b]of o){let x=xc(b.pts,b.idx),g=0;for(let v of x.pts)g+=Math.hypot(v.x-r.x,v.y-r.y);i.push({id:y,pts:x.pts,seatIndices:x.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/x.pts.length})}let a=i.map(y=>gc(y.pts)),s=[];for(let y=0;y<i.length;y++){let b=1/0;for(let x=0;x<i.length;x++){if(y===x||Ar(a[y],a[x])>=b)continue;let g=no(i[y].pts,i[x].pts);g<b&&(b=g)}Number.isFinite(b)&&s.push(b)}s.sort((y,b)=>y-b);let c=s.length?s[Math.floor(s.length/2)]:1,u=Math.max(c*1.8,1e-6),d=i.map(()=>[]);for(let y=0;y<i.length;y++)for(let b=y+1;b<i.length;b++)Ar(a[y],a[b])>u||no(i[y].pts,i[b].pts)<=u&&(d[y].push(b),d[b].push(y));let p=0;for(let y=0;y<i.length;y++){if(i[y].blockId!==-1)continue;let b=p++,x=[y];for(i[y].blockId=b;x.length;){let g=x.pop();for(let v of d[g])i[v].blockId===-1&&(i[v].blockId=b,x.push(v))}}let m=new Map;for(let y of i){let b=m.get(y.blockId)??[];b.push(y),m.set(y.blockId,b)}let l=[];for(let y of i){if(y.pts.length<4)continue;let b=oo(y.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||l.push({x:b.cx,y:b.cy}))}let f=l.length>=2?(()=>{let y=l.map(g=>g.x).sort((g,v)=>g-v),b=l.map(g=>g.y).sort((g,v)=>g-v),x=Math.floor(l.length/2);return{cx:y[x],cy:b[x]}})():null;if(f){let y=S=>Math.hypot(S.x-f.cx,S.y-f.cy),b=1/0,x=-1/0,g=[];for(let S of i){let C=1/0,T=-1/0;for(let B of S.pts){let z=y(B);z<C&&(C=z),z>T&&(T=z)}g.push(T-C),C<b&&(b=C),T>x&&(x=T)}let v=x-b;g.sort((S,C)=>S-C);let P=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(v>1e-9&&P/v<=vc){let S=i.map(M=>{let R=0;for(let E of M.pts)R+=y(E);return{row:M,radius:R/M.pts.length}}),C=0,T=0;for(let M of S)C+=M.radius,T+=M.row.focalDistance;C/=S.length,T/=S.length;let B=0;for(let M of S)B+=(M.radius-C)*(M.row.focalDistance-T);if(B<0)for(let M of S)M.radius=-M.radius;let D=1/0;for(let M of S)M.radius<D&&(D=M.radius);S.sort((M,R)=>M.radius-R.radius);let k=-1,A=-1/0,_=v/Math.max(1,S.length)*.5,V=[];for(let M of S)M.radius-A>_&&(k++,A=M.radius),M.row.ordinal=k,M.row.blockDepth=M.radius-D,V.push(M.row);return{sectionId:e,rows:V,blockCount:p}}}let h=[];for(let[,y]of m){let b=Sc(y);if(b){let x=v=>{let P=0;for(let S of v.pts)P+=S.x*b.x+S.y*b.y;return P/v.pts.length};y.sort((v,P)=>x(v)-x(P)),y.length>=2&&y[0].focalDistance>y[y.length-1].focalDistance&&y.reverse();let g=0;for(let v=0;v<y.length;v++)v>0&&(g+=no(y[v-1].pts,y[v].pts)),y[v].ordinal=v,y[v].blockDepth=g,h.push(y[v])}else{let x=1/0;for(let g of y)g.focalDistance<x&&(x=g.focalDistance);y.sort((g,v)=>g.focalDistance-v.focalDistance);for(let g=0;g<y.length;g++)y[g].ordinal=g,y[g].blockDepth=Math.max(0,y[g].focalDistance-x),h.push(y[g])}}return{sectionId:e,rows:h,blockCount:p}}var wc=/^\d{4}-\d{2}-\d{2}$/;function Pc(e){let t=Date.parse(e);return Number.isFinite(t)?wc.test(e)?t+864e5:t:null}function Cc(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let r=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(r)&&(t instanceof Date?t.getTime():t)<=r+366*864e5}let n=Pc(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Ac(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Rc(e){return e.status!=="draft"&&e.status!=="retracted"}function Ic(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 Rr(e,t={}){return!!e&&Rc(e)&&Ac(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Ic(e,t.activeBasisSha256)&&Cc(e,t.now)}var Gm=Math.PI*2;function cn(e){return e==="pitch-football"||e==="rink-hockey"||e==="track-athletics"||e==="oval-cricket"}var Ec=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Tc=/[\s"'<>`\\]/;function _c(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Ec.test(e);if(Tc.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Ir(e){let t=e.trim();return _c(t)?t:null}var ro="seatlayer.event-configuration/1";var ht=100,kc=120,Lc=1e5,Fc=1e4,Dc=/^[a-f0-9]{64}$/,Oc=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Ft(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nt(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Vc(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function Er(e){return!Array.isArray(e)||e.length>Lc||!e.every(t=>nt(t,ht))?null:[...new Set(e)].sort()}function Bc(e){return!Ft(e)||!nt(e.chartId,ht)||!nt(e.version,ht)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Dc.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function io(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Nc(e){return Ft(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&io(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Gc(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Fc)return null;let n=new Set(t),r=new Set,o=new Set,i=0,a=[];for(let s of e){if(!Ft(s)||!nt(s.id,ht)||!nt(s.objectId,ht)||!n.has(s.objectId)||!Oc.has(String(s.kind))||!io(s.heightM,.05,50)||s.baseElevationM!==void 0&&!io(s.baseElevationM,-10,100))return null;let c=Nc(s.occlusion);if(!c||r.has(s.id)||o.has(s.objectId))return null;let u=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?Ir(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!u||s.kind!=="screen"||++i>1))return null;r.add(s.id),o.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,...u?{contentImageUrl:u}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function zc(e){let t=[];if(!Ft(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==ro&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${ro}`}),nt(e.id,ht)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),nt(e.label,kc)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Vc(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Bc(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 r=Ft(e.overlay)?e.overlay:null,o=Er(r?.objectIds),i=Er(r?.productionKillSeatIds),a=o?Gc(r?.productionElements,o):null;return(!r||!o||!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||!o||!i||a===null?{issues:t}:{issues:t,value:{schema:ro,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function Tr(e){let t=zc(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Hc(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,r=e.width,o=e.height;return[{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+o},{x:t,y:n+o}]}function Uc(e,t,n){let r=n*Math.PI/180,o=Math.cos(r),i=Math.sin(r),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*o-s*i,y:t.y+a*i+s*o}}function _r(e){let t=Hc(e);if(!t||t.length<2)return null;let n=e.rotation??0,r=Math.abs(n)<1e-6?t:t.map(c=>Uc(c,{x:t.reduce((u,d)=>u+d.x,0)/t.length,y:t.reduce((u,d)=>u+d.y,0)/t.length},n)),o=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of r)o=Math.min(o,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(o)||a-o<1e-6||s-i<1e-6?null:{minX:o,minY:i,maxX:a,maxY:s}}var jc=5,Yc=3,Xc=.92,Wc=1.9,Kc=2,qc=.6,Qc=1,Zc=.06;function $c(e){return e.heightM!==void 0?e.heightM:cn(e.stageKind)?Zc:Qc}function kr(e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=-1/0;for(let a of Dr(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let u=_r(c);u&&(t=Math.min(t,u.minX),n=Math.min(n,u.minY),r=Math.max(r,u.maxX),o=Math.max(o,u.maxY),i=Math.max(i,s+$c(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:r,maxY:o,deckTopM:i}}function Jc(e,t,n,r){let o=1/0,i=1/0,a=-1/0,s=-1/0;for(let l of e)Number.isFinite(l.eyeHeightM)&&(o=Math.min(o,l.x),a=Math.max(a,l.x),i=Math.min(i,l.y),s=Math.max(s,l.y));if(!Number.isFinite(o))return null;let c=o*t,u=i*t,d=Math.max(1,Math.ceil((a-o)*t/n)+1),p=Math.max(1,Math.ceil((s-i)*t/n)+1),m=new Float64Array(d*p).fill(-1/0);for(let l of e){if(!Number.isFinite(l.eyeHeightM))continue;let f=l.eyeHeightM-Ee,h=Math.min(d-1,Math.max(0,Math.floor((l.x*t-c)/n))),b=Math.min(p-1,Math.max(0,Math.floor((l.y*t-u)/n)))*d+h,x=f+r;x>m[b]&&(m[b]=x)}return{cellM:n,minX:c,minY:u,cols:d,rows:p,top:m}}function el(e,t,n){let r=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return r<0||o<0||r>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+r]}function Lr(e,t,n={}){let r=new Map;if(!t||!e.length)return r;let o=n.metresPerChartUnit??he,i=n.cellM??qc,a=n.chairBackM??Xc,s=n.selfRowSkipM??Kc,c=n.clearThreshold??.9,u=n.partialThreshold??.25,d=Math.max(1,n.columns??jc),p=Math.max(1,n.rows??Yc),m=Jc(e,o,i,a);if(!m)return r;let l=(t.maxX-t.minX)*o,f=(t.maxY-t.minY)*o,h=l>=f,y=(t.minX+t.maxX)/2*o,b=(t.minY+t.maxY)/2*o,x=[];for(let v=0;v<d;v++){let P=(v+.5)/d-.5,S=h?y+P*l:y,C=h?b:b+P*f;for(let T=0;T<p;T++){let B=t.deckTopM+(p===1?0:T/(p-1)*Wc);x.push({x:S,y:C,z:B})}}let g=i/2;for(let v of e){if(!Number.isFinite(v.eyeHeightM))continue;let P=v.x*o,S=v.y*o,C=v.eyeHeightM,T=0,B=1/0;for(let D of x){let k=D.x-P,A=D.y-S,_=Math.hypot(k,A);if(!(_>s)){T++;continue}let V=k/_,M=A/_,R=0;for(let E=s;E<_;E+=g){let w=el(m,P+V*E,S+M*E);if(!(!Number.isFinite(w)||w>=C)&&w>C+(D.z-C)*E/_){R=E;break}}R?B=Math.min(B,R):T++}let z=T/x.length;z>=c||r.set(v.id,{seatId:v.id,mark:z<u?"obstructedView":"restrictedView",visibleFraction:z,totalRays:x.length,atDistanceM:Number.isFinite(B)?B:0})}return r}function Fr(e,t){if(!t.size)return 0;let n=0;for(let r of e){let o=t.get(r.id);if(!o)continue;let i=r.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(r.commercial={...i,[o.mark]:!0},n++)}return n}function Gr(e){return e?e.accessibility&&e.accessibility.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var ln=Math.PI/180;var Dt=16;function so(e,t,n,r){let o=n*ln,i=Math.cos(o),a=Math.sin(o);return{x:r.x+e*i-t*a,y:r.y+e*a+t*i}}function tl(e){let{seatCount:t,seatSpacing:n,curve:r,rotation:o,origin:i}=e,a=[];if(e.path)return Sr(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(r===0){for(let u=0;u<t;u++)a.push(so(u*n,0,o,i));return a}let s=r/(t-1)*ln,c=n/(2*Math.sin(Math.abs(s)/2));for(let u=0;u<t;u++){let d=u*s,p=c*Math.sin(d),m=-c+c*Math.cos(d);a.push(so(p,m,o,i))}return a}function nl(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function ol(e,t){let n=nl(e);return tl(e).map((r,o)=>{let i=n.get(o),a=Gr(i),s=Pr(e,o,i),c={...e.commercial,...i?.commercial};return{index:o,x:r.x+(i?.dx??0),y:r.y+(i?.dy??0),label:s,displayLabel:to(e,o,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(u=>u!==void 0&&u!==!1&&u!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function zr(e){let t=[];for(let n of ol(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 rl(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)),r={top:0,bottom:0,left:0,right:0};if(!n.length)return r;let o=Math.max(0,Math.round(e.seatCount));for(let i=0;i<o;i++)r[n[i%n.length]]+=1;return r}function il(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let r=new Map((e.overrides??[]).map(d=>[d.index,d])),o=(d,p,m,l)=>{let f=r.get(d),h=Gr(f),y=f?.label??`${e.label}-${d+1}`,b=e.displayLabel??e.label;return{index:d,label:y,displayLabel:f?.displayLabel??`${b}-${d+1}`,x:p+(f?.dx??0),y:m+(f?.dy??0),categoryKey:f?.categoryKey??e.categoryKey,skipped:!!f?.skip,accessible:h.length>0,accessibility:h,wheelchairSpaceType:f?.wheelchairSpaceType,commercial:f?.commercial,glyph:f?.glyph,viewUrl:f?.viewFromSeatUrl,viewMeta:f?.viewFromSeatUrl?f.viewFromSeatMeta:void 0,labelStyle:f?.labelStyle,...l?{side:l}:{}}};if(e.shape==="round"){let d=(e.radius??40)+Dt,p=e.rotation*ln,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let y=0;y<n;y++){let b=p+y/n*2*Math.PI;t.push(o(y,e.center.x+d*Math.cos(b),e.center.y+d*Math.sin(b)))}return t}let l=m*ln,f=(2*Math.PI-l)/2,h=p+f;for(let y=0;y<n;y++){let b=h+y/(n-1)*l;t.push(o(y,e.center.x+d*Math.cos(b),e.center.y+d*Math.sin(b)))}return t}let i=e.width??80,a=e.height??50,s=rl(e),c=["top","bottom","left","right"],u=0;for(let d of c){let p=s[d];for(let m=0;m<p;m++){let l,f;d==="top"?(l=-i/2+(m+.5)*i/p,f=-a/2-Dt):d==="bottom"?(l=-i/2+(m+.5)*i/p,f=a/2+Dt):d==="left"?(l=-i/2-Dt,f=-a/2+(m+.5)*a/p):(l=i/2+Dt,f=-a/2+(m+.5)*a/p);let h=so(l,f,e.rotation,e.center);t.push(o(u++,h.x,h.y,d))}}return t}function al(e){return il(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 sl(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"}]}function Or(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,s=t[o].x,c=t[o].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function cl(e,t){return t.some((n,r)=>{let o=t[(r+1)%t.length],i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),s=(o.x-n.x)**2+(o.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function ot(e,t,n){return Or(e,t)&&!(n??[]).some(r=>Or(e,r)||cl(e,r))}function ao(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;return{x:t/e.length,y:n/e.length}}function ll(e){switch(e.type){case"row":{let t=zr(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,r=0;for(let o of t)n+=o.x,r+=o.y;return{x:n/t.length,y:r/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return ao(e.points);case"section":return ao(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?ao(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 Vr(e,t){return e.length===t.length&&e.every((n,r)=>n.x===t[r].x&&n.y===t[r].y)}function ul(e,t){if(e.type!=="gaArea"||!Vr(e.points,t.outline))return!1;let n=e.holes??[],r=t.holes??[];return n.length===r.length&&n.every((o,i)=>Vr(o,r[i]))}function dl(e,t){let n=e.filter(a=>a.type==="section"),r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,o=ll(t);return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(ul(t,a)||ot(o,a.outline,a.holes))):void 0)??n.find(a=>ot(o,a.outline,a.holes))}function Dr(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 Br(e,t,n,r,o,i,a,s,c){let u=[],d=Mr(e),p=f=>!f?.eventConfigurationId||f.eventConfigurationId===r&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===c),m=f=>Rr(f,{activeConfigurationId:r,activeConfigurationVersion:c,activeBasisSha256:o,now:s}),l=(f,h)=>m(f)?{...f,coverage:h}:void 0;for(let f of e){let h=[];if(f.type==="row"?h=zr(f):f.type==="table"?h=al(f):f.type==="booth"&&(h=sl(f)),!h.length)continue;for(let v of h)v.viewUrl&&!p(v.viewMeta)&&(v.viewUrl=void 0,v.viewMeta=void 0);if(f.type==="row"){let v=d.get(f.id);if(v){let P=new Map((f.overrides??[]).map(S=>[S.index,S]));for(let S of h){let C=Number(S.id.slice(S.id.lastIndexOf(":")+1));if(!Number.isInteger(C))continue;S.logicalRowId=v.groupId,S.logicalSeatIndex=v.adjacencyOffset+C,P.get(C)?.displayLabel||(S.displayLabel=to(f,C,v)),!S.viewUrl&&v.viewFromSeatUrl&&p(v.viewFromSeatMeta)&&(S.viewUrl=v.viewFromSeatUrl,S.viewMeta=v.viewFromSeatMeta);let T=P.get(C)?.confidenceEvidence;S.confidenceEvidence=l(T,"exact-seat")??l(f.confidenceEvidence,"row-representative")??l(v.confidenceEvidence,"row-representative")}}}let y=dl(e,f),b=y?.viewFromSeatUrl,g=(y?.zone?t?.find(v=>v.id===y.zone):void 0)?.focalPoint??n;for(let v of h){if(!v.confidenceEvidence){let P=Number(v.id.slice(v.id.lastIndexOf(":")+1)),S=(f.type==="row"||f.type==="table")&&Number.isInteger(P)?f.overrides?.find(C=>C.index===P)?.confidenceEvidence:void 0;v.confidenceEvidence=l(S,"exact-seat")??(f.type==="row"?l(f.confidenceEvidence,"row-representative"):void 0)}v.confidenceEvidence??=l(y?.confidenceEvidence,"section-representative")??(a?l(a.evidence,a.coverage):void 0),!v.viewUrl&&b&&p(y?.viewFromSeatMeta)&&(v.viewUrl=b,v.viewMeta=y?.viewFromSeatMeta),!v.viewUrl&&i&&p(i.meta)&&(v.viewUrl=i.url,v.viewMeta=i.meta),y&&(v.sectionId=y.logicalSectionId??y.id),y?.zone&&(v.zoneId=y.zone),g&&(v.focalPoint={...g})}u.push(...h)}return u}function Hr(e,t={}){if(e.floors?.length){let r=[];for(let o of e.floors){let i=o.focalPoint??e.focalPoint,a=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=Br(o.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Nr(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,c);for(let u of c)u.floorId=o.id;r.push(...c)}return r}let n=Br(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&&Nr(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),ml(e,n,t)}function ml(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Fr(t,Lr(t,kr(e))),t}function Nr(e,t,n,r){let o=e.filter(d=>d.type==="section"),i=n>0||o.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!o.length||!i||!t){for(let d of r)d.eyeHeightM=n+Ee;return}let a=new Array(r.length),s=new Map,c=new Map;for(let d=0;d<r.length;d++){let p=r[d],l=(p.sectionId?o.find(h=>h.id===p.sectionId)??o.find(h=>h.logicalSectionId===p.sectionId&&ot({x:p.x,y:p.y},h.outline,h.holes)):void 0)??o.find(h=>ot({x:p.x,y:p.y},h.outline,h.holes))??null;if(a[d]=l,!l)continue;s.has(l.id)||s.set(l.id,Jt(l,{floorBaseHeightM:n}));let f=c.get(l.id);f?f.push(d):c.set(l.id,[d])}let u=new Array(r.length).fill(void 0);for(let[d,p]of c){let m=s.get(d);if(!m)continue;let l=m.rake>0?Math.tan(m.rake*Math.PI/180):0,f=sn(d,r,p,t);for(let h of f.rows){let y=h.blockDepth*he*l,b=m.height+y;for(let x of h.seatIndices)u[x]=b}}for(let d=0;d<r.length;d++){let p=r[d],m=a[d];if(!m){p.eyeHeightM=n+Ee;continue}let l=s.get(m.id);p.eyeHeightM=(u[d]??l.height)+Ee}}function fl(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let r=t-e.x,o=n-e.y,i=Math.hypot(r,o);return i<1e-9?[0,0]:[r/i,o/i]}}}function pl(e,t){if(!e.length)return null;let n=0,r=0,o=0;for(let l of e)n+=l.x,r+=l.y,o+=Math.hypot(l.x-t.x,l.y-t.y);let i=e.length;n/=i,r/=i,o/=i;let a=e[0],s=-1;for(let l of e){let f=Math.hypot(l.x-n,l.y-r);f>s&&(s=f,a=l)}let c=a.x-n,u=a.y-r,d=Math.hypot(c,u);d>1e-9?(c/=d,u/=d):(c=1,u=0);let p=[...e].sort((l,f)=>(l.x-n)*c+(l.y-r)*u-((f.x-n)*c+(f.y-r)*u)),m=0;for(let l of p){let f=Math.hypot(l.x-n,l.y-r);f>m&&(m=f)}return{pts:p,cx:n,cy:r,radius:m,depth:o}}function Ur(e,t,n){let r=e.pts;if(r.length===1)return Math.hypot(t-r[0].x,n-r[0].y);let o=1/0;for(let i=0;i+1<r.length;i++){let a=r[i],s=r[i+1],c=s.x-a.x,u=s.y-a.y,d=c*c+u*u,p=d>1e-12?((t-a.x)*c+(n-a.y)*u)/d:0;p<0?p=0:p>1&&(p=1);let m=Math.hypot(t-(a.x+p*c),n-(a.y+p*u));m<o&&(o=m)}return o}var un=8;function hl(e,t,n){let r=new Array(un).fill(1/0),o=new Array(un).fill(-1);for(let d=0;d<e.length;d++){let p=e[d],m=Math.hypot(t-p.cx,n-p.cy)-p.radius;for(let l=0;l<un;l++)if(m<r[l]){for(let f=un-1;f>l;f--)r[f]=r[f-1],o[f]=o[f-1];r[l]=m,o[l]=d;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let d of o){if(d<0)continue;let p=Ur(e[d],t,n);for(let m=0;m<3;m++)if(p<i[m]){for(let l=2;l>m;l--)i[l]=i[l-1],a[l]=a[l-1];i[m]=p,a[m]=d;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,u=0;for(let d=0;d<3;d++){let p=a[d];if(p<0||i[d]>s)continue;let m=1/(i[d]*i[d]);c+=m*e[p].depth,u+=m}return u>0?c/u:e[a[0]].depth}function bl(e){let t=(r,o)=>hl(e,r,o),n=(r,o)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(r-c.cx,o-c.cy)-c.radius>=i)continue;let u=Ur(c,r,o);u<i&&(i=u,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(r,o)=>{let i=(t(r+.5,o)-t(r-.5,o))/1,a=(t(r,o+.5)-t(r,o-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function jr(e,t){let n=[];for(let r of e){let o=pl(r.points,t);o&&n.push(o)}return n.length<2?fl(t):(n.sort((r,o)=>r.depth-o.depth),bl(n))}var uo=lt(require("polygon-clipping"),1);var Kr=lt(require("earcut"),1);var yl=.58,Yr=.01,we=De*1.5*Ue,gl=.5,xl=.6;function vl(e,t){let n=e.length,r=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],u=c.x-s.x,d=c.y-s.y,p=Math.hypot(u,d);if(p<1e-9){r.push([0,0]);continue}u/=p,d/=p,r.push([-d,u])}let o=0;for(let a=0;a<n;a++)o+=(e[a].x-t.x)*r[a][0]+(e[a].y-t.y)*r[a][1];return o<0?r.map(([a,s])=>[-a,-s]):r}function Sl(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],r=(a,s)=>{let c=s.x-a.x,u=s.y-a.y,d=Math.hypot(c,u)||1;return{x:c/d,y:u/d}},o=r(n[1],n[0]),i=r(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+o.x*t,y:n[0].y+o.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var Xr=Math.PI/12;function Ml(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),r=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},o=[...r(t),...r([...t].reverse())];return o.length>=3?o:[...e]}function qr(e,t){if(!e.length||!(t>0))return[];let n=Ml(e),r=(s,c,u,d)=>{let p=u-c;for(;p<0;)p+=Math.PI*2;for(;p>Math.PI*2;)p-=Math.PI*2;let m=Math.max(1,Math.ceil(p/Xr)),l=t/Math.cos(p/m/2);for(let f=0;f<=m;f++){let h=c+p*f/m;d.push({x:s.x+Math.cos(h)*l,y:s.y+Math.sin(h)*l})}};if(n.length<3){let s=0,c=0;for(let l of n)s+=l.x,c+=l.y;s/=n.length||1,c/=n.length||1;let u=0;for(let l of n)u=Math.max(u,Math.hypot(l.x-s,l.y-c));let d=[],p=Math.max(3,Math.ceil(Math.PI*2/Xr)),m=(u+t)/Math.cos(Math.PI/p);for(let l=0;l<p;l++){let f=l/p*Math.PI*2;d.push({x:s+Math.cos(f)*m,y:c+Math.sin(f)*m})}return d}let o=n.length,i=[];for(let s=0;s<o;s++){let c=n[s],u=n[(s+1)%o];i.push(Math.atan2(-(u.x-c.x),u.y-c.y))}let a=[];for(let s=0;s<o;s++)r(n[s],i[(s+o-1)%o],i[s],a);return ei(a)}function wl(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],s=a.x-i.x,c=a.y-i.y,u=s*s+c*c,d=u>1e-12?((t-i.x)*s+(n-i.y)*c)/u:0;d<0?d=0:d>1&&(d=1);let p=Math.hypot(t-(i.x+d*s),n-(i.y+d*c));p<r&&(r=p)}return r}function dn(e){let t=e.map(o=>{let i=0,a=0;for(let u of o.pts)i+=u.x,a+=u.y;let s=o.pts.length||1;i/=s,a/=s;let c=0;for(let u of o.pts){let d=Math.hypot(u.x-i,u.y-a);d>c&&(c=d)}return{cx:i,cy:a,rad:c}}),n=o=>{let i=o.length;return i<=2?[...o]:[o[Math.floor(i*.25)],o[Math.floor(i*.5)],o[Math.floor(i*.75)]]},r=[];for(let o=0;o<e.length;o++){let i=n(e[o].pts),a=[],s=1/0,c=null;for(let d of i){let p=1/0;for(let m=0;m<e.length;m++){if(m===o||Math.abs(e[m].y-e[o].y)<.001)continue;let l=t[m],f=Math.hypot(d.x-l.cx,d.y-l.cy)-l.rad;if(f>=p&&f>=s)continue;let h=wl(e[m].pts,d.x,d.y);h<p&&(p=h),e[m].depth<e[o].depth&&h<s&&(s=h,c=e[m].y)}Number.isFinite(p)&&p>0&&a.push(p)}a.sort((d,p)=>d-p);let u=a.length?a[Math.floor(a.length/2)]:1;r.push({pitch:u,belowY:c})}return r}function Qr(e,t,n,r){let o=e[t],i=o.pts.length>=2?[...o.pts]:o.pts.length===1?(()=>{let d=o.pts[0],p=d.x-r.x,m=d.y-r.y,l=Math.hypot(p,m)||1;p/=l,m/=l;let f=Math.max(n[t].pitch,.001)*.5;return[{x:d.x+m*f,y:d.y-p*f},{x:d.x-m*f,y:d.y+p*f}]})():[];if(i.length<2)return null;let a=0,s=0;for(let d=1;d<i.length;d++){let p=Math.hypot(i[d].x-i[d-1].x,i[d].y-i[d-1].y);p>1e-6&&(a+=p,s++)}let c=s>0?a/s:0,u=Sl(i,Math.max(c*xl,we));return{pts:u,nrm:vl(u,r),front:Math.max(n[t].pitch*yl,we),back:Math.max(n[t].pitch*gl,we)}}var bt=1.5,Zr=.3;function co(e,t){if(e.length<3)return e;let n=e[0],r=e[e.length-1],o=r.x-n.x,i=r.y-n.y,a=Math.hypot(o,i),s=-1,c=-1;for(let p=1;p<e.length-1;p++){let m=e[p],l=a>1e-12?Math.abs((m.x-n.x)*i-(m.y-n.y)*o)/a:Math.hypot(m.x-n.x,m.y-n.y);l>s&&(s=l,c=p)}if(s<=t||c<0)return[n,r];let u=co(e.slice(0,c+1),t),d=co(e.slice(c),t);return[...u.slice(0,-1),...d]}function $r(e,t){if(e.length<4)return e;let n=co([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function Jr(e,t,n){if(e.length<2)return[];let r=n??dn(e),o=new Map;for(let a=0;a<e.length;a++){let s=o.get(e[a].blockId);s?s.push(a):o.set(e[a].blockId,[a])}let i=[];for(let[,a]of o){let s=[];for(let x of a){let g=e[x].patch;g&&g.length>=3?i.push({outline:[...g],holes:[],topY:e[x].y}):s.push(x)}if(!s.length)continue;s.sort((x,g)=>e[x].depth-e[g].depth);let u=s.map(x=>Qr(e,x,r,t)).filter(x=>x!==null);if(!u.length)continue;let d=(x,g)=>({x:x.pts[g].x-x.nrm[g][0]*(x.front+bt),y:x.pts[g].y-x.nrm[g][1]*(x.front+bt)}),p=(x,g)=>({x:x.pts[g].x+x.nrm[g][0]*(x.back+bt),y:x.pts[g].y+x.nrm[g][1]*(x.back+bt)}),m=u[0],l=u[u.length-1],f=[];for(let x=0;x<m.pts.length;x++)f.push(d(m,x));for(let x of u)f.push(p(x,x.pts.length-1));for(let x=l.pts.length-1;x>=0;x--)f.push(p(l,x));for(let x=u.length-1;x>=0;x--)f.push(d(u[x],0));let h=ei(f),y=1/0;for(let x of s)e[x].y<y&&(y=e[x].y);if(!Number.isFinite(y))continue;if(h.length>=3&&Math.abs(et(h))>1e-6&&u.every(x=>{let g=x.pts[Math.floor(x.pts.length/2)];return Tt(h,g.x,g.y)})){i.push({outline:$r(h,Zr),holes:[],topY:y});continue}for(let x of Pl(u))i.push({outline:x,holes:[],topY:y})}return i}function Pl(e){let t=[];for(let n of e){let r=[],o=[],i=n.front+bt,a=n.back+bt;for(let c=0;c<n.pts.length;c++){let u=n.pts[c],d=n.nrm[c];r.push([u.x-d[0]*i,u.y-d[1]*i]),o.push([u.x+d[0]*a,u.y+d[1]*a])}let s=[...r,...o.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=uo.default.union(t[0],...t.slice(1)),r=[];for(let o of n){if(!o.length||o[0].length<4)continue;let i=o[0].map(([c,u])=>({x:c,y:u})),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&&r.push($r(i,Zr))}return r}catch{return[]}}function ei(e){let t=[];for(let n of e){let r=t[t.length-1];r&&Math.hypot(n.x-r.x,n.y-r.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 lo=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 r of n)r.x<this.minX&&(this.minX=r.x),r.y<this.minY&&(this.minY=r.y),r.x>this.maxX&&(this.maxX=r.x),r.y>this.maxY&&(this.maxY=r.y)}containsAll(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 r=!0;for(let o of t)if(!Tt(n,o.x,o.y)){r=!1;break}if(r)return!0}return!1}};function Wr(e,t,n,r,o,i){if(r.length<3)return;if(n.containsAll(r)){let u=[0,1,0],d=r[0];for(let p=1;p+1<r.length;p++){let m=r[p],l=r[p+1];e.tri([d.x*G,o,d.y*G],[m.x*G,o,m.y*G],[l.x*G,o,l.y*G],u,i)}return}let a=r.map(u=>[u.x,u.y]);a.push(a[0]);let s;try{s=uo.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let u of s){if(!u.length||u[0].length<4)continue;let d=u[0],p=[],m=[];for(let f=0;f<d.length-1;f++)p.push(d[f][0],d[f][1]),m.push([d[f][0],d[f][1]]);if(m.length<3)continue;let l=(0,Kr.default)(p,void 0,2);for(let f=0;f<l.length;f+=3){let h=m[l[f]],y=m[l[f+1]],b=m[l[f+2]];e.tri([h[0]*G,o,h[1]*G],[y[0]*G,o,y[1]*G],[b[0]*G,o,b[1]*G],c,i)}}}function ti(e,t,n,r,o,i,a){if(t.length<2)return;let s=a??dn(t),c=[0,1,0],u=i&&i.length>=3?[[...i.map(l=>[l.x,l.y]),[i[0].x,i[0].y]]]:null,d=i&&i.length>=3?new lo([[...i]]):null,p=l=>{e.setMaterial(2),l(),e.setMaterial(0)},m=l=>{e.setMaterial(3),l(),e.setMaterial(0)};for(let l=0;l<t.length;l++){let f=t[l];if(f.patch&&f.patch.length>=3){let P=[...f.patch],S=s[l].belowY??r;if(m(()=>{if(u&&d)Wr(e,u,d,P,f.y,o.tread);else{let C=P[0];for(let T=1;T+1<P.length;T++){let B=P[T],z=P[T+1];e.tri([C.x*G,f.y,C.y*G],[B.x*G,f.y,B.y*G],[z.x*G,f.y,z.y*G],c,o.tread)}}}),f.y>S+Yr){let C=0,T=0;for(let B of P)C+=B.x,T+=B.y;C/=P.length,T/=P.length,p(()=>{for(let B=0;B<P.length;B++){let z=P[B],D=P[(B+1)%P.length],k=D.x-z.x,A=D.y-z.y,_=Math.hypot(k,A);if(_<1e-6)continue;let V=A/_,M=-k/_;(z.x-C)*V+(z.y-T)*M<0&&(V=-V,M=-M);let R=[V,0,M],E=[z.x*G,f.y,z.y*G],w=[D.x*G,f.y,D.y*G],L=[z.x*G,S,z.y*G],I=[D.x*G,S,D.y*G];e.tri(E,w,I,R,o.riser),e.tri(E,I,L,R,o.riser)}})}continue}let h=Qr(t,l,s,n);if(!h)continue;let{pts:y,nrm:b,front:x,back:g}=h,v=s[l].belowY??r;for(let P=0;P+1<y.length;P++){let S=y[P],C=y[P+1],T=b[P],B=b[P+1];if(Math.hypot(C.x-S.x,C.y-S.y)<1e-6||T[0]===0&&T[1]===0||B[0]===0&&B[1]===0)continue;let z=[(S.x-T[0]*x)*G,f.y,(S.y-T[1]*x)*G],D=[(C.x-B[0]*x)*G,f.y,(C.y-B[1]*x)*G],k=[(S.x+T[0]*g)*G,f.y,(S.y+T[1]*g)*G],A=[(C.x+B[0]*g)*G,f.y,(C.y+B[1]*g)*G];if(m(()=>{u&&d?Wr(e,u,d,[{x:S.x-T[0]*x,y:S.y-T[1]*x},{x:C.x-B[0]*x,y:C.y-B[1]*x},{x:C.x+B[0]*g,y:C.y+B[1]*g},{x:S.x+T[0]*g,y:S.y+T[1]*g}],f.y,o.tread):(e.tri(z,D,A,c,o.tread),e.tri(z,A,k,c,o.tread))}),f.y>v+Yr){let _=[z[0],v,z[2]],V=[D[0],v,D[2]],M=[-T[0],0,-T[1]];p(()=>{e.tri(z,D,V,M,o.riser),e.tri(z,V,_,M,o.riser)})}}}}function ni(e){let t=1/0,n=1/0,r=-1/0,o=-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>r&&(r=a.x),a.y>o&&(o=a.y));return i?{minX:t,minY:n,maxX:r,maxY:o}:null}function mn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var mo=lt(require("polygon-clipping"),1);function Cl(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function oi(e,t){return e.filter(n=>n.type!=="shape"||Cl(n,t))}function ri(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((r,o)=>({objects:oi(r.objects,t),focal:{x:(r.focalPoint??n).x,y:(r.focalPoint??n).y},baseHeightM:r.baseHeightM??0,index:o})):[{objects:oi(e.objects,t),focal:n,baseHeightM:0,index:0}]}var Al={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function yt(e){return ni(e)??Al}function ii(e,t){let n=on(e.outline,we),r=yt(n),o=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&mn(r,yt(a.outline)));if(!o.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=mo.default.difference([i(n)],...o.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let u=c[0].map(([d,p])=>({x:d,y:p}));if(u.length>1){let d=u[0],p=u[u.length-1];Math.abs(d.x-p.x)<1e-9&&Math.abs(d.y-p.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s.length?s:[n]}catch{return[n]}}function ai(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},r=t.map(i=>[n(i)]),o=[];for(let i of e){let a;try{a=mo.default.intersection([n(i.outline)],r.flat())}catch{o.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([u,d])=>({x:u,y:d}));if(c.length>1){let u=c[0],d=c[c.length-1];Math.abs(u.x-d.x)<1e-9&&Math.abs(u.y-d.y)<1e-9&&c.pop()}c.length>=3&&o.push({outline:c,holes:[],topY:i.topY})}}return o.length?o:e}var Rl=.05,si=.05,Il=.15,fo=25;function ci(e,t,n){let r=new Map,o=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,u=[],d=new Set;for(let m=0;m<e.length;m+=1){let l=e[m];for(let f of l.objects){if(f.type==="table"&&d.add(f.id),f.type!=="section"||!f.outline||f.outline.length<3)continue;let h=on(f.outline,we);c.set(f.id,{section:f,unit:l,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),u.push({id:f.id,floorIndex:m,box:yt(h),section:f,unit:l,outline:h})}}let p=new Map;for(let m of u){let l=p.get(m.floorIndex);l?l.push(m):p.set(m.floorIndex,[m])}for(let m=0;m<t.length;m++){let l=t[m],f=n?p.get(n[m])??[]:u,h=l.sectionId?f.find(b=>b.id===l.sectionId)??f.find(b=>b.section.logicalSectionId===l.sectionId&&ot({x:l.x,y:l.y},b.outline,b.section.holes)):void 0,y=h?[h]:f;for(let b of y){if(n&&b.floorIndex!==n[m]||!h&&(l.x<b.box.minX||l.x>b.box.maxX||l.y<b.box.minY||l.y>b.box.maxY||!ot({x:l.x,y:l.y},b.outline,b.section.holes)))continue;o[m]=b.id;let x=c.get(b.id);x.hasSeats=!0;let g=l.focalPoint??b.unit.focal,v=Math.hypot(l.x-g.x,l.y-g.y);v<x.frontU&&(x.frontU=v),x.seatIndices.push(m);let P=l.rowId||`__seat-${m}`,S=x.rows.get(P);S?S.push({x:l.x,y:l.y}):x.rows.set(P,[{x:l.x,y:l.y}]);break}}for(let[m,l]of c){let f=Jt(l.section,{floorBaseHeightM:l.unit.baseHeightM}),h=l.unit.baseHeightM,y=f.rake>0?Math.tan(f.rake*Math.PI/180):0,b=f.rake<=.01&&f.height<=h+.001,x=l.section.surfaceKind,g=x==="flat"?!0:x==="rakedRows"&&f.rake>.01?!1:b,v=l.hasSeats?sn(m,t,l.seatIndices,l.unit.focal):{sectionId:m,rows:[],blockCount:0},S=v.rows.length<2?jr([...l.rows.values()].map(E=>({points:E})),l.unit.focal):null,C=1/0;if(S){if(l.hasSeats)for(let E of l.rows.values())for(let w of E){let L=S.depthAt(w.x,w.y);L<C&&(C=L)}if(!l.hasSeats||!Number.isFinite(C)){C=1/0;for(let E of l.section.outline){let w=S.depthAt(E.x,E.y);w<C&&(C=w)}}}let T=h+Rl,B=Math.max(T,f.height),z=E=>{let w=Math.max(0,E-C)*he,L=Math.min(w*y,fo);return Math.max(T,f.height+L)},D=E=>{let w=Math.max(0,E)*he,L=Math.min(w*y,fo);return Math.max(T,f.height+L)},k=g?[]:v.rows.map(E=>({pts:E.pts,y:D(E.blockDepth),depth:E.blockDepth,blockId:E.blockId,...d.has(E.id)?{patch:qr(E.pts,we)}:{}})),A=k.length?k[0].y:B,_=k.map(E=>{let w=E.patch&&E.patch.length>=3?E.patch:E.pts,L=0,I=0;for(let U of w)L+=U.x,I+=U.y;let O=w.length||1;L/=O,I/=O;let j=0;for(let U of w){let N=Math.hypot(U.x-L,U.y-I);N>j&&(j=N)}return{cx:L,cy:I,rad:j}}),V=g?()=>B:k.length>=2?(E,w)=>{let L=1/0,I=A;for(let O=0;O<k.length;O++){let j=_[O];if(Math.hypot(E-j.cx,w-j.cy)-j.rad>=L)continue;let U=k[O].patch,N=U&&U.length>=3?Tt(U,E,w)?0:pt(U,E,w):pt(k[O].pts,E,w);N<L&&(L=N,I=k[O].y)}return I}:(E,w)=>S?z(S.depthAt(E,w)):B,M=[0,1,0],R=k.length>=2||g?()=>M:(E,w)=>{if(!S)return M;let L=S.depthAt(E,w);if(L<=C)return M;let I=(L-C)*he;if(I*y>=fo||f.height+I*y<=T)return M;let[O,j]=S.gradientAt(E,w);if(O===0&&j===0)return M;let U=1/Math.hypot(y,1);return[-O*y*U,U,-j*y*U]};if(!g)for(let E of v.rows){let w=D(E.blockDepth);for(let L of E.seatIndices)a[L]=w}for(let E of v.rows){let w=[];for(let U=1;U<E.pts.length;U++){let N=Math.hypot(E.pts[U].x-E.pts[U-1].x,E.pts[U].y-E.pts[U-1].y);N>1e-6&&w.push(N)}w.sort((U,N)=>U-N);let L=w.length?w[Math.floor(w.length/2)]:1/0,I=1/0,O=E.pts[Math.floor(E.pts.length/2)];if(O)for(let U of v.rows){if(U===E||U.blockId!==E.blockId)continue;let N=pt(U.pts,O.x,O.y);N>1e-6&&N<I&&(I=N)}let j=Math.min(L,Math.max(I,L*.5));if(Number.isFinite(j)&&j>0)for(let U of E.seatIndices)s[U]=j}r.set(m,{sectionId:m,deckAt:V,normalAt:R,flat:g,bottomY:h,rowLevels:k,landingY:A})}for(let m=0;m<t.length;m++){let l=o[m],f=t[m];if(l){let y=a[m];i[m]=(y??r.get(l).deckAt(f.x,f.y))+Il;continue}let h=f.eyeHeightM;i[m]=Number.isFinite(h)?Math.max(0,h-Ee):0}return{bySection:r,seatOwner:o,seatDeckY:m=>i[m],seatPitchU:m=>s[m]}}var le={top:1,wallBottom:.5,bottomCap:.4};function Oe(e,t){if(!e)return t;let n=Me(At(e,.4),.62);return ge(t,n,.72)}function li(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let r=new Map;for(let i of t){if(!i.sectionId)continue;let a=r.get(i.sectionId);a||(a=new Map,r.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let o=new Map;for(let[i,a]of r){let s=0,c=0,u=0,d=0;for(let[p,m]of a){let l=ne(n.get(p));l&&(s+=l[0]*m,c+=l[1]*m,u+=l[2]*m,d+=m)}d>0&&o.set(i,[s/d,c/d,u/d])}return o}function ui(e,t){return ne(e.color)??t.get(e.logicalSectionId??e.id)??null}var di=lt(require("polygon-clipping"),1);function El(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var fn=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let r=t.map(c=>[c.x,c.y]);if(r.length<3)return[];r.push(r[0]);let o=yt(t),i=this.rings.filter((c,u)=>mn(o,this.boxes[u])&&El(n,this.levels[u])),a=[[r]];if(i.length)try{a=di.default.difference([r],...i).map(u=>u.map(d=>d.map(([p,m])=>[p,m])))}catch{a=[[r]]}this.rings.push([r]),this.boxes.push(o),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let u=c[0].map(([d,p])=>({x:d,y:p}));if(u.length>1){let d=u[0],p=u[u.length-1];Math.abs(d.x-p.x)<1e-9&&Math.abs(d.y-p.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s}};function Tl(e,t){if(!t)return e;let n=1/0,r=-1/0,o=1/0,i=-1/0;for(let p of e)n=Math.min(n,p.x),r=Math.max(r,p.x),o=Math.min(o,p.y),i=Math.max(i,p.y);let a=(n+r)/2,s=(o+i)/2,c=t*Math.PI/180,u=Math.cos(c),d=Math.sin(c);return e.map(p=>{let m=p.x-a,l=p.y-s;return{x:a+m*u-l*d,y:s+m*d+l*u}})}function rt(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3&&(t=e.points),e.kind==="rect"&&e.width&&e.height&&(t=Lt(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,r=(e.y??0)+e.height/2;t=rn(n,r,e.width/2,e.height/2)}return t?Tl(t,e.rotation):null}function Ot(e){let t=e.role??"",n={stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}},r=t==="stage"&&cn(e.stageKind)?{kind:"stage",heightM:.06}:n[t]??{kind:"plate",heightM:.25};return{...r,heightM:e.heightM??r.heightM}}var _l=.08;function mi(e,t){let n=rt(e),r=Ot(e),o=r.heightM;if(!n||r.kind!=="plate"&&r.kind!=="stage")return o;let i=1/0,a=1/0,s=-1/0,c=-1/0;for(let d of n)i=Math.min(i,d.x),a=Math.min(a,d.y),s=Math.max(s,d.x),c=Math.max(c,d.y);let u=o;for(let d of t)s>d.minX&&i<d.maxX&&c>d.minY&&a<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+_l);return t.push({minX:i,minY:a,maxX:s,maxY:c,topOffsetM:u}),u}function je(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function fi(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 Vt(e,t,n){return[je(e[0],e[1],t),je(e[0],e[1],n),je(e[3],e[2],n),je(e[3],e[2],t)]}function pi(e,t,n){return[je(e[0],e[3],t),je(e[1],e[2],t),je(e[1],e[2],n),je(e[0],e[3],n)]}function Ve(e,t,n,r,o,i){ue(e,t,void 0,()=>n,r,o,i,le)}var po=2.4,kl=.75,Ll=.15;function Bt(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:r,rotation:o}=e;if(!n||!r)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,u=r/2;return[[-c,-u],[c,-u],[c,u],[-c,u]].map(([d,p])=>({x:t.x+d*a-p*s,y:t.y+d*s+p*a}))}function hi(e,t,n,r,o){let i=Bt(t);i&&ue(e,i,void 0,()=>n+po,n,Oe(r,o.boothTop),o.boothWall,le)}function ho(e){if(e.shape==="round"){let d=e.radius;return d?rn(e.center.x,e.center.y,d,d,24):null}let{width:t,height:n,rotation:r,center:o}=e;if(!t||!n)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,u=n/2;return[[-c,-u],[c,-u],[c,u],[-c,u]].map(([d,p])=>({x:o.x+d*a-p*s,y:o.y+d*s+p*a}))}function bi(e,t,n,r,o){let i=ho(t);i&&ue(e,i,void 0,()=>n+kl,n,Oe(r,o.tableTop),o.tableWall,le)}function yi(e,t,n,r,o,i,a,s){let c=rt(t);if(!c)return;let u=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",p=s?{kind:u?"stage":"solid",heightM:s.topY-s.baseY}:Ot(t),m=s?.baseY??n,l=s?.topY??n+r;if(u&&a){let x=1/0,g=-1/0,v=1/0,P=-1/0;for(let S of c)S.x<x&&(x=S.x),S.x>g&&(g=S.x),S.y<v&&(v=S.y),S.y>P&&(P=S.y);a.push({cx:(x+g)/2*G,cz:(v+P)/2*G,y:l,halfX:Math.max((g-x)/2*G,.5),halfZ:Math.max((P-v)/2*G,.5)})}let f=ne(t.fill),h=u&&f?ge(o.stageTop,Me(At(f,.18),.9),.9):Oe(f,u?o.stageTop:o.decorTop),y=d?f:null,b=u?f?ge(o.stageWall,Me(f,.58),.82):o.stageWall:d?y?ge(Me(y,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Oe(ne(t.fill),o.decorWall);if(p.kind==="portal"&&c.length===4){let x=fi(c);Ve(e,Vt(x,0,.16),l,m,h,b),Ve(e,Vt(x,.84,1),l,m,h,b),Ve(e,x,l,Math.max(m,l-.35),h,b);return}if(p.kind==="suite"&&c.length===4){let x=c.map((P,S)=>{let C=c[(S+1)%4],T=(P.x+C.x)/2,B=(P.y+C.y)/2;return Math.hypot(T-i.x,B-i.y)}),g=x.indexOf(Math.min(...x)),v=[0,1,2,3].map(P=>c[(g+P)%4]);Ve(e,Vt(v,0,.08),l,m,h,b),Ve(e,Vt(v,.92,1),l,m,h,b),Ve(e,pi(v,.88,1),l,m,h,b),Ve(e,v,l,Math.max(m,l-.18),h,b);return}Ve(e,c,l,m,h,b)}function bo(e){let{x:t,y:n,width:r,height:o}=e;if(!r||!o)return null;let i=t+r/2,a=n+o/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),u=Math.sin(s),d=r/2,p=o/2;return[[-d,-p],[d,-p],[d,p],[-d,p]].map(([m,l])=>({x:i+m*c-l*u,y:a+m*u+l*c}))}function Fl(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 r=n[1].trim();if(r==="none"||r==="transparent")return null;let o=r.match(/^url\(#([^)]+)\)$/);if(!o)return ne(r);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${o[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=ne(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,u)=>ge(s,c,1/(u+1)),a[0]):null}function gi(e,t,n,r){if(t.layer==="foreground")return;let o=bo(t);if(!o)return;let i=n+Ll,a=Oe(Fl(t.href),r.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(r.ground,a,s)),ue(e,o,void 0,()=>i,n,a,ge(a,r.decorWall,.5),le)}function xi(e,t,n,r,o){if(!t.points||t.points.length<3)return;let i=Oe(r,o.gaTop);ue(e,t.points,t.holes,()=>n+.15,n,i,o.gaWall,le)}var Dl=Math.PI/180,oe=96,Ol=6,Vl=60,Bl=150,vi=.2,Nl=.35;function Gl(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Dl;return n<0?n+360:n}function pn(e){if(!e.length)return NaN;let t=[...e].sort((n,r)=>n-r);return t[Math.floor(t.length/2)]}function hn(e,t,n=2){let r=e.length,o=new Float64Array(r);for(let i=0;i<r;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let u=i+c;if(t)u=(u%r+r)%r;else if(u<0||u>=r)continue;a+=e[u],s++}o[i]=a/s}return o}function Si(e,t){let n=e.filter(m=>m.rows.length>=1);if(n.length<1)return null;let r=[],o=0,i=0,a=0;for(let m of n)for(let l of m.rows){for(let f of l.pts)o+=f.x,i+=f.y,a++;if(l.pts.length>=4){let f=oo(l.pts);f&&Number.isFinite(f.cx)&&Number.isFinite(f.cy)&&r.push({x:f.cx,y:f.cy})}}if(!a)return null;let s={x:o/a,y:i/a},c=s;if(r.length>=8){let m=pn(r.map(b=>b.x)),l=pn(r.map(b=>b.y)),f=0;for(let b of n)for(let x of b.rows)for(let g of x.pts){let v=Math.hypot(g.x-s.x,g.y-s.y);v>f&&(f=v)}let h=0,y=f*.2;for(let b of n)for(let x of b.rows)for(let g of x.pts)Math.hypot(g.x-m,g.y-l)<y&&h++;Math.hypot(m-s.x,l-s.y)<=f&&h/a<.01&&(c={x:m,y:l})}let u=[];for(let m of n){let l={sectionId:m.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let f of m.rows)for(let h of f.pts){let y=Math.hypot(h.x-c.x,h.y-c.y),b=Math.min(oe-1,Math.floor(Gl(c,h)/(360/oe)));l.samples.push({r:y,bin:b,levelM:f.levelM}),y<l.rMin&&(l.rMin=y),y>l.rMax&&(l.rMax=y)}l.samples.length&&u.push(l)}if(!u.length)return null;u.sort((m,l)=>m.rMin+m.rMax-(l.rMin+l.rMax));let d=[];for(let m of u){let l=!1;for(let f of d){let h=Math.min(m.rMax,f.rMax)-Math.max(m.rMin,f.rMin),y=Math.min(m.rMax-m.rMin,f.rMax-f.rMin);if(y>1e-9&&h>=Nl*y){f.members.push(m),f.rMin=Math.min(f.rMin,m.rMin),f.rMax=Math.max(f.rMax,m.rMax),l=!0;break}}l||d.push({members:[m],rMin:m.rMin,rMax:m.rMax})}let p=[];for(let m of d){let l=new Array(oe).fill(null);for(let A of m.members)for(let _ of A.samples){let V=l[_.bin];V||(V={samples:[]},l[_.bin]=V),V.samples.push({r:_.r,levelM:_.levelM})}let f=l.map(A=>!!A);if(!f.filter(Boolean).length)continue;let y=[],b=[];for(let A of l){if(!A)continue;let _=1/0,V=-1/0;for(let M of A.samples)M.r<_&&(_=M.r),M.r>V&&(V=M.r);y.push(_),b.push(V)}let x=pn(y),g=pn(b);if(!(x>=vi*g)||!(g>0))continue;let v=[...y].sort((A,_)=>A-_);if(!(v[Math.floor(v.length*.1)]>=vi*g))continue;let S=l.map(A=>{if(!A)return null;let _=[...A.samples].sort((O,j)=>O.r-j.r),V=_[0].r,M=_[_.length-1].r,R=_[0].levelM,E=-1/0;for(let O of _)O.levelM>E&&(E=O.levelM);let w=[];for(let O of _){let j={r:O.r,l:O.levelM};for(;w.length&&Math.abs(w[w.length-1].r-j.r)<1e-9;){if(w[w.length-1].l<=j.l){j.skip=!0;break}w.pop()}if(!j.skip){for(;w.length>=2;){let U=w[w.length-2],N=w[w.length-1];if((N.r-U.r)*(j.l-U.l)-(N.l-U.l)*(j.r-U.r)<=0)w.pop();else break}w.push(j)}}let L=w.map(O=>O.r),I=w.map(O=>O.l);return{inner:V,outer:M,front:R,top:E,profile:{rs:L,ls:I}}}),C=f.slice();for(let A=0;A<oe;A++){if(C[A])continue;let _=-1,V=-1,M=0;for(let F=1;F<=oe;F++){let K=(A-F+oe*2)%oe;if(C[K]){_=K;break}}for(let F=1;F<=oe;F++){let K=(A+F)%oe;if(C[K]){V=K,M=F;break}}if(_<0||V<0)continue;let R=0;for(let F=1;F<=oe;F++){let K=(A-F+oe*2)%oe;if(f[K]){R=F;break}}if(R-1+M>Ol)continue;let w=S[_],L=S[V],I=R/(R+M),O=w.inner+(L.inner-w.inner)*I,j=w.outer+(L.outer-w.outer)*I,U=w.front+(L.front-w.front)*I,N=w.top+(L.top-w.top)*I;S[A]={inner:O,outer:j,front:U,top:N,profile:{rs:[O,j],ls:[U,N]}}}for(let A=0;A<oe;A++)S[A]&&(C[A]=!0);let T=360/oe,B=[],z=C.filter(Boolean).length,D=[];if(z===oe)D.push({start:0,len:oe});else{let A=0;for(;C[A];)A=(A+1)%oe;let _=-1;for(let V=0;V<=oe;V++){let M=(A+V)%oe,R=V<oe&&C[M];if(R&&_<0)_=M;else if(!R&&_>=0){let E=(M-_+oe)%oe||oe;D.push({start:_,len:E}),_=-1}}}for(let A of D){if(A.len*T<Vl&&A.len<oe)continue;let _=A.len===oe,V=new Float64Array(A.len),M=new Float64Array(A.len),R=new Float64Array(A.len),E=new Float64Array(A.len),w=[];for(let F=0;F<A.len;F++){let K=S[(A.start+F)%oe];V[F]=K.inner,M[F]=K.outer,R[F]=K.front,E[F]=K.top,w.push(K.profile??{rs:[K.inner,K.outer],ls:[K.front,K.top]})}let L=hn(V,_),I=hn(M,_),O=hn(R,_),j=hn(E,_);for(let F=0;F<A.len;F++)L[F]>V[F]&&(L[F]=V[F]),I[F]<M[F]&&(I[F]=M[F]),L[F]>I[F]-1e-6&&(L[F]=Math.max(0,I[F]-1e-6)),j[F]<O[F]&&(j[F]=O[F]);let U={startBin:A.start,binCount:A.len,closed:_,innerR:L,outerR:I,frontLevelM:O,topLevelM:j,profiles:w},N=(F,K,X)=>{let Q=w[F],W=Q.rs,Z=Q.ls;if(K<=W[0]){Z[0]>X&&(Z[0]=X);return}if(K>=W[W.length-1]){Z[Z.length-1]>X&&(Z[Z.length-1]=X);return}for(let $=0;$+1<W.length;$++)if(K<=W[$+1]){Z[$]>X&&(Z[$]=X),Z[$+1]>X&&(Z[$+1]=X);return}};for(let F=0;F<A.len;F++){let K=l[(A.start+F)%oe];if(K)for(let X of K.samples){N(F,X.r,X.levelM);let Q=_?(F-1+A.len)%A.len:F-1,W=_?(F+1)%A.len:F+1;Q>=0&&N(Q,X.r,X.levelM),W<A.len&&N(W,X.r,X.levelM)}}B.push(U)}B.reduce((A,_)=>A+_.binCount*T,0)<Bl||p.push({arcs:B,sectionIds:m.members.map(A=>A.sectionId),innerRMedian:x,outerRMedian:g})}if(!p.length)return null;if(p.sort((m,l)=>m.innerRMedian-l.innerRMedian),t){let m=p[p.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*m)return null}return{centre:c,binCount:oe,binStepDeg:360/oe,rings:p}}function Mi(e,t,n,r){let o=e.binStepDeg,i=n/o-.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,u=d=>{let p=t.profiles[d],m=p.rs,l=p.ls;if(r<=m[0])return l[0];if(r>=m[m.length-1])return l[l.length-1];for(let f=0;f+1<m.length;f++)if(r<=m[f+1]){let h=m[f+1]-m[f],y=h>1e-9?(r-m[f])/h:0;return l[f]+(l[f+1]-l[f])*y}return l[l.length-1]};return u(a)*(1-c)+u(s)*c}var zl=.25,Hl=1.2,Ul=.6,jl=.45,Yl=2.3,Xl=Math.PI/180;function it(e,t,n){let r=n*Xl;return{x:e.x+t*Math.sin(r),y:e.y+t*Math.cos(r)}}function Wl(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let r=n.outerRMedian*.85;for(let o of e){if(o.role!=="wall")continue;let i=o.points&&o.points.length>=2?o.points:o.x!==void 0&&o.y!==void 0&&o.width!==void 0&&o.height!==void 0?[{x:o.x,y:o.y},{x:o.x+o.width,y:o.y},{x:o.x+o.width,y:o.y+o.height},{x:o.x,y:o.y+o.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=r&&a++;if(a>=i.length/2)return!0}return!1}var Kl=24;function ql(e,t,n,r,o,i,a,s){let c=n.binCount,u=Kl,d=he,p=i+.02,m=[];for(let k=0;k<c;k++){let A=(n.startBin+k+.5)*t.binStepDeg,_=new Float64Array(u+1);for(let V=0;V<=u;V++){let M=r[k]+(o[k]-r[k])*V/u;_[V]=Math.max(p,Mi(t,n,A,M)-zl)}m.push(_)}let l=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],f=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],h=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],y=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],b=(k,A)=>{let _=(n.startBin+k+.5)*t.binStepDeg,V=r[k]+(o[k]-r[k])*A/u,M=it(t.centre,V,_);return[M.x*d,m[k][A],M.y*d]};{let k=Math.tan(12*Math.PI/180);for(let A=0;A<6;A++){let _=!1;for(let M=0;M<c;M++)for(let R=u-1;R>=0;R--)m[M][R]>m[M][R+1]&&(m[M][R]=m[M][R+1],_=!0);let V=n.closed?c:c-1;for(let M=0;M<V;M++){let R=(M+1)%c;for(let E=0;E<=u;E++){let w=m[R][E]-m[M][E];if(Math.abs(w)>1)continue;let L=r[M]+(o[M]-r[M])*E/u,I=r[R]+(o[R]-r[R])*E/u,O=it(t.centre,L,(n.startBin+M+.5)*t.binStepDeg),j=it(t.centre,I,(n.startBin+R+.5)*t.binStepDeg),U=k*Math.hypot(j.x-O.x,j.y-O.y)*d;w>U?(m[R][E]=m[M][E]+U,_=!0):-w>U&&(m[M][E]=m[R][E]+U,_=!0)}}if(!_)break}}let x=1,g=(k,A)=>{for(let _=0;_<=u;_+=4)if(Math.abs(m[k][_]-m[A][_])>x)return!0;return Math.abs(m[k][u]-m[A][u])>x},v=Math.tan(38*Math.PI/180),P=k=>(o[k]-r[k])/u*d,S=(k,A)=>m[k][A+1]-m[k][A]>v*Math.max(1e-6,P(k)),C=(k,A)=>{let _=n.closed?(k-1+c)%c:Math.max(0,k-1),V=n.closed?(k+1)%c:Math.min(c-1,k+1);Math.abs(m[_][A]-m[k][A])>x&&(_=k),Math.abs(m[V][A]-m[k][A])>x&&(V=k);let M=Math.max(0,A-1),R=Math.min(u,A+1);M<A&&S(k,M)&&(M=A),R>A&&S(k,A)&&(R=A);let E=b(_,A),w=b(V,A),L=b(k,M),I=b(k,R),O=w[0]-E[0],j=w[1]-E[1],U=w[2]-E[2],N=I[0]-L[0],F=I[1]-L[1],K=I[2]-L[2],X=j*K-U*F,Q=U*N-O*K,W=O*F-j*N,Z=Math.hypot(X,Q,W);return Z>1e-12?(X/=Z,Q/=Z,W/=Z,Q<0&&(X=-X,Q=-Q,W=-W),[X,Q,W]):[0,1,0]},T=(k,A)=>{let _=[k[0],i,k[2]],V=[A[0],i,A[2]],M=A[0]-k[0],R=A[2]-k[2],E=Math.hypot(M,R);if(!(E>1e-12))return;let w=[R/E,0,-M/E];e.tri(k,A,V,w,h,h,y),e.tri(k,V,_,w,h,y,y)},B=.05*Ue,z=k=>o[k]-r[k]<B,D=n.closed?c:c-1;for(let k=0;k<D;k++){let A=(k+1)%c;if(z(k)||z(A))continue;if(g(k,A)){let w=(n.startBin+k+1)*t.binStepDeg,L=(F,K)=>{let X=(r[k]+r[A])/2,Q=(o[k]+o[A])/2,W=X+(Q-X)*K/u,Z=it(t.centre,W,w);return[Z.x*d,m[F][K],Z.y*d]};for(let F=0;F<u;F++){let K=b(k,F),X=b(k,F+1),Q=L(k,F),W=L(k,F+1),Z=C(k,F),$=C(k,F+1);e.triN(K,Q,W,Z,Z,$,l),e.triN(K,W,X,Z,$,$,l);let te=b(A,F),Le=b(A,F+1),Pe=L(A,F),Be=L(A,F+1),Ne=C(A,F),Ae=C(A,F+1);e.triN(Pe,te,Le,Ne,Ne,Ae,l),e.triN(Pe,Le,Be,Ne,Ae,Ae,l);let Ce=L(k,F),me=L(k,F+1),qe=L(A,F+1),vt=L(A,F),Ge=me[0]-Ce[0],Fe=me[2]-Ce[2],Qe=Math.hypot(Ge,Fe);if(Qe>1e-12){let Ut=[Fe/Qe,0,-Ge/Qe];e.tri(Ce,me,qe,Ut,h),e.tri(Ce,qe,vt,Ut,h)}}let I=b(k,0),O=b(A,0),j=b(A,u),U=b(k,u),N=F=>[F[0],i,F[2]];e.tri(N(I),N(j),N(O),[0,-1,0],f),e.tri(N(I),N(U),N(j),[0,-1,0],f),T(I,O),T(U,j);continue}for(let w=0;w<u;w++){let L=C(k,w),I=C(A,w),O=C(A,w+1),j=C(k,w+1);if(S(k,w)||S(A,w)){let X=(me,qe)=>{let vt=(n.startBin+me+.5)*t.binStepDeg,Ge=r[me]+(o[me]-r[me])*(w+.5)/u,Fe=it(t.centre,Ge,vt);return[Fe.x*d,qe,Fe.y*d]},Q=b(k,w),W=b(A,w),Z=X(k,m[k][w]),$=X(A,m[A][w]);e.triN(Q,W,$,L,I,I,l),e.triN(Q,$,Z,L,I,L,l);let te=b(A,w+1),Le=b(k,w+1),Pe=X(k,m[k][w+1]),Be=X(A,m[A][w+1]);e.triN(Pe,Be,te,j,O,O,l),e.triN(Pe,te,Le,j,O,j,l);let Ne=$[0]-Z[0],Ae=$[2]-Z[2],Ce=Math.hypot(Ne,Ae);if(Ce>1e-12){let me=[-Ae/Ce,0,Ne/Ce];e.tri(Z,$,Be,me,h),e.tri(Z,Be,Pe,me,h)}continue}let U=b(k,w),N=b(A,w),F=b(A,w+1),K=b(k,w+1);e.triN(U,N,F,L,I,O,l),e.triN(U,F,K,L,O,j,l)}let _=b(k,0),V=b(A,0),M=b(A,u),R=b(k,u),E=w=>[w[0],i,w[2]];e.tri(E(_),E(M),E(V),[0,-1,0],f),e.tri(E(_),E(R),E(M),[0,-1,0],f),T(_,V),T(R,M)}if(!n.closed)for(let k of[0,c-1])for(let A=0;A<u;A++)T(b(k,A),b(k,A+1))}function wi(e,t,n){let{bottomY:r,colors:o,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let d of t.rings)for(let p of d.arcs){let m=new Float64Array(p.binCount),l=new Float64Array(p.binCount);for(let h=0;h<p.binCount;h++){let y=(p.startBin+h)%t.binCount,b=Math.max(0,p.innerR[h]-we);m[h]=Math.max(b,a[y]+.001),l[h]=Math.max(m[h]+.001,p.outerR[h]+we)}let f=0;for(let h=0;h<p.binCount;h++){let y=p.topLevelM[h]-r;y>f&&(f=y)}f>=Hl&&ql(e,t,p,m,l,r,o,i);for(let h=0;h<p.binCount;h++){let y=(p.startBin+h)%t.binCount;l[h]>a[y]&&(a[y]=l[h])}}if(n.deriveShell===!1||Wl(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Ul*Ue,u=jl*Ue;for(let d of s.arcs){let p=[],m=[];for(let h=0;h<d.binCount;h++){let y=(d.startBin+h+.5)*t.binStepDeg,b=d.outerR[h]+we+c;p.push(it(t.centre,b,y)),m.push(it(t.centre,b+u,y))}let l=-1/0;for(let h=0;h<d.binCount;h++)d.topLevelM[h]>l&&(l=d.topLevelM[h]);let f=()=>l+Yl;d.closed?ue(e,m,[p.slice().reverse()],f,r,o.shellTop,o.shellWall,i):ue(e,[...m,...p.slice().reverse()],void 0,f,r,o.shellTop,o.shellWall,i)}}function Pi(e,t,n,r,o,i,a,s){if(!t.outline||t.outline.length<3)return;let c=n.baseHeightM,u=Oe(r,s.tierTop);if(!o)return;let d=y=>o.deckAt(y.x,y.y),p=ii(t,a),m=p[0]??t.outline;if(o.rowLevels.length>=2){let y=dn(o.rowLevels),b=ai(Jr(o.rowLevels,n.focal,y),p),x=()=>[0,1,0];for(let v of b){let P=Math.max(c,v.topY-.02);for(let S of i.subtract(v.outline,P))ue(e,S,v.holes,()=>P,c,u,s.tierWall,le,void 0,x)}b.length||ue(e,m,t.holes,()=>o.landingY,c,u,s.tierWall,le);let g={tread:[u[0]*le.top,u[1]*le.top,u[2]*le.top],riser:[u[0]*.72,u[1]*.72,u[2]*.72]};for(let v of p.length?p:[m])ti(e,o.rowLevels,n.focal,o.landingY,g,v,y);return}let l=o.flat?1/0:si,f=y=>o.normalAt(y.x,y.y),h=o.flat?o.landingY:void 0;for(let y of i.subtract(m,h))ue(e,y,t.holes,d,c,u,s.tierWall,le,l,f)}function Ql(e,t,n){let r=new Set;for(let a of e.objects)a.type==="section"&&r.add(a.id);let o=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!r.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let u=t[a],d=o.get(s);d||(d=new Map,o.set(s,d));let p=u.rowId||`__seat-${a}`,m=d.get(p);m||(m={pts:[],levelM:0,n:0},d.set(p,m)),m.pts.push({x:u.x,y:u.y}),m.levelM+=n.seatDeckY(a),m.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 u=s.rowLevels.filter(d=>!d.patch).map(d=>({pts:d.pts,levelM:d.y}));u.length>=2&&i.push({sectionId:a.id,rows:u});continue}let c=o.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(u=>({pts:u.pts,levelM:u.levelM/u.n}))})}return i}function Ci(e,t,n,r,o,i,a=!0){let s=Ql(t,n,r);if(!s.length)return;let c=Si(s,t.focal);c&&(e.setMaterial(0),wi(e,c,{bottomY:t.baseHeightM,colors:{bandTop:Me(o.tierTop,.8),bandWall:o.tierWall,shellTop:i??Me(o.tierWall,1.15),shellWall:i??o.tierWall},ao:le,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a}))}function Ai(e,t,n){return n<0?t>1?e.filter(r=>r.kind==="floor"):[...e]:e.filter(r=>r.floorIndex===void 0||r.floorIndex===n)}function Ri(e,t){let n=[...e].sort((o,i)=>o.screen.y-i.screen.y),r=[];for(let o of n){let i=r.find(a=>a.some(s=>Math.abs(s.screen.x-o.screen.x)<104&&Math.abs(s.screen.y-o.screen.y)<34));i?i.push(o):r.push([o])}return r.flatMap(o=>o.length<2?o:o.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(o.length-1)/2)*104))}})))}var Zl=1.15,$l=2.75,Jl=4.5,eu=.85,tu=.5,nu=.26;function Ii(e,t,n){let r=Math.max(1e-6,t),o=e/r,i=n?.hasZoneLabels??!0,a=new Set;return o>=.75&&a.add("floor"),o>=Zl&&a.add("zone"),o<=(i?$l:Jl)&&(a.add("section"),a.add("ga")),o<=eu&&(a.add("annotation"),a.add("booth")),o<=tu&&a.add("row"),o<=nu&&a.add("seat"),a}function Ei(e,t,n,r,o,i=6){let a=i+t,s=r-i-t,c=i+n,u=o-i-n;return{...e,x:a>s?r/2:Math.max(a,Math.min(s,e.x)),y:c>u?o/2:Math.max(c,Math.min(u,e.y))}}function Ye(e,t,n,r){let o=e,i=t[0],a=t[1],s=t[2],c=o[0]*i+o[4]*a+o[8]*s+o[12],u=o[1]*i+o[5]*a+o[9]*s+o[13],d=o[2]*i+o[6]*a+o[10]*s+o[14],p=o[3]*i+o[7]*a+o[11]*s+o[15];if(!(p>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let m=c/p,l=u/p,f=d/p,h=m>=-1.05&&m<=1.05&&l>=-1.05&&l<=1.05&&f<=1;return{x:(m*.5+.5)*n,y:(1-(l*.5+.5))*r,depth:f,visible:h}}function Ti(e,t,n=t){let r=[],o=[...e].sort((i,a)=>i.screen.depth-a.screen.depth);for(let i of o){let a=!1;for(let s of r)if(yo(i,s,t,n)){a=!0;break}a||r.push(i)}return r}var ou=6;function yo(e,t,n,r){let o=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+ou):n;return o<a&&i<r}function _i(e,t,n){return e.length*t*.58+(n?14:0)}var ru={row:8,seat:14};function ki(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:ru}function Li(e,t,n,r){let o=Math.max(1,Math.min(n,r)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-r/2)/o);return t*(1+1.5*i)}function go(e,t,n,r,o=[]){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>=r)break;let c=!1;for(let u of o)if(yo(s,u,t,n)){c=!0;break}if(!c){for(let u of a)if(yo(s,u,t,n)){c=!0;break}}c||a.push(s)}return a}var iu=6,au=2.2,Fi=.1,su=.3,cu=1.8,lu=.9,uu=.55,du=6e3;function Di(e){let{doc:t,units:n,seats:r,surfaces:o,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let d of n)for(let p of d.objects)p.type==="section"&&p.zone&&c.set(p.id,p.zone);let u=new Map;for(let d=0;d<r.length;d++){let p=r[d],m=o.seatOwner[d],l=p.zoneId??(m?c.get(m):void 0);if(!l)continue;let f=u.get(l);f||(f={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},u.set(l,f)),f.n++,p.x<f.minX&&(f.minX=p.x),p.y<f.minY&&(f.minY=p.y),p.x>f.maxX&&(f.maxX=p.x),p.y>f.maxY&&(f.maxY=p.y),f.sumY+=o.seatDeckY(d)}for(let d of a){let p=u.get(d.id),m=[];for(let[l,f]of c)f===d.id&&m.push(l);if(!p||p.n===0){s.push({id:d.id,label:d.label,color:ne(d.color),sectionIds:m,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(d.focalPoint??i).x*G,1.5,(d.focalPoint??i).y*G]});continue}s.push({id:d.id,label:d.label,color:ne(d.color),sectionIds:m,seatCount:p.n,center:[(p.minX+p.maxX)/2*G,p.sumY/p.n,(p.minY+p.maxY)/2*G],radius:.5*Math.hypot((p.maxX-p.minX)*G,(p.maxY-p.minY)*G)||1,focalWorld:[(d.focalPoint??i).x*G,1.5,(d.focalPoint??i).y*G]})}}return s}function Oi(e){let{doc:t,units:n,seats:r,surfaces:o,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,u=[],d=[],p=[];for(let m of s)m.seatCount!==0&&u.push({id:`zone:${m.id}`,kind:"zone",text:m.label,anchor:[m.center[0],m.center[1]+iu,m.center[2]],color:t.zones?.find(l=>l.id===m.id)?.color});{let m=new Map,l=new Map;for(let f=0;f<r.length;f++){let h=o.seatOwner[f];if(!h)continue;let y=m.get(h);y||(y={n:0,x:0,y:0,deck:0},m.set(h,y)),y.n++,y.x+=r[f].x,y.y+=r[f].y,y.deck+=o.seatDeckY(f);let b=l.get(h);b||(b={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},l.set(h,b)),r[f].x<b.minX&&(b.minX=r[f].x),r[f].x>b.maxX&&(b.maxX=r[f].x),r[f].y<b.minY&&(b.minY=r[f].y),r[f].y>b.maxY&&(b.maxY=r[f].y)}for(let f of n)for(let h of f.objects){if(h.type!=="section")continue;let y=m.get(h.id);if(!y||y.n===0)continue;let b=l.get(h.id),x=[y.x/y.n*G,y.deck/y.n,y.y/y.n*G],g=h.displayLabel||h.label||h.id;d.push({id:h.id,floorIndex:f.index,label:g,seatCount:y.n,center:x,radius:Math.max(1,Math.hypot(b.maxX-b.minX,b.maxY-b.minY)*.5*G),focalWorld:[f.focal.x*G,f.baseHeightM+1.5,f.focal.y*G]});let v=t.floors?.[f.index]?.name?.trim().toLocaleLowerCase();n.length>1&&v===g.trim().toLocaleLowerCase()||u.push({id:`section:${h.id}`,kind:"section",text:g,anchor:[x[0],x[1]+au,x[2]],floorIndex:f.index})}}{for(let f of n)for(let h of f.objects){if(h.type!=="gaArea")continue;let y=Et(h.points);if(!y)continue;let b=h.displayLabel||h.label||h.id;u.push({id:`ga:${h.id}`,kind:"ga",text:h.capacity>0?`${b} \xB7 ${h.capacity.toLocaleString()}`:b,anchor:[y.x*G,f.baseHeightM+cu,y.y*G],floorIndex:f.index})}let m=new Map;for(let f=0;f<r.length;f++){let h=r[f],y=Math.hypot(h.x-c.x,h.y-c.y),b=m.get(h.rowId);(!b||y>b.far)&&m.set(h.rowId,{seat:h,index:f,far:y})}for(let[f,h]of m){let y=h.seat.label?h.seat.label.lastIndexOf("-"):-1,b=y>0?h.seat.label.slice(0,y):f;b&&u.push({id:`row:${f}`,kind:"row",text:b,anchor:[h.seat.x*G,o.seatDeckY(h.index)+lu,h.seat.y*G],floorIndex:a[h.index]})}let l=new Map;for(let f=0;f<r.length;f++){let h=r[f],y=h.label?h.label.lastIndexOf("-"):-1,b=l.get(h.rowId);b||(b={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:y>0?h.label.slice(0,y):h.rowId,sectionId:h.sectionId},l.set(h.rowId,b));let x=f*3,g=i.iPosition[x],v=i.iPosition[x+1],P=i.iPosition[x+2];b.n++,b.x+=g,b.y+=v,b.z+=P,b.minX=Math.min(b.minX,g),b.maxX=Math.max(b.maxX,g),b.minZ=Math.min(b.minZ,P),b.maxZ=Math.max(b.maxZ,P)}for(let[f,h]of l)p.push({id:f,label:h.label,sectionId:h.sectionId,seatCount:h.n,center:[h.x/h.n,h.y/h.n,h.z/h.n],radius:Math.max(.8,Math.hypot(h.maxX-h.minX,h.maxZ-h.minZ)*.5)});if(r.length<=du)for(let f=0;f<r.length;f++){let h=r[f],y=h.displayLabel||h.label;y&&u.push({id:`seat:${h.id}`,kind:"seat",text:y,anchor:[h.x*G,o.seatDeckY(f)+uu,h.y*G],floorIndex:a[f]})}}for(let m of n)for(let l of m.objects)if(l.type==="shape"&&l.role&&["entrance","exit","screen","suite","obstruction"].includes(l.role)){let f=rt(l),h=f?Et(f):null;if(!h||!l.label)continue;u.push({id:`architecture:${l.id}`,kind:"annotation",text:l.label,anchor:[h.x*G,m.baseHeightM+Ot(l).heightM+Fi,h.y*G],color:l.fill,floorIndex:m.index})}else if(l.type==="text"){if(!l.text)continue;u.push({id:`text:${l.id}`,kind:"annotation",text:l.text,anchor:[l.position.x*G,m.baseHeightM+Fi,l.position.y*G],color:l.color,rotation:l.rotation,floorIndex:m.index})}else if(l.type==="booth"){let f=Bt(l);if(!f)continue;let h=Et(f);if(!h)continue;u.push({id:`booth:${l.id}`,kind:"booth",text:l.displayLabel||l.label||l.id,anchor:[h.x*G,m.baseHeightM+po+su,h.y*G],floorIndex:m.index})}return{labels:u,sections:d,rows:p}}function Vi(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 Bi(e){let{doc:t,units:n,seats:r,surfaces:o,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let u=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let m=0;m<i.floor.length;m+=1){let l=Math.max(0,Math.min(n.length-1,Math.round(i.floor[m]))),f=m*3,h=u[l];h.minX=Math.min(h.minX,i.position[f]),h.minY=Math.min(h.minY,i.position[f+1]),h.minZ=Math.min(h.minZ,i.position[f+2]),h.maxX=Math.max(h.maxX,i.position[f]),h.maxY=Math.max(h.maxY,i.position[f+1]),h.maxZ=Math.max(h.maxZ,i.position[f+2])}let d=new Map;for(let m=0;m<n.length;m++)for(let l of n[m].objects)l.type==="section"&&d.set(l.id,m);let p=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 m=0;m<r.length;m++){let l=o.seatOwner[m],f=(l!==null?d.get(l):void 0)??a[m];if(f===void 0)continue;let h=p[f],y=r[m];h.n++,y.x<h.minX&&(h.minX=y.x),y.y<h.minY&&(h.minY=y.y),y.x>h.maxX&&(h.maxX=y.x),y.y>h.maxY&&(h.maxY=y.y);let b=o.seatDeckY(m);h.sumX+=y.x*G,h.sumDeck+=b,h.sumZ+=y.y*G,h.minDeck=Math.min(h.minDeck,b),h.maxDeck=Math.max(h.maxDeck,b+1.6),s[m]=f}for(let m=0;m<n.length;m++){let l=p[m],f=t.floors?.[m],h=u[m],y=Math.min(l.n?l.minX*G:n[m].focal.x*G-1,Number.isFinite(h.minX)?h.minX:1/0),b=Math.max(l.n?l.maxX*G:n[m].focal.x*G+1,Number.isFinite(h.maxX)?h.maxX:-1/0),x=Math.min(l.n?l.minY*G:n[m].focal.y*G-1,Number.isFinite(h.minZ)?h.minZ:1/0),g=Math.max(l.n?l.maxY*G:n[m].focal.y*G+1,Number.isFinite(h.maxZ)?h.maxZ:-1/0),v=Math.min(l.n?Math.min(n[m].baseHeightM,l.minDeck):n[m].baseHeightM,Number.isFinite(h.minY)?h.minY:1/0),P=Math.max(l.n?Math.max(l.maxDeck,v+.5):v+.5,Number.isFinite(h.maxY)?h.maxY:-1/0),S=[l.n?l.sumX/l.n:(y+b)/2,l.n?l.sumDeck/l.n:(v+P)/2,l.n?l.sumZ/l.n:(x+g)/2],C=Math.max(1,.5*Math.hypot(b-y,P-v,g-x));c.push({index:m,id:f?.id??`floor-${m}`,label:f?.name??(n.length>1?`Floor ${m+1}`:"Venue"),seatCount:l.n,center:S,radius:C,box:{min:[y,v,x],max:[b,P,g]},focalWorld:[n[m].focal.x*G,n[m].baseHeightM+1.5,n[m].focal.y*G]})}}return c}function xo(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<r&&(r=c),s>o&&(o=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 u of c.outline)a(u.x,u.y);else if(c.type==="shape"&&c.points)for(let u of c.points)a(u.x,u.y);else if(c.type==="gaArea")for(let u of c.points)a(u.x,u.y);else if(c.type==="booth"){let u=Bt(c);if(u)for(let d of u)a(d.x,d.y)}else if(c.type==="table"){let u=ho(c);if(u)for(let d of u)a(d.x,d.y)}else if(c.type==="decorImage"){let u=bo(c);if(u)for(let d of u)a(d.x,d.y)}return Number.isFinite(n)||(n=-100,r=-100,o=100,i=100),{minX:n,minY:r,maxX:o,maxY:i}}function Ni(e,t,n,r,o,i){if(t.length===1){let a=Math.max(60,(o.maxX-o.minX+o.maxY-o.minY)*.06),s=Lt(o.minX-a,o.minY-a,o.maxX-o.minX+a*2,o.maxY-o.minY+a*2);ue(e,s,void 0,()=>0,-.4,i.ground,i.ground,le)}else{let a=t.reduce((l,f)=>f.baseHeightM<l.baseHeightM?f:l);e.setFloor(a.index);let s=n.filter((l,f)=>r[f]===a.index),c=xo([a],s),u=Math.hypot(c.maxX-c.minX,c.maxY-c.minY),d=Math.max(28,Math.min(80,u*.04)),p=Lt(c.minX-d,c.minY-d,c.maxX-c.minX+d*2,c.maxY-c.minY+d*2),m=a.baseHeightM-.03;ue(e,p,void 0,()=>m,m-.22,i.ground,i.ground,le)}}function Gi(e,t,n){let{cx:r,cz:o,radius:i}=n,a=1/0,s=1/0,c=1/0,u=-1/0,d=-1/0,p=-1/0,m=(h,y,b)=>{a=Math.min(a,h),u=Math.max(u,h),s=Math.min(s,y),d=Math.max(d,y),c=Math.min(c,b),p=Math.max(p,b)};for(let h=0;h<e.position.length;h+=3)m(e.position[h],e.position[h+1],e.position[h+2]);for(let h=0;h<t.count;h++){let y=h*3,b=t.iPosition[y],x=t.iPosition[y+1],g=t.iPosition[y+2],v=Math.max(.35,t.iMaxRadius[h]??.35);m(b-v,x,g-v),m(b+v,x+1.6,g+v)}Number.isFinite(a)||(a=r-i,u=r+i,s=0,d=i*.16,c=o-i,p=o+i);let l=[(a+u)/2,(s+d)/2,(c+p)/2],f=Math.max(1,.5*Math.hypot(u-a,d-s,p-c));return{center:l,radius:f,minY:s,maxY:d}}function zi(e,t,n,r,o,i){let a=1/0,s=1/0,c=-1/0,u=-1/0;for(let v=0;v<e.count;v++){let P=v*3,S=e.iPosition[P],C=e.iPosition[P+2];S<a&&(a=S),S>c&&(c=S),C<s&&(s=C),C>u&&(u=C)}for(let v of t)a=Math.min(a,v.cx-v.halfX),c=Math.max(c,v.cx+v.halfX),s=Math.min(s,v.cz-v.halfZ),u=Math.max(u,v.cz+v.halfZ);let d=n.minX*G,p=n.maxX*G,m=n.minY*G,l=n.maxY*G,f=d,h=p,y=m,b=l;if(Number.isFinite(a)){let v=Math.max(2,.06*Math.hypot(c-a,u-s));f=Math.max(d,a-v),h=Math.min(p,c+v),y=Math.max(m,s-v),b=Math.min(l,u+v)}let x=Math.min(0,r),g=Math.max(o,i*.05);return{min:[f,x,y],max:[h,g,b]}}function Hi(e,t,n){let r=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return r();let o=Tr(t);if(!o.ok||o.value.id!==e)return r();let i=new Map;for(let p of n)for(let m of p.objects)m.type==="shape"&&i.set(m.id,{shape:m,unit:p});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(p=>{let m=p.runtimeContentImageUrl;return[p.id,typeof m=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(m)?m:void 0]})),u=[];for(let p of o.value.overlay.productionElements??[]){let m=i.get(p.objectId),l=m?rt(m.shape):null,f=p.baseElevationM??0;if(!m||!l||l.length<3||!p.id||a.has(p.id)||s.has(p.objectId)||!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50||!Number.isFinite(f)||f<-10||f>100)return r();a.add(p.id),s.add(p.objectId);let h=l.map(T=>T.x*G),y=l.map(T=>T.y*G),b=m.unit.baseHeightM+f,x=Math.min(...h),g=Math.max(...h),v=Math.min(...y),P=Math.max(...y),S,C=c.get(p.id)??p.contentImageUrl;if(p.kind==="screen"&&C)if(g-x>=P-v){let T=Math.abs(v-m.unit.focal.y*G)<=Math.abs(P-m.unit.focal.y*G)?v-.006:P+.006;S=[[x,b,T],[g,b,T],[x,b+p.heightM,T],[g,b+p.heightM,T]]}else{let T=Math.abs(x-m.unit.focal.x*G)<=Math.abs(g-m.unit.focal.x*G)?x-.006:g+.006;S=[[T,b,v],[T,b,P],[T,b+p.heightM,v],[T,b+p.heightM,P]]}u.push({id:p.id,objectId:p.objectId,kind:p.kind,floorIndex:m.unit.index,baseY:b,topY:b+p.heightM,bounds:{min:[x,b,v],max:[g,b+p.heightM,P]},occlusion:p.occlusion,...C?{contentImageUrl:C}:{},...S?{contentPlane:S}:{}})}let d=u.sort((p,m)=>p.id.localeCompare(m.id));return{byObjectId:new Map(d.map(p=>[p.objectId,p])),elements:d}}function ve(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xe(e){return Array.isArray(e)?e:[]}function mu(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!ve(n))continue;let r=ve(n.extensions)?n.extensions:null;if(r&&Object.prototype.hasOwnProperty.call(r,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function bn(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function fu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pu(e,t){let n=new Array(16).fill(0);for(let r=0;r<4;r++)for(let o=0;o<4;o++)for(let i=0;i<4;i++)n[r*4+o]+=e[i*4+o]*t[r*4+i];return n}function hu(e){let t=bn(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:bn(e.translation,3),r=e.rotation===void 0?[0,0,0,1]:bn(e.rotation,4),o=e.scale===void 0?[1,1,1]:bn(e.scale,3);if(!n||!r||!o)return null;let[i,a,s,c]=r,u=Math.hypot(i,a,s,c);if(!(u>1e-8))return null;let d=i/u,p=a/u,m=s/u,l=c/u,f=d+d,h=p+p,y=m+m,b=d*f,x=d*h,g=d*y,v=p*h,P=p*y,S=m*y,C=l*f,T=l*h,B=l*y;return[(1-(v+S))*o[0],(x+B)*o[0],(g-T)*o[0],0,(x-B)*o[1],(1-(b+S))*o[1],(P+C)*o[1],0,(g+T)*o[2],(P-C)*o[2],(1-(b+v))*o[2],0,n[0],n[1],n[2],1]}function bu(e,t,n,r){return[e[0]*t+e[4]*n+e[8]*r+e[12],e[1]*t+e[5]*n+e[9]*r+e[13],e[2]*t+e[6]*n+e[10]*r+e[14]]}function yu(e){let t=e[0],n=e[4],r=e[8],o=e[1],i=e[5],a=e[9],s=e[2],c=e[6],u=e[10],d=i*u-a*c,p=a*s-o*u,m=o*c-i*s,l=t*d+n*p+r*m;if(Math.abs(l)<1e-12)return null;let f=1/l;return[d*f,p*f,m*f,(r*c-n*u)*f,(t*u-r*s)*f,(n*s-t*c)*f,(n*a-r*i)*f,(r*o-t*a)*f,(t*i-n*o)*f]}function Ui(e,t,n,r){let o=e[0]*t+e[1]*n+e[2]*r,i=e[3]*t+e[4]*n+e[5]*r,a=e[6]*t+e[7]*n+e[8]*r,s=Math.hypot(o,i,a)||1;return o/=s,i/=s,a/=s,[o,i,a]}function gu(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,r=null,o=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&&!r)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!ve(c))return null;r=c}catch{return null}else if(a===5130562&&!o)o=s;else return null;n+=i}return n===e.byteLength&&r&&o?{json:r,bin:o}:null}function xu(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function vu(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function Su(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 Mu(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=gu(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:r,bin:o}=n;if(!ve(r.asset)||r.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=xe(r.extensionsUsed).filter(v=>typeof v=="string");if(i.includes("KHR_draco_mesh_compression")||mu(r))return{ok:!1,issue:"draco_not_allowed"};if(i.length||xe(r.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(xe(r.images).length||xe(r.textures).length)return{ok:!1,issue:"external_resource"};let a=xe(r.buffers);if(a.length!==1||!ve(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>o.byteLength)return{ok:!1,issue:"external_resource"};let s=xe(r.accessors),c=xe(r.bufferViews),u=xe(r.meshes),d=xe(r.nodes),p=xe(r.scenes),m=typeof r.scene=="number"?r.scene:0;if(!ve(p[m]))return{ok:!1,issue:"unsupported_glb"};let l=new DataView(o.buffer,o.byteOffset,o.byteLength),f=(v,P,S)=>{if(typeof v!="number"||!Number.isInteger(v)||!ve(s[v]))return null;let C=s[v];if(C.type!==P||C.sparse!==void 0||C.normalized===!0||typeof C.count!="number"||!Number.isInteger(C.count)||C.count<1||typeof C.componentType!="number"||!S.includes(C.componentType)||typeof C.bufferView!="number")return null;let T=c[C.bufferView];if(!ve(T)||T.buffer!==0||typeof T.byteLength!="number"||!Number.isInteger(T.byteLength)||T.byteLength<0)return null;let B=vu(C.type),z=xu(C.componentType),D=typeof T.byteStride=="number"?T.byteStride:B*z,k=typeof T.byteOffset=="number"?T.byteOffset:0,A=typeof C.byteOffset=="number"?C.byteOffset:0,_=k+A,V=A+(C.count-1)*D+B*z;if(!Number.isInteger(D)||!Number.isInteger(k)||!Number.isInteger(A)||D<B*z||k<0||A<0||k+T.byteLength>o.byteLength||V>T.byteLength)return null;let M=[];for(let R=0;R<C.count;R++){let E=[];for(let w=0;w<B;w++){let L=Su(l,_+R*D+w*z,C.componentType);if(!Number.isFinite(L))return null;E.push(L)}M.push(E)}return M},h=[],y=[],b=0,x=new Set,g=(v,P)=>{if(typeof v!="number"||!Number.isInteger(v)||!ve(d[v])||x.has(v))return!1;x.add(v);let S=d[v],C=hu(S);if(!C)return!1;let T=pu(P,C),B=yu(T);if(!B)return!1;if(S.mesh!==void 0){if(typeof S.mesh!="number")return!1;let z=u[S.mesh];if(!ve(z))return!1;for(let D of xe(z.primitives)){if(!ve(D)||D.mode!==void 0&&D.mode!==4||!ve(D.attributes))return!1;let k=f(D.attributes.POSITION,"VEC3",[5126]),A=D.attributes.NORMAL===void 0?null:f(D.attributes.NORMAL,"VEC3",[5126]);if(!k||D.attributes.NORMAL!==void 0&&!A)return!1;let _=k.length;if(D.indices!==void 0){let M=typeof D.indices=="number"?s[D.indices]:null;_=ve(M)?M.count:void 0}if(typeof _!="number"||!Number.isInteger(_)||_%3!==0||(b+=_/3,b>1e5))return!1;let V=D.indices===void 0?k.map((M,R)=>[R]):f(D.indices,"SCALAR",[5121,5123,5125]);if(!V||V.length%3!==0||V.length!==_)return!1;for(let M=0;M<V.length;M+=3){let R=[V[M][0],V[M+1][0],V[M+2][0]];if(R.some(L=>!Number.isInteger(L)||L<0||L>=k.length))return!1;let E=R.map(L=>bu(T,...k[L])),w=null;if(!A){let L=E[1][0]-E[0][0],I=E[1][1]-E[0][1],O=E[1][2]-E[0][2],j=E[2][0]-E[0][0],U=E[2][1]-E[0][1],N=E[2][2]-E[0][2];w=Ui([1,0,0,0,1,0,0,0,1],I*N-O*U,O*j-L*N,L*U-I*j)}for(let L=0;L<3;L++)h.push(...E[L]),y.push(...A?Ui(B,...A[R[L]]):w)}}}for(let z of xe(S.children))if(!g(z,T))return!1;return x.delete(v),!0};for(let v of xe(p[m].nodes))if(!g(v,fu()))return{ok:!1,issue:b>1e5?"triangle_limit":"unsupported_glb"};return!b||h.length!==b*9||y.length!==h.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:b,position:new Float32Array(h),normal:new Float32Array(y)}}function ji(e){try{return Mu(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function gt(e){let{doc:t}=e,n=gr(t.theme),r=n.structure,o=ri(t,e.eventConfigurationId??t.eventConfigurationId),i=Hi(e.eventConfigurationId,e.eventConfiguration,o),a=e.seats,s=new nn,c=null;if(e.registeredShellGlb){let M=ji(e.registeredShellGlb);if(M.ok){let R=M.position.length/3,E=new Float32Array(M.position.length),w=n.materials.shell??r.tierWall;for(let L=0;L<R;L++){let I=M.normal[L*3+1],O=I<-.25?.4:.62+.38*Math.max(0,I);E[L*3]=w[0]*O,E[L*3+1]=w[1]*O,E[L*3+2]=w[2]*O}c={position:M.position,normal:M.normal,color:E,floor:new Float32Array(R).fill(-2),material:new Float32Array(R),count:R}}}let u=new Map;for(let M of o)for(let R of M.objects)u.set(R.id,M.index),R.type==="section"&&u.set(R.logicalSectionId??R.id,M.index);let d=a.map(M=>u.get(M.sectionId??"")??u.get(M.rowId??"")??0),p=xo(o,a);Ni(s,o,a,d,p,r);let m=li(t,a),l=new Map,f=new Map;for(let M of t.categories??[])l.set(M.key,M.color),M.seatGlyph&&f.set(M.key,M.seatGlyph);let h=[],y=ci(o,a,d),b=new Float32Array(a.length),x=[];for(let M=0;M<o.length;M++){let R=o[M];s.setFloor(M);let E=new fn,w=[],L=R.objects.filter(I=>I.type==="section"&&!!I.outline&&I.outline.length>=3);for(let I of R.objects)if(I.type==="section"){let O=s.vertexCount;Pi(s,I,R,ui(I,m),y.bySection.get(I.id),E,L,r);let j=s.vertexCount-O;j>0&&x.push({sectionId:I.id,start:O,count:j})}else if(I.type==="shape"){let O=i.byObjectId.get(I.id);s.setMaterial((O?.kind??I.role)==="screen"?1:0),yi(s,I,R.baseHeightM,mi(I,w),r,R.focal,h,O),s.setMaterial(0)}else I.type==="gaArea"?xi(s,I,R.baseHeightM,ne(l.get(I.categoryKey)),r):I.type==="booth"?hi(s,I,R.baseHeightM,ne(l.get(I.categoryKey)),r):I.type==="table"?bi(s,I,R.baseHeightM,ne(l.get(I.categoryKey)),r):I.type==="decorImage"&&gi(s,I,R.baseHeightM,r);Ci(s,R,a,y,r,n.materials.shell,!c)}let g=o.length>1?{x:o.reduce((M,R)=>M+R.focal.x,0)/o.length,y:o.reduce((M,R)=>M+R.focal.y,0)/o.length}:t.focalPoint??{x:(p.minX+p.maxX)/2,y:(p.minY+p.maxY)/2},v=sr(c?[s.build(),c]:[s.build()]),P=br(a,e.initialState,y,b,l,f),S=Di({doc:t,units:o,seats:a,surfaces:y,focal:g}),{labels:C,sections:T,rows:B}=Oi({doc:t,units:o,seats:a,surfaces:y,seatData:P,hintedSeatFloor:d,zones:S,focal:g}),z=Bi({doc:t,units:o,seats:a,surfaces:y,solids:v,hintedSeatFloor:d,seatFloor:b});Vi(C,z),P.iYaw=pr(P.iPosition,a.length,M=>a[M].rowId,M=>{let R=o[b[M]]?.focal??g;return[R.x*G,R.y*G]});let D=(p.minX+p.maxX)/2*G,k=(p.minY+p.maxY)/2*G,A=.5*Math.hypot((p.maxX-p.minX)*G,(p.maxY-p.minY)*G)||10,_=Gi(v,P,{cx:D,cz:k,radius:A}),V=zi(P,h,p,_.minY,_.maxY,A);return{solids:v,sectionSolidRanges:x,seats:P,bounds:{center:[(V.min[0]+V.max[0])/2,(V.min[1]+V.max[1])/2,(V.min[2]+V.max[2])/2],radius:A,groundY:0,box:V},renderBounds:{center:_.center,radius:_.radius},stateColorLUT:xr(n,fe),theme:n,seatCount:a.length,focalWorld:[g.x*G,1.5,g.y*G],zones:S,stages:h,productionElements:i.elements,sections:T,rows:B,labels:C,floors:z}}var wu=88,Pu=20,vo={floor:{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},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:10.5,weight:"600",opacity:.8},seat:{size:9.5,weight:"500",opacity:.72}},Nt=new Set(["row","seat"]),Yi={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},yn={row:{x:62,y:16},seat:{x:46,y:18}},Xi=ne,So=e=>Bo(e);function Wi(e,t){let n=So(e),r=So(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function Mo(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(o=>Number(n[o])/255*r+t[o-1]*(1-r))}function Cu(e,t=[.04,.06,.1],n=!0){let r=So(t)<.42,o=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?Mo(i,t):t,s=Xi(e),c=n?7:4.5,u=s&&Wi(s,a)>=c?e:o;return r?{ink:u,backing:i,border:"rgba(210,222,245,.24)"}:{ink:u,backing:i,border:"rgba(11,18,32,.22)"}}var Au='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',gn=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||Au,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;for(let[n,r]of this.nodes)t.some(o=>o.id===n)||(r.remove(),this.nodes.delete(n))}setForcedDense(t){this.forcedDense=t}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let o=this.nodes.get(r.id),i=o?.getBoundingClientRect(),a=!!(n&&o&&o.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:a,renderedFontPx:o&&Number.parseFloat(o.style.fontSize)||0,contrast:o?Number(o.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,r,o,i,a){if(!this.labels.length)return;let s=Ii(o,i,{hasZoneLabels:this.labels.some(g=>g.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"));let c=[];for(let g of this.labels){if(!s.has(g.kind))continue;let v=Ye(t,g.anchor,n,r);if(!v.visible)continue;let P=_i(g.text,vo[g.kind].size,!Nt.has(g.kind)),S=!Nt.has(g.kind),C=Ei(v,P/2,vo[g.kind].size/2+(S?4:1),n,r),T=a?Math.hypot(g.anchor[0]-a[0],g.anchor[1]-a[1],g.anchor[2]-a[2]):1;c.push({label:g,screen:C,focus:Li(C,T,n,r),halfWidth:P/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let u=Ri(c.filter(g=>g.label.kind==="floor"),n),d=[...c.filter(g=>!Nt.has(g.label.kind)&&g.label.kind!=="floor"),...u],p=Ti(d,wu,Pu),m=ki(n),l=go(c.filter(g=>g.label.kind==="row"),yn.row.x,yn.row.y,m.row,p),f=go(c.filter(g=>g.label.kind==="seat"),yn.seat.x,yn.seat.y,m.seat,[...p,...l]),h=[...p,...l,...f],y=new Set(h.map(g=>g.label.id));for(let{label:g,screen:v}of h){let S=this.nodeFor(g).style;S.display="",S.transform=`translate(-50%, -50%) translate(${v.x.toFixed(1)}px, ${v.y.toFixed(1)}px)`}let b=h.filter(({label:g})=>!Nt.has(g.kind)).sort((g,v)=>Yi[v.label.kind]-Yi[g.label.kind]||g.screen.depth-v.screen.depth||g.focus-v.focus),x=[];for(let{label:g}of b){let v=this.nodes.get(g.id);if(!v||v.style.display==="none")continue;let P=v.getBoundingClientRect();x.some(C=>P.left<C.right+3&&P.right+3>C.left&&P.top<C.bottom+3&&P.bottom+3>C.top)?v.style.display="none":x.push(P)}for(let[g,v]of this.nodes)y.has(g)||(v.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let p=n.style;p.position="absolute",p.left="0",p.top="0",p.whiteSpace="nowrap",p.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",p.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}n.textContent=t.text,n.setAttribute("data-label-kind",t.kind);let r=this.selectedSeatLabelIds.has(t.id);n.toggleAttribute("data-selected-seat",r);let o=vo[t.kind],i=n.style;i.fontSize=`${o.size}px`,i.fontWeight=r?"800":o.weight,i.opacity=r?"1":String(o.opacity);let a=!Nt.has(t.kind),s=Cu(t.color??this.opts.ink,this.opts.backgroundRgb,a);i.color=r?"#ecf8ff":s.ink,i.background=r?"rgba(10,28,45,.9)":a?s.backing:"",i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${s.border}`:"",i.borderRadius=r||a?"999px":"",i.padding=r||a?"3px 7px":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"",i.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let c=this.opts.backgroundRgb??[.04,.06,.1],u=Xi(r?"#ecf8ff":s.ink)??[1,1,1],d=r?Mo("rgba(10,28,45,.9)",c):a?Mo(s.backing,c):c;return n.dataset.qualityContrast=Wi(u,d).toFixed(3),(t.kind==="zone"||t.kind==="floor")&&(i.textTransform="uppercase"),n}dispose(){this.root.remove(),this.nodes.clear()}};var qi=1;var Ru=new Set(["floor","zone","section","ga","booth","annotation"]);function Iu(e){return e.every(t=>Number.isFinite(t))}function Eu(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 Ki(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function at(e){return Math.round(e*1e4)/1e4}function Tu(e){if(e)return{box:{x:at(e.box.x),y:at(e.box.y),width:at(e.box.width),height:at(e.box.height)},horizontalFillRatio:at(e.horizontalFillRatio),verticalFillRatio:at(e.verticalFillRatio),visibleAreaRatio:at(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function Te(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function xn(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>Ru.has(s.kind)),r=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,o=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)Eu(n[s].screenBox,n[c].screenBox)&&o.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=[Te("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Te("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Te("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Te("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}`}]),Te("camera-invalid","The capture camera must have a finite physical pose",Iu(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Te("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}]),Te("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Te("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}))),Te("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}))),Te("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",o)].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:u})=>({id:s,kind:c,text:u})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:Tu(e.framing)},metrics:{minimumHierarchyFontPx:Ki(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Ki(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}var ce=require("ogl");var Xe=require("ogl");var vn=`
|
|
20
|
+
}`});async function qa(e,t,n,r={}){let o=r.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-ke,Math.min(ke,t?.initialPitchDeg??0)),s=Tn,c=!1,u=new AbortController,d=()=>u.abort();r.signal?.addEventListener("abort",d,{once:!0});let p=()=>{},m=[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 I=n.camera.position,O=n.focalWorld[0]-I.x,j=n.focalWorld[1]-I.y,U=n.focalWorld[2]-I.z,N=Math.hypot(O,U);N>.001&&(i=Math.atan2(O,-U)*180/Math.PI,a=Math.max(-ke,Math.min(ke,Math.atan2(j,N)*180/Math.PI)))}let l=null;if(t){let I=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),O=Rn(t,An(I)),j;try{let U=t.resolveUrl?await t.resolveUrl(O.initialUrl):O.initialUrl;if(!U)throw new Error("panorama_asset_unavailable");j=await Ht(U,u.signal)}catch{return r.signal?.removeEventListener("abort",d),null}try{l=Xa(n.gl,j)}catch{return u.abort(),r.signal?.removeEventListener("abort",d),null}l.mesh.renderOrder=999,l.mesh.setParent(n.scene),O.upgradeUrl&&(p=In(()=>{(t.resolveUrl?t.resolveUrl(O.upgradeUrl):Promise.resolve(O.upgradeUrl)).then(N=>!N||u.signal.aborted?null:Ht(N,u.signal)).then(N=>{N&&(c||u.signal.aborted||(l?.setImage(N),n.requestRender()))}).catch(()=>{})}))}let f=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let h=n.camera.quaternion.slice(),y=()=>{let I=n.camera.position;l?.mesh.position.set(I.x,I.y,I.z);let[O,j,U]=Ya(i,a);n.camera.lookAt([I.x+O,I.y+j,I.z+U]),n.requestRender()};y();let b=document.createElement("div"),x=document.activeElement instanceof HTMLElement?document.activeElement:null;b.setAttribute("role","dialog"),b.setAttribute("aria-modal","true"),b.setAttribute("aria-label",r.seatLabel?`View from ${r.seatLabel}`:"View from seat"),b.tabIndex=-1,Object.assign(b.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let g=document.createElement("button");if(g.type="button",g.setAttribute("aria-label","Close"),g.textContent="\u2715",Object.assign(g.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"}),b.appendChild(g),r.disclosure){let I=document.createElement("div");I.textContent=`${r.disclosurePrefix??"360\xB0 panorama"} \xB7 ${r.disclosure}`,Object.assign(I.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)"}),b.appendChild(I)}let v=document.createElement("div");v.textContent=_o(r.lookAroundHint),Object.assign(v.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"}),b.appendChild(v),e.appendChild(b),g.focus({preventScroll:!0});let P=!1,S=0,C=0,T=0,B=new Map,z=()=>{let[I,O]=[...B.values()];return I&&O?Math.hypot(I.x-O.x,I.y-O.y):0},D=I=>{let O=To(I);O!==s&&(s=O,n.camera.perspective({fov:s,aspect:n.camera.aspect}),y())},k=I=>{I.target!==g&&(B.set(I.pointerId,{x:I.clientX,y:I.clientY}),P=B.size===1,S=I.clientX,C=I.clientY,B.size===2&&(T=z()),b.setPointerCapture?.(I.pointerId),b.style.cursor="grabbing")},A=I=>{if(B.has(I.pointerId)){if(B.set(I.pointerId,{x:I.clientX,y:I.clientY}),B.size>=2){let O=z();T>0&&O>0&&D(s*(T/O)),T=O,P=!1;return}P&&(i+=(I.clientX-S)*Ka,a=Math.max(-ke,Math.min(ke,a+(I.clientY-C)*Ka)),S=I.clientX,C=I.clientY,y())}},_=I=>{B.delete(I.pointerId),T=B.size===2?z():0;let O=B.values().next().value;P=B.size===1,O?(S=O.x,C=O.y):b.style.cursor="grab";try{b.releasePointerCapture?.(I.pointerId)}catch{}},V=I=>{I.preventDefault(),D(s+I.deltaY*.04)};b.addEventListener("pointerdown",k),b.addEventListener("pointermove",A),b.addEventListener("pointerup",_),b.addEventListener("pointercancel",_),b.addEventListener("wheel",V,{passive:!1});let M=I=>{if(!c){if(I.key==="Tab"){I.preventDefault(),g.focus({preventScroll:!0});return}if(I.key==="Escape"){I.stopPropagation(),L.close();return}if(I.key==="ArrowLeft"||I.key==="ArrowRight")i+=I.key==="ArrowLeft"?-4:4;else if(I.key==="ArrowUp"||I.key==="ArrowDown")a=Math.max(-ke,Math.min(ke,a+(I.key==="ArrowUp"?4:-4)));else if(I.key==="+"||I.key==="="){D(s-5),I.preventDefault();return}else if(I.key==="-"){D(s+5),I.preventDefault();return}else return;I.preventDefault(),y()}};window.addEventListener("keydown",M);let R=0,E=(I,O)=>{if(!l){O?.();return}let j=I===1?0:1,U=performance.now(),N=()=>{if(c)return;let F=o<=0?1:Math.min(1,(performance.now()-U)/o);l?.setOpacity(j+(I-j)*F),n.requestRender(),F<1?R=requestAnimationFrame(N):O?.()};R=requestAnimationFrame(N)};E(1);let w=()=>{c||(c=!0,p(),u.abort(),r.signal?.removeEventListener("abort",d),cancelAnimationFrame(R),b.removeEventListener("pointerdown",k),b.removeEventListener("pointermove",A),b.removeEventListener("pointerup",_),b.removeEventListener("pointercancel",_),b.removeEventListener("wheel",V),window.removeEventListener("keydown",M),b.remove(),x?.isConnected&&x.focus({preventScroll:!0}),l?.dispose(),n.camera.position.set(m[0],m[1],m[2]),n.camera.perspective({fov:f,aspect:n.camera.aspect}),n.camera.quaternion.set(h[0],h[1],h[2],h[3]),n.requestRender())},L={close(){if(c)return;let I=()=>{w(),r.onClose?.()};cancelAnimationFrame(R),E(0,I)},dispose:w};return g.addEventListener("click",()=>L.close()),L}var Ka,Qa=Ct(()=>{"use strict";Wa();_n();_n();Eo();Ka=.15});var Za={};Vo(Za,{createOpenPanorama:()=>Nd});function Nd(e){let{container:t,model:n,opts:r,analytics:o,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:u,gpu:d,gl:p,isContextLost:m,isDisposed:l,flightGen:f,setPanorama:h,getLoadAbort:y,setLoadAbort:b,setPanoramaSphereVisible:x,setFrozen:g,raisePanoramaLayer:v,restorePanoramaLayer:P,getOverviewChip:S,labelOverlay:C,reducedMotion:T,removeArriveChip:B,showArriveChip:z}=e;return async(D,k,A)=>{y()?.abort();let _=new AbortController;b(_);let V=n.seats.idToIndex.get(D);if(V===void 0){i.syncFromCamera();return}let M=s.get(D)?.label??D,R=u(D,V),E=c(D);if(!E){_.abort(),y()===_&&b(null),i.syncFromCamera();return}g(!0),a.stop();let w;try{w=await E}catch{if(y()===_&&b(null),o.panoramaFailed(D,"source"),!l()&&A===f()){g(!1),i.resumeAfterFlight(R.focal),a.requestRender();let K=z(D,A,!0);requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus())}return}if(l()||A!==f()){_.abort(),y()===_&&b(null);return}B();let L=S(),I=()=>{_.abort(),y()===_&&b(null),h(null),x(!1),P(),L.style.display="",C.setVisible(!r.arriveAtSeatEye),g(!1),o.panoramaClosed(),i.resumeAfterFlight(R.focal),a.requestRender();let K=z(D,f());requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus())},O=w.generated===!0,j=Ua(w);v(),x(!O),L.style.display="none";let U=T()?0:k,N=d(),F=N&&!m()?await qa(t,O?null:w,{gl:p,scene:N.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:O?R.eye:void 0,focalWorld:R.focal},{fadeMs:U,seatLabel:M,disclosure:j,disclosurePrefix:O?"Live seat-eye view":"360\xB0 panorama",lookAroundHint:r.lookAroundHint,onClose:I,signal:_.signal}):null;if(l()||A!==f()){_.abort(),x(!1),y()===_&&b(null),F?.dispose(),L.style.display="",P();return}if(F)i.syncFromCamera(),C.setVisible(!1),g(!1),a.requestRender(),h(F);else if(O){P(),L.style.display="",g(!1),i.resumeAfterFlight(R.focal),a.requestRender(),h(null),x(!1),o.panoramaFailed(D,"mount");let K=z(D,f(),!0);requestAnimationFrame(()=>K?.querySelector("[data-panorama-trigger]")?.focus()),y()===_&&b(null);return}else x(!1),o.panoramaFallback(D),h(ja(t,w,{fadeMs:U,seatLabel:M,disclosure:j,onClose:I,signal:_.signal,lookAroundHint:r.lookAroundHint}));o.panoramaOpened()}}var $a=Ct(()=>{"use strict";_n();Qa()});var Xd={};Vo(Xd,{VENUE3D_QUALITY_REPORT_VERSION:()=>qi,buildSceneModel:()=>gt,inspectVenue3DQualityEvidence:()=>xn,mountVenue3D:()=>Yd,prepareVenue3D:()=>ls,prepareVenue3DFromChart:()=>us});module.exports=ws(Xd);var Ho=require("ogl");var Ps=/^#?([\da-f]{3}|[\da-f]{6})$/i;function Cs(e){let t=Ps.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(o=>o+o).join(""):t[1],r=parseInt(n,16);return[r>>16&255,r>>8&255,r&255]}function ne(e){let t=Cs(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function Nn(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function As(e){return .2126*Nn(e[0])+.7152*Nn(e[1])+.0722*Nn(e[2])}function No(e){return As([e[0]*255,e[1]*255,e[2]*255])}function Rs(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=Rs(e);return ge(e,[n,n,n],t)}var fe=["available","held","sold","selected","dimmed"];function Rt(e){let t=fe.indexOf(e);return t<0?0:t}var Go={available:[.24,.82,.52],held:[.95,.66,.22],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function zo(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.42,r=.62;return[(t+(e[0]-t)*n)*r,(t+(e[1]-t)*n)*r,(t+(e[2]-t)*n)*r]}var Gn={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]},Je={top:[.05,.06,.08],bottom:[.1,.12,.15]};function Me(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function Is(){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 qt=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 Ho.Renderer({canvas:this.canvas,dpr:Is(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Je.top[0],Je.top[1],Je.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=r=>{r.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 dt=require("ogl"),pe=Math.PI/180,zn=15*pe,Hn=80*pe,ut=.12,Uo=35,jo=1.25,Qt=class{constructor(t,n,r,o){this.fovY=Uo;this.target=new dt.Vec3;this.azimuth=-30*pe;this.polar=55*pe;this.distance=10;this.azT=-30*pe;this.polT=55*pe;this.distT=10;this.minDist=1;this.maxDist=100;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 dt.Vec3;this.panAnchor=new dt.Vec3;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new dt.Camera(t,{fov:Uo,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=o,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=i.button===2||i.button===1,s=i.button===0&&(i.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=a||s,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();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 c=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-c)*.005)),this.fireGesture()),this.pinchDist=c;let u=this.pinchCentroid();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}this.dragging&&(this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture(),this.azT-=a*.006,this.polT=Math.max(zn,Math.min(Hn,this.polT-s*.006)),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.dollyBy(Math.exp(s*.22)),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*pe;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(zn,Math.min(Hn,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(.82);else if(i.key==="-"||i.key==="_")this.dollyBy(1.22);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,r=0;for(let o of t)n+=o.x,r+=o.y;return{x:n/t.length,y:r/t.length}}panBy(t,n){let r=this.canvas.clientHeight||1,o=2*this.distance*Math.tan(this.fovY*pe/2)/r,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,u=Math.cos(this.polar),d=Math.sin(this.polar),p=-i*u,m=-a*u;this.targetT.x+=(-t*s+n*p)*o,this.targetT.z+=(-t*c+n*m)*o,this.targetT.y+=n*d*o,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,o=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(o-t,Math.min(o+t,this.targetT.z)),this.targetT.y=Math.max(r-t*.5,Math.min(r+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}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()}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}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,r,o=!1,i){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,t.radius)*1.5;let a=Math.max(1,t.radius),s=this.fovY*pe/2,c=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,u=Math.atan(Math.tan(s)*c);this.azT=r??-30*pe,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*pe;let d=this.fitDistance(t,s,u,this.azT,this.polT);this.distT=d*Math.max(1.05,Math.min(2,i?.margin??jo)),this.minDist=Math.max(2,a*.12),this.maxDist=d*4,n?(this.azimuth=this.azT,this.polar=12*pe,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){this.camera.perspective({aspect:t})}frameSoft(t,n,r=!1,o){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,t.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*pe/2,a=r?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,o?.polarDeg??55))*pe;let c=this.fitDistance(t,i,s,this.azT,this.polT);this.distT=c*Math.max(1.05,Math.min(2,o?.margin??jo))}fitDistance(t,n,r,o,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(r)),c=t.box;if(!c)return s;let u=Math.sin(i),d=-u*Math.sin(o),p=-Math.cos(i),m=-u*Math.cos(o);if(Math.abs(p)>.999)return s;let l=-m,f=d,h=Math.hypot(l,f);l/=h,f/=h;let y=-f*p,b=f*d-l*m,x=l*p,g=Math.tan(r),v=Math.tan(n),P=1;for(let S=0;S<8;S++){let C=(S&1?c.max[0]:c.min[0])-t.center[0],T=(S&2?c.max[1]:c.min[1])-t.center[1],B=(S&4?c.max[2]:c.min[2])-t.center[2],z=C*d+T*p+B*m,D=Math.abs(C*l+B*f),k=Math.abs(C*y+T*b+B*x);P=Math.max(P,D/g-z,k/v-z)}return Math.min(s,Math.max(P,a*.35))}updateClipping(t){let n=this.camera.position.x-t.center[0],r=this.camera.position.y-t.center[1],o=this.camera.position.z-t.center[2],i=Math.hypot(n,r,o),a=Math.max(1,t.radius)*1.18,s=Math.max(.05,i-a),c=Math.max(s+10,i+a);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,o=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(r)>1e-4||Math.abs(o)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*ut,this.polar+=n*ut,this.distance+=r*ut,this.target.x+=o*ut,this.target.y+=i*ut,this.target.z+=a*ut,c&&this.applyPosition(),c}get currentDistance(){return this.distance}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,o=Math.hypot(t,n,r)||1,i=Math.max(zn,Math.min(Hn,Math.acos(Math.max(-1,Math.min(1,n/o)))));this.distance=this.distT=o,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,r)}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),r=this.target.y+this.distance*Math.cos(this.polar),o=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,r,o),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()}};var Zt=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 o=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+o*.1:o}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 Yo(e,t,n){return Math.max(t,Math.min(n,e))}var mt=2.5,Es=1.15,It=6,ft=10,Xo=6,Wo=9.5,Ko=.9,qo=2.2,Un=30,jn=4,$t=8192;var nm=ft+jn;function Qo(e,t){let n=t*1.4,r=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:mt};let o=Math.min(1,(e-n)/Math.max(.001,r-n));return{scale:1-o*.4,fade:o*.55,minPixels:mt+o*(Es-mt)}}function Zo(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}function $o(e,t,n,r,o){if(!(e>0)||!(t>0)||!(n>0)||!(r>0)||!(o>0))return!1;let i=Math.tan(r/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(o/2);return Math.PI*a*a/e>=64}var Ts=[{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"}],rm=new Map(Ts.map(e=>[e.key,e]));var _s={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 Jo(e){let t=e?.[0];return t&&_s[t]||"#3b82f6"}var ks=[{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"}],im=new Map(ks.map(e=>[e.key,e]));var Ls=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],am=new Set(Ls);var tr=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds: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}},{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}},{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}},{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}},{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}},{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}},{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}}],nr=tr.map(e=>e.key),Fs=new Map(tr.map(e=>[e.key,e]));function er(e){return typeof e=="string"&&Fs.has(e)}function or(e,t){return er(e)?e:er(t?.seatGlyph)?t.seatGlyph:"circle"}var he=.02291666666666667,Ue=1/he,Ds=58,Os=Ds*he;var Vs=3,rr=0,Yn=120,Bs=0,Ns=45,Gs=7,Ee=1.2;function Xn(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function zs(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Gs?e:Vs}function Jt(e,t={}){let n=Xn(t.floorBaseHeightM,rr,Yn,0),r=Math.min(Yn,n+zs(e.elevation)*Os),o=e.height===void 0?r:Xn(e.height,rr,Yn,r),i=Xn(e.rake,Bs,Ns,0);return{height:o,rake:i}}var ar=lt(require("earcut"),1),sr=lt(require("polygon-clipping"),1);var mm=Math.PI/180;function Wn(e){let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;let r=e.length||1;return{x:t/r,y:n/r}}function Et(e){return e.length?Wn(e):null}function et(e){let t=0;for(let n=0,r=e.length;n<r;n+=1){let o=e[n],i=e[(n+1)%r];t+=o.x*i.y-i.x*o.y}return t/2}function Tt(e,t,n){let r=!1;for(let o=0,i=e.length-1;o<e.length;i=o++){let a=e[o],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}var G=he,Hs=.002;function Us(e,t,n){let r=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),o=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(r,o,i);if(a<1e-9)return!0;let s=(r+o+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-r)*(s-o)*(s-i)))/a<Hs}var tt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,r){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++]=r}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 r=new Float32Array(n);r.set(this.buf.subarray(0,this.len)),this.buf=r}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},nn=class{constructor(){this.pos=new tt;this.nor=new tt;this.col=new tt;this.flr=new tt;this.mat=new tt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,r,o,i,a=i,s=i){Us(t,n,r)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.nor.push3(o[0],o[1],o[2]),this.col.push3(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,r,o,i,a,s,c=s,u=s){[...t,...n,...r].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(r[0],r[1],r[2]),this.nor.push3(o[0],o[1],o[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(u[0],u[1],u[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function js(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],u=o*c-i*s,d=i*a-r*c,p=r*s-o*a,m=Math.hypot(u,d,p)||1;return u/=m,d/=m,p/=m,[u,d,p]}function Ys(e,t){let n=[...e],r=[];for(let a of e)r.push(a.x,a.y);let o=[];if(t){for(let a of t)if(!(a.length<3)){o.push(n.length);for(let s of a)n.push(s),r.push(s.x,s.y)}}let i=(0,ar.default)(r,o.length?o:void 0,2);return{pts:n,tris:i}}function Kn(e){return et(e)<0?[...e].reverse():e}var Xs=3;function Ws(e,t,n,r){let o=r(e),i=r(t),a=r(n),s=(l,f,h,y)=>Math.abs(r({x:(l.x+f.x)/2,y:(l.y+f.y)/2})-(h+y)/2),c=(e.x+t.x+n.x)/3,u=(e.y+t.y+n.y)/3,d=(o+i+a)/3,p=Math.max(s(e,t,o,i),s(t,n,i,a),s(n,e,a,o),Math.abs(r({x:c,y:u})-d)),m=(l,f,h)=>{let y=Math.abs(r({x:(l+c)/2,y:(f+u)/2})-(h+d)/2);y>p&&(p=y)};return m((e.x+t.x)/2,(e.y+t.y)/2,(o+i)/2),m((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),m((n.x+e.x)/2,(n.y+e.y)/2,(a+o)/2),p}function _t(e,t,n,r,o){if(o<=0)return Ws(e,t,n,r);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(_t(e,i,s,r,o-1),_t(i,t,a,r,o-1),_t(s,a,n,r,o-1),_t(i,a,s,r,o-1))}function kt(e,t,n,r,o,i,a,s){if(a>0){let m={x:(t.x+n.x)/2,y:(t.y+n.y)/2},l={x:(n.x+r.x)/2,y:(n.y+r.y)/2},f={x:(r.x+t.x)/2,y:(r.y+t.y)/2};kt(e,t,m,f,o,i,a-1,s),kt(e,m,n,l,o,i,a-1,s),kt(e,f,l,r,o,i,a-1,s),kt(e,m,l,f,o,i,a-1,s);return}let c=[t.x*G,o(t),t.y*G],u=[n.x*G,o(n),n.y*G],d=[r.x*G,o(r),r.y*G];if(s){e.triN(c,u,d,s(t),s(n),s(r),i);return}let p=js(c,u,d);p[1]<0&&(p=[-p[0],-p[1],-p[2]]),e.tri(c,u,d,p,i)}var Ks=8;function ir(e,t,n){if(!Number.isFinite(n))return e;let r=[],o=(i,a,s,c,u)=>{if(u>0){let d={x:(i.x+a.x)/2,y:(i.y+a.y)/2},p=t(d);if(Math.abs(p-(s+c)/2)>n){o(i,d,s,p,u-1),o(d,a,p,c,u-1);return}}r.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];o(a,s,t(a),t(s),Ks)}return r}function en(e,t){if(e.length<3)return e;let n=[];for(let o of e){let i=n[n.length-1];i&&Math.hypot(o.x-i.x,o.y-i.y)<t||n.push(o)}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 r=[];for(let o=0;o<n.length;o++){let i=r.length?r[r.length-1]:n[(o-1+n.length)%n.length],a=n[o],s=n[(o+1)%n.length],c=s.x-i.x,u=s.y-i.y,d=Math.hypot(c,u);d>t&&Math.abs((a.x-i.x)*u-(a.y-i.y)*c)/d<t||r.push(a)}return r.length>=3?r:n}var tn=.001*Ue*.1;function ue(e,t,n,r,o,i,a,s,c=1/0,u){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs(et(t))<1e-4))return;let d=en(ir(en(Kn(t),tn),r,c),tn),p=n?.map(S=>en(ir(en(Kn(S),tn),r,c),tn)).filter(S=>S.length>=3&&Math.abs(et(S))>=1e-4),{pts:m,tris:l}=Ys(d,p),f=[i[0]*s.top,i[1]*s.top,i[2]*s.top],h=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],y=[a[0]*s.top,a[1]*s.top,a[2]*s.top],b=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],x=0;if(Number.isFinite(c))for(;x<Xs;x++){let S=0;for(let C=0;C<l.length;C+=3){let T=_t(m[l[C]],m[l[C+1]],m[l[C+2]],r,x);T>S&&(S=T)}if(S<=c)break}for(let S=0;S<l.length;S+=3){let C=m[l[S]],T=m[l[S+1]],B=m[l[S+2]];kt(e,C,T,B,r,f,x,u);let z=[C.x*G,o,C.y*G],D=[T.x*G,o,T.y*G],k=[B.x*G,o,B.y*G];e.tri(z,k,D,[0,-1,0],h)}let g=S=>{if(x<=0)return S;let C=1<<x,T=[];for(let B=0;B<S.length;B++){let z=S[B],D=S[(B+1)%S.length];for(let k=0;k<C;k++){let A=k/C;T.push({x:z.x+(D.x-z.x)*A,y:z.y+(D.y-z.y)*A})}}return T},v=Wn(d),P=[{ring:g(d),flip:!1}];if(p)for(let S of p)S.length>=3&&P.push({ring:g(S),flip:!0});for(let{ring:S,flip:C}of P)for(let T=0;T<S.length;T++){let B=S[T],z=S[(T+1)%S.length],D=(z.x-B.x)*G,A=(z.y-B.y)*G,_=-D,V=Math.hypot(A,_)||1;A/=V,_/=V;let M=(B.x+z.x)/2-v.x,R=(B.y+z.y)/2-v.y,E=A*M+_*R;C&&(E=-E),E<0&&(A=-A,_=-_);let w=[A,0,_],L=[B.x*G,r(B),B.y*G],I=[z.x*G,r(z),z.y*G],O=[B.x*G,o,B.y*G],j=[z.x*G,o,z.y*G];e.tri(L,I,j,w,y,y,b),e.tri(L,j,O,w,y,b,b)}}function cr(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),r=new Float32Array(t*3),o=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),r.set(c.normal,s*3),o.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:r,color:o,floor:i,material:a,count:t}}function on(e,t,n=2.5){if(t<=0||e.length<3)return e;let r=Kn(e),o=r.length,i=[];for(let s=0;s<o;s++){let c=r[s],u=r[(s+1)%o],d=u.x-c.x,p=u.y-c.y,m=Math.hypot(d,p)||1;i.push({x:p/m,y:-d/m})}let a=[];for(let s=0;s<o;s++){let c=r[s],u=i[(s-1+o)%o],d=i[s],p=u.x+d.x,m=u.y+d.y,l=Math.hypot(p,m),f=()=>{a.push([c.x+u.x*t,c.y+u.y*t]),a.push([c.x+d.x*t,c.y+d.y*t])};if(l<1e-9){f();continue}p/=l,m/=l;let h=p*u.x+m*u.y,y=1/Math.max(h,1e-6);if(!Number.isFinite(y)||y>n){f();continue}a.push([c.x+p*t*y,c.y+m*t*y])}if(a.length<3)return e;try{let s=sr.default.union([[...a,a[0]]]),c=null,u=-1/0;for(let p of s){let m=Math.abs(et(p[0].map(([l,f])=>({x:l,y:f}))));m>u&&(u=m,c=p[0])}if(!c)return e;let d=c.map(([p,m])=>({x:p,y:m}));if(d.length>1){let p=d[0],m=d[d.length-1];Math.abs(p.x-m.x)<1e-9&&Math.abs(p.y-m.y)<1e-9&&d.pop()}return d.length>=3?d:e}catch{return e}}function rn(e,t,n,r,o=28){let i=[];for(let a=0;a<o;a++){let s=a/o*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+r*Math.sin(s)})}return i}function Lt(e,t,n,r){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+r},{x:e,y:t+r}]}var ae={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},qs=.44,Qs=.15,lr=.3,Zs=.24;function ur(e){return e===void 0||!Number.isFinite(e)||e<=0?Zs:Math.min(lr,Math.max(Qs,e*qs))}var qn=.21,$s=.05,Qn=.45,an=Qn+$s,dr=.92,Zn=1.205,mr=-.23,fr=.38,Js=[{part:ae.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:ae.pad,min:[-1,.36,-.95],max:[1,Qn,1]},{part:ae.back,min:[-1,an,-1],max:[1,dr,-.72]},{part:ae.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:ae.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:ae.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:ae.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:ae.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:ae.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:ae.leg,min:[.62,0,.48],max:[.82,.37,.7]}],ec=[{part:ae.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:ae.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:ae.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:ae.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:ae.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],tc=[{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 pr(){let e=[],t=[],n=[],r=[],o=(V,M,R)=>{let E=n.length,[w,L,I]=V,O=[L[0]-w[0],L[1]-w[1],L[2]-w[2]],j=[I[0]-w[0],I[1]-w[1],I[2]-w[2]],U=O[1]*j[2]-O[2]*j[1],N=O[2]*j[0]-O[0]*j[2],F=O[0]*j[1]-O[1]*j[0],K=Math.hypot(U,N,F);K>1e-9?(U/=K,N/=K,F/=K):[U,N,F]=M,U*M[0]+N*M[1]+F*M[2]<0&&(U=-U,N=-N,F=-F);for(let X of V)e.push(...X),t.push(U,N,F),n.push(R);r.push(E,E+1,E+2,E,E+2,E+3)},i=V=>{for(let M of tc){let R=M.c.map(E=>E.map((w,L)=>w?V.max[L]:V.min[L]));o(R,M.n,V.part)}};for(let V of Js)i(V);for(let V of ec)i(V);let a=Qn,s=1.08,c=.47,u=.69,d=-.55,p=.08,m=-.48,l=.01,f=[-c,a,d],h=[c,a,d],y=[-c,a,p],b=[c,a,p],x=[-u,s,m],g=[u,s,m],v=[-u,s,l],P=[u,s,l];o([h,g,P,b],[1,0,0],ae.body),o([y,v,x,f],[-1,0,0],ae.body),o([v,P,g,x],[0,1,0],ae.body),o([f,h,b,y],[0,-1,0],ae.body),o([b,P,v,y],[0,0,1],ae.body),o([f,x,g,h],[0,0,-1],ae.body);let S=10,C=8,T=[0,Zn,mr],B=[.42,.115,fr],z=n.length;for(let V=0;V<=C;V++){let M=Math.PI*V/C,R=Math.cos(M),E=Math.sin(M);for(let w=0;w<=S;w++){let L=Math.PI*2*w/S,I=E*Math.cos(L),O=E*Math.sin(L);e.push(T[0]+B[0]*I,T[1]+B[1]*R,T[2]+B[2]*O);let j=I/B[0],U=R/B[1],N=O/B[2],F=Math.hypot(j,U,N)||1;j/=F,U/=F,N/=F,t.push(j,U,N),n.push(ae.head)}}for(let V=0;V<C;V++)for(let M=0;M<S;M++){let R=z+V*(S+1)+M,E=R+S+1;r.push(R,E,R+1,R+1,E,E+1)}let D=new Float32Array(e),k=new Float32Array(t),A=new Float32Array(n),_=new Uint16Array(r);return{position:D,normal:k,part:A,index:_,vertexCount:n.length,indexCount:r.length}}function hr(e,t,n,r){let o=new Float32Array(t),i=u=>e[u*3],a=u=>e[u*3+2],s=0,c=(u,d)=>{let p=d-u;for(let m=u;m<d;m++){let[l,f]=r(m),h=l-i(m),y=f-a(m);if(p>=2){let b=Math.max(u,m-1),x=Math.min(d-1,m+1),g=i(x)-i(b),v=a(x)-a(b),P=Math.hypot(g,v);if(P>1e-6){let S=-v/P,C=g/P;S*h+C*y<0&&(S=-S,C=-C),h=S,y=C}}o[m]=h===0&&y===0?0:Math.atan2(h,y)}};for(let u=1;u<=t;u++)(u===t||n(u)!==n(s))&&(c(s,u),s=u);return o}var De=.22;function br(e,t){let n=fe[e];if(n!=="sold"&&n!=="held")return-1;let r=(t+1)*2654435761;return r^=r>>>15,r=Math.imul(r,2246822519),r^=r>>>13,(r>>>0)%1e5/1e5}var nc=.42;function oc(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let r=1/0,o=1/0,i=-1/0,a=-1/0;for(let f of e)f.x<r&&(r=f.x),f.y<o&&(o=f.y),f.x>i&&(i=f.x),f.y>a&&(a=f.y);let s=Math.max(i-r,1e-6),c=Math.max(a-o,1e-6),u=Math.max(Math.sqrt(s*c/t),1e-6),d=Math.max(1,Math.ceil(s/u)+1),p=Math.max(1,Math.ceil(c/u)+1),m=new Map,l=(f,h)=>{let y=Math.min(d-1,Math.max(0,Math.floor((f-r)/u)));return Math.min(p-1,Math.max(0,Math.floor((h-o)/u)))*d+y};for(let f=0;f<t;f++){let h=l(e[f].x,e[f].y),y=m.get(h);y?y.push(f):m.set(h,[f])}for(let f=0;f<t;f++){let h=e[f],y=Math.min(d-1,Math.max(0,Math.floor((h.x-r)/u))),b=Math.min(p-1,Math.max(0,Math.floor((h.y-o)/u))),x=1/0;for(let g=1;g<=4;g++){for(let v=b-g;v<=b+g;v++)if(!(v<0||v>=p))for(let P=y-g;P<=y+g;P++){if(P<0||P>=d||g>1&&Math.abs(v-b)<g&&Math.abs(P-y)<g)continue;let S=m.get(v*d+P);if(S)for(let C of S){if(C===f)continue;let T=Math.hypot(e[C].x-h.x,e[C].y-h.y);T<x&&(x=T)}}if(Number.isFinite(x)&&x<=g*u)break}n[f]=x}return n}function rc(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-Ee):0}function yr(e,t,n,r,o,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),u=new Float32Array(a*3),d=new Float32Array(a),p=new Float32Array(a),m=new Float32Array(a),l=new Float32Array(a),f=new Float32Array(a*3),h=new Map,y=oc(e);for(let b=0;b<a;b++){let x=e[b],v=(n?.seatPitchU(b)??y[b])*G;d[b]=Number.isFinite(v)?Math.max(.06,Math.min(De,v*nc)):De,p[b]=ur(Number.isFinite(v)?v:void 0);let P=or(x.glyph,{seatGlyph:i?.get(x.categoryKey)});m[b]=nr.indexOf(P),l[b]=x.wheelchairSpaceType==="no-seat"?0:1,s[b*3]=x.x*G,s[b*3+1]=n?n.seatDeckY(b):rc(x),s[b*3+2]=x.y*G,c[b]=Rt(t?t(x):"available");let S=ne(o?.get(x.categoryKey)??"#6e7bff")??[.43,.48,1];if(u[b*3]=S[0],u[b*3+1]=S[1],u[b*3+2]=S[2],x.accessibility?.length){let C=ne(Jo(x.accessibility));C&&(f[b*3]=C[0],f[b*3+1]=C[1],f[b*3+2]=C[2])}h.set(x.id,b)}return{count:a,iPosition:s,iState:c,iCategory:u,iMaxRadius:d,iRing:f,idToIndex:h,iChairWidth:p,iGlyph:m,iPhysicalSeat:l,iFloor:r??new Float32Array(a),iYaw:new Float32Array(a)}}var ic=64;function $n(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=Rt(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let r=[],o=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+ic){i=s;continue}r.push({start:o,length:i-o+1}),o=s,i=s}}return r.push({start:o,length:i-o+1}),r}var ac=.15,sc=1.6;function gr(e){return Yo(e??1,ac,sc)}var cc=.15,lc=.9,uc=1.76;function dc(){return{background:{top:[...Je.top],bottom:[...Je.bottom]},structure:Gn,seatStates:{...Go},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function xr(e){let t=dc();if(!e)return t;let n=ne(e.background);if(n){t.background={top:Me(n,lc),bottom:Me(n,uc)};let a={};for(let[s,c]of Object.entries(Gn))a[s]=ge(c,n,cc);t.structure=a}let r=ne(e.selectionColor)??ne(e.accent);r&&(t.seatStates={...t.seatStates,selected:r});let o=e.seatScale;typeof o=="number"&&Number.isFinite(o)&&(t.seatScale=gr(o));let i=e.venue3d;if(i){let a=ne(i.deck),s=ne(i.fascia);a&&(t.structure={...t.structure,tierTop:a,gaTop:a}),s&&(t.structure={...t.structure,tierWall:s,gaWall:s}),t.materials.seat=ne(i.seat),t.materials.shell=ne(i.shell),typeof i.roughness=="number"&&Number.isFinite(i.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,i.roughness)))}return t}function vr(e,t){let n=[];for(let r of t)n.push(...e.seatStates[r]);return n}function Sr(e,t){let n=1-t,r=n*n*n,o=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:r*e.start.x+o*e.control1.x+i*e.control2.x+a*e.end.x,y:r*e.start.y+o*e.control1.y+i*e.control2.y+a*e.end.y}}function Mr(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[Sr(e,.5)];let r=Array.from({length:n+1},(c,u)=>Sr(e,u/n)),o=new Float64Array(r.length);for(let c=1;c<r.length;c+=1){let u=r[c].x-r[c-1].x,d=r[c].y-r[c-1].y;o[c]=o[c-1]+Math.hypot(u,d)}let i=o[o.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 u=i*c/(t-1);for(;s<o.length-1&&o[s]<u;)s+=1;let d=o[s-1],p=o[s],m=p===d?0:(u-d)/(p-d);a.push({x:r[s-1].x+(r[s].x-r[s-1].x)*m,y:r[s-1].y+(r[s].y-r[s-1].y)*m})}return a}function wr(e){let t=new Map,n=new Map;for(let r of e){if(r.type!=="row"||!r.segmentedRow)continue;let o=n.get(r.segmentedRow.groupId)??[];o.push(r),n.set(r.segmentedRow.groupId,o)}for(let[r,o]of n){let i=o.slice().sort((m,l)=>m.segmentedRow.componentIndex-l.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((m,l)=>m.segmentedRow?.kind==="segmented-row-v1"&&m.segmentedRow.groupId===r&&m.segmentedRow.componentCount===a&&m.segmentedRow.componentIndex===l&&m.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(l===0?m.segmentedRow.boundaryBefore==="start":m.segmentedRow.boundaryBefore!=="start")&&m.segmentedRow.displayLabel===s.displayLabel)))continue;let u=i.reduce((m,l)=>m+l.seatCount,0),d=0,p=0;for(let m of i)m.segmentedRow.boundaryBefore==="break"&&(d+=1),t.set(m.id,{groupId:r,adjacencyOffset:d,displayOffset:p,displayLabel:s.displayLabel,totalSeats:u,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),d+=m.seatCount,p+=m.seatCount}return t}var mc="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var fc="abcdefghijklmnopqrstuvwxyz";function pc(e,t){let n=t.length,r=e+1,o="";for(;r>0;){r-=1;let i=r%n;o=t[i]+o,r=Math.floor(r/n)}return o}function Jn(e,t=!1){let n=t?fc:mc;return pc(Math.max(0,Math.floor(e)-1),n)}var hc=[[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 Pr(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[r,o]of hc)for(;t>=r;)n+=o,t-=r;return n}function bc(e){let t=new Array(e);return Array.from({length:e},(n,r)=>r).sort((n,r)=>Math.abs(2*n-(e-1))-Math.abs(2*r-(e-1))||n-r).forEach((n,r)=>t[n]=r),t}function eo(e,t){let n=e.seatLabelStart??1,r=e.seatNumbering?.direction??"ltr",o=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 l=Math.ceil(c/2),f=i==="updown"?t<l?n+2*t:n-1+2*(c-t):t<l?n+2*(l-1-t):n+1+2*(t-l);return`${a}${f}`}let u=i==="odd"||i==="even"?2:o,d=s!=null&&Number.isFinite(s)?s-(c-1)*u:n,p=r==="center"?bc(c)[t]:r==="rtl"?c-1-t:t,m;switch(i){case"odd":{let l=d%2===1?d:d+1;m=String(l+p*2);break}case"even":{let l=d%2===0?d:d+1;m=String(l+p*2);break}case"roman":m=Pr(d+p*o);break;case"letters-upper":m=Jn(d+p*o,!1);break;case"letters-lower":m=Jn(d+p*o,!0);break;default:m=String(d+p*o);break}return`${a}${m}`}function yc(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Cr(e,t,n){return n?.label??`${e.label}-${eo(e,t)}`}function to(e,t,n,r){if(r?.displayLabel)return r.displayLabel;if(!n)return`${e.displayLabel||e.label}-${eo(e,t)}`;let o=yc(n),i=n.displayOffset+t;return`${n.displayLabel}-${eo(o,i)}`}function Ar(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 pt(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 r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],s=a.x-i.x,c=a.y-i.y,u=s*s+c*c,d=u>1e-12?((t-i.x)*s+(n-i.y)*c)/u:0;d<0?d=0:d>1&&(d=1);let p=Math.hypot(t-(i.x+d*s),n-(i.y+d*c));p<r&&(r=p)}return r}function gc(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let r=e.length||1;t/=r,n/=r;let o=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>o&&(o=a)}return{cx:t,cy:n,r:o}}function Rr(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function no(e,t){let n=1/0;for(let r of Ar(e)){let o=pt(t,r.x,r.y);o<n&&(n=o)}for(let r of Ar(t)){let o=pt(e,r.x,r.y);o<n&&(n=o)}return n}function xc(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,r=0;for(let d of e)n+=d.x,r+=d.y;n/=e.length,r/=e.length;let o=-1,i=e[0];for(let d of e){let p=Math.hypot(d.x-n,d.y-r);p>o&&(o=p,i=d)}let a=i.x-n,s=i.y-r,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let u=e.map((d,p)=>({p:d,i:p,t:(d.x-n)*a+(d.y-r)*s})).sort((d,p)=>d.t-p.t);return{pts:u.map(d=>d.p),seatIndices:u.map(d=>t[d.i])}}function oo(e){let t=e.length;if(t<3)return null;let n=0,r=0;for(let x of e)n+=x.x,r+=x.y;n/=t,r/=t;let o=0,i=0,a=0,s=0,c=0,u=0,d=0;for(let x of e){let g=x.x-n,v=x.y-r;o+=g*g,a+=v*v,i+=g*v,s+=g*g*g,c+=v*v*v,u+=g*v*v,d+=v*g*g}let p=o*a-i*i;if(Math.abs(p)<1e-9)return null;let m=(s+u)/2,l=(c+d)/2,f=(m*a-l*i)/p,h=(l*o-m*i)/p,y=f+n,b=h+r;return!Number.isFinite(y)||!Number.isFinite(b)?null:{cx:y,cy:b}}var vc=.15;function Sc(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,v=0;for(let P of x.pts)g+=P.x,v+=P.y;return{x:g/x.pts.length,y:v/x.pts.length}}),n=0,r=0;for(let x of t)n+=x.x,r+=x.y;n/=t.length,r/=t.length;let o=0,i=0,a=0;for(let x of t){let g=x.x-n,v=x.y-r;o+=g*g,i+=g*v,a+=v*v}let s=o+a,c=o*a-i*i,u=s/2+Math.sqrt(Math.max(0,s*s/4-c)),d,p;Math.abs(i)>1e-12?(d=u-a,p=i):o>=a?(d=1,p=0):(d=0,p=1);let m=Math.hypot(d,p);if(!(m>1e-12))return null;d/=m,p/=m;let l=1/0,f=-1/0,h=[];for(let x of e){let g=1/0,v=-1/0;for(let P of x.pts){let S=P.x*d+P.y*p;S<g&&(g=S),S>v&&(v=S),S<l&&(l=S),S>f&&(f=S)}h.push(v-g)}let y=f-l;return y>1e-9?(h.sort((x,g)=>x-g),h[Math.min(h.length-1,Math.floor(h.length*.9))]/y<=Mc?{x:d,y:p}:null):null}var Mc=.35;function sn(e,t,n,r){let o=new Map;for(let y of n){let b=t[y],x=b.rowId||`__seat-${y}`,g=o.get(x);g||(g={pts:[],idx:[]},o.set(x,g)),g.pts.push({x:b.x,y:b.y}),g.idx.push(y)}if(!o.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[y,b]of o){let x=xc(b.pts,b.idx),g=0;for(let v of x.pts)g+=Math.hypot(v.x-r.x,v.y-r.y);i.push({id:y,pts:x.pts,seatIndices:x.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:g/x.pts.length})}let a=i.map(y=>gc(y.pts)),s=[];for(let y=0;y<i.length;y++){let b=1/0;for(let x=0;x<i.length;x++){if(y===x||Rr(a[y],a[x])>=b)continue;let g=no(i[y].pts,i[x].pts);g<b&&(b=g)}Number.isFinite(b)&&s.push(b)}s.sort((y,b)=>y-b);let c=s.length?s[Math.floor(s.length/2)]:1,u=Math.max(c*1.8,1e-6),d=i.map(()=>[]);for(let y=0;y<i.length;y++)for(let b=y+1;b<i.length;b++)Rr(a[y],a[b])>u||no(i[y].pts,i[b].pts)<=u&&(d[y].push(b),d[b].push(y));let p=0;for(let y=0;y<i.length;y++){if(i[y].blockId!==-1)continue;let b=p++,x=[y];for(i[y].blockId=b;x.length;){let g=x.pop();for(let v of d[g])i[v].blockId===-1&&(i[v].blockId=b,x.push(v))}}let m=new Map;for(let y of i){let b=m.get(y.blockId)??[];b.push(y),m.set(y.blockId,b)}let l=[];for(let y of i){if(y.pts.length<4)continue;let b=oo(y.pts);b&&(!Number.isFinite(b.cx)||!Number.isFinite(b.cy)||l.push({x:b.cx,y:b.cy}))}let f=l.length>=2?(()=>{let y=l.map(g=>g.x).sort((g,v)=>g-v),b=l.map(g=>g.y).sort((g,v)=>g-v),x=Math.floor(l.length/2);return{cx:y[x],cy:b[x]}})():null;if(f){let y=S=>Math.hypot(S.x-f.cx,S.y-f.cy),b=1/0,x=-1/0,g=[];for(let S of i){let C=1/0,T=-1/0;for(let B of S.pts){let z=y(B);z<C&&(C=z),z>T&&(T=z)}g.push(T-C),C<b&&(b=C),T>x&&(x=T)}let v=x-b;g.sort((S,C)=>S-C);let P=g[Math.min(g.length-1,Math.floor(g.length*.9))];if(v>1e-9&&P/v<=vc){let S=i.map(M=>{let R=0;for(let E of M.pts)R+=y(E);return{row:M,radius:R/M.pts.length}}),C=0,T=0;for(let M of S)C+=M.radius,T+=M.row.focalDistance;C/=S.length,T/=S.length;let B=0;for(let M of S)B+=(M.radius-C)*(M.row.focalDistance-T);if(B<0)for(let M of S)M.radius=-M.radius;let D=1/0;for(let M of S)M.radius<D&&(D=M.radius);S.sort((M,R)=>M.radius-R.radius);let k=-1,A=-1/0,_=v/Math.max(1,S.length)*.5,V=[];for(let M of S)M.radius-A>_&&(k++,A=M.radius),M.row.ordinal=k,M.row.blockDepth=M.radius-D,V.push(M.row);return{sectionId:e,rows:V,blockCount:p}}}let h=[];for(let[,y]of m){let b=Sc(y);if(b){let x=v=>{let P=0;for(let S of v.pts)P+=S.x*b.x+S.y*b.y;return P/v.pts.length};y.sort((v,P)=>x(v)-x(P)),y.length>=2&&y[0].focalDistance>y[y.length-1].focalDistance&&y.reverse();let g=0;for(let v=0;v<y.length;v++)v>0&&(g+=no(y[v-1].pts,y[v].pts)),y[v].ordinal=v,y[v].blockDepth=g,h.push(y[v])}else{let x=1/0;for(let g of y)g.focalDistance<x&&(x=g.focalDistance);y.sort((g,v)=>g.focalDistance-v.focalDistance);for(let g=0;g<y.length;g++)y[g].ordinal=g,y[g].blockDepth=Math.max(0,y[g].focalDistance-x),h.push(y[g])}}return{sectionId:e,rows:h,blockCount:p}}var wc=/^\d{4}-\d{2}-\d{2}$/;function Pc(e){let t=Date.parse(e);return Number.isFinite(t)?wc.test(e)?t+864e5:t:null}function Cc(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let r=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(r)&&(t instanceof Date?t.getTime():t)<=r+366*864e5}let n=Pc(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Ac(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Rc(e){return e.status!=="draft"&&e.status!=="retracted"}function Ic(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 Ir(e,t={}){return!!e&&Rc(e)&&Ac(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Ic(e,t.activeBasisSha256)&&Cc(e,t.now)}var Gm=Math.PI*2;function cn(e){return e==="pitch-football"||e==="rink-hockey"||e==="track-athletics"||e==="oval-cricket"}var Ec=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Tc=/[\s"'<>`\\]/;function _c(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Ec.test(e);if(Tc.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Er(e){let t=e.trim();return _c(t)?t:null}var ro="seatlayer.event-configuration/1";var ht=100,kc=120,Lc=1e5,Fc=1e4,Dc=/^[a-f0-9]{64}$/,Oc=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function Ft(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function nt(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Vc(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function Tr(e){return!Array.isArray(e)||e.length>Lc||!e.every(t=>nt(t,ht))?null:[...new Set(e)].sort()}function Bc(e){return!Ft(e)||!nt(e.chartId,ht)||!nt(e.version,ht)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Dc.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function io(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Nc(e){return Ft(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&io(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function Gc(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Fc)return null;let n=new Set(t),r=new Set,o=new Set,i=0,a=[];for(let s of e){if(!Ft(s)||!nt(s.id,ht)||!nt(s.objectId,ht)||!n.has(s.objectId)||!Oc.has(String(s.kind))||!io(s.heightM,.05,50)||s.baseElevationM!==void 0&&!io(s.baseElevationM,-10,100))return null;let c=Nc(s.occlusion);if(!c||r.has(s.id)||o.has(s.objectId))return null;let u=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?Er(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!u||s.kind!=="screen"||++i>1))return null;r.add(s.id),o.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,...u?{contentImageUrl:u}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function zc(e){let t=[];if(!Ft(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==ro&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${ro}`}),nt(e.id,ht)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),nt(e.label,kc)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Vc(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Bc(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 r=Ft(e.overlay)?e.overlay:null,o=Tr(r?.objectIds),i=Tr(r?.productionKillSeatIds),a=o?Gc(r?.productionElements,o):null;return(!r||!o||!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||!o||!i||a===null?{issues:t}:{issues:t,value:{schema:ro,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:o,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function _r(e){let t=zc(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function Hc(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,r=e.width,o=e.height;return[{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+o},{x:t,y:n+o}]}function Uc(e,t,n){let r=n*Math.PI/180,o=Math.cos(r),i=Math.sin(r),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*o-s*i,y:t.y+a*i+s*o}}function kr(e){let t=Hc(e);if(!t||t.length<2)return null;let n=e.rotation??0,r=Math.abs(n)<1e-6?t:t.map(c=>Uc(c,{x:t.reduce((u,d)=>u+d.x,0)/t.length,y:t.reduce((u,d)=>u+d.y,0)/t.length},n)),o=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of r)o=Math.min(o,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(o)||a-o<1e-6||s-i<1e-6?null:{minX:o,minY:i,maxX:a,maxY:s}}var jc=5,Yc=3,Xc=.92,Wc=1.9,Kc=2,qc=.6,Qc=1,Zc=.06;function $c(e){return e.heightM!==void 0?e.heightM:cn(e.stageKind)?Zc:Qc}function Lr(e){let t=1/0,n=1/0,r=-1/0,o=-1/0,i=-1/0;for(let a of Or(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let u=kr(c);u&&(t=Math.min(t,u.minX),n=Math.min(n,u.minY),r=Math.max(r,u.maxX),o=Math.max(o,u.maxY),i=Math.max(i,s+$c(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:r,maxY:o,deckTopM:i}}function Jc(e,t,n,r){let o=1/0,i=1/0,a=-1/0,s=-1/0;for(let l of e)Number.isFinite(l.eyeHeightM)&&(o=Math.min(o,l.x),a=Math.max(a,l.x),i=Math.min(i,l.y),s=Math.max(s,l.y));if(!Number.isFinite(o))return null;let c=o*t,u=i*t,d=Math.max(1,Math.ceil((a-o)*t/n)+1),p=Math.max(1,Math.ceil((s-i)*t/n)+1),m=new Float64Array(d*p).fill(-1/0);for(let l of e){if(!Number.isFinite(l.eyeHeightM))continue;let f=l.eyeHeightM-Ee,h=Math.min(d-1,Math.max(0,Math.floor((l.x*t-c)/n))),b=Math.min(p-1,Math.max(0,Math.floor((l.y*t-u)/n)))*d+h,x=f+r;x>m[b]&&(m[b]=x)}return{cellM:n,minX:c,minY:u,cols:d,rows:p,top:m}}function el(e,t,n){let r=Math.floor((t-e.minX)/e.cellM),o=Math.floor((n-e.minY)/e.cellM);return r<0||o<0||r>=e.cols||o>=e.rows?-1/0:e.top[o*e.cols+r]}function Fr(e,t,n={}){let r=new Map;if(!t||!e.length)return r;let o=n.metresPerChartUnit??he,i=n.cellM??qc,a=n.chairBackM??Xc,s=n.selfRowSkipM??Kc,c=n.clearThreshold??.9,u=n.partialThreshold??.25,d=Math.max(1,n.columns??jc),p=Math.max(1,n.rows??Yc),m=Jc(e,o,i,a);if(!m)return r;let l=(t.maxX-t.minX)*o,f=(t.maxY-t.minY)*o,h=l>=f,y=(t.minX+t.maxX)/2*o,b=(t.minY+t.maxY)/2*o,x=[];for(let v=0;v<d;v++){let P=(v+.5)/d-.5,S=h?y+P*l:y,C=h?b:b+P*f;for(let T=0;T<p;T++){let B=t.deckTopM+(p===1?0:T/(p-1)*Wc);x.push({x:S,y:C,z:B})}}let g=i/2;for(let v of e){if(!Number.isFinite(v.eyeHeightM))continue;let P=v.x*o,S=v.y*o,C=v.eyeHeightM,T=0,B=1/0;for(let D of x){let k=D.x-P,A=D.y-S,_=Math.hypot(k,A);if(!(_>s)){T++;continue}let V=k/_,M=A/_,R=0;for(let E=s;E<_;E+=g){let w=el(m,P+V*E,S+M*E);if(!(!Number.isFinite(w)||w>=C)&&w>C+(D.z-C)*E/_){R=E;break}}R?B=Math.min(B,R):T++}let z=T/x.length;z>=c||r.set(v.id,{seatId:v.id,mark:z<u?"obstructedView":"restrictedView",visibleFraction:z,totalRays:x.length,atDistanceM:Number.isFinite(B)?B:0})}return r}function Dr(e,t){if(!t.size)return 0;let n=0;for(let r of e){let o=t.get(r.id);if(!o)continue;let i=r.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(r.commercial={...i,[o.mark]:!0},n++)}return n}function ao(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var ln=Math.PI/180;var Dt=16;function co(e,t,n,r){let o=n*ln,i=Math.cos(o),a=Math.sin(o);return{x:r.x+e*i-t*a,y:r.y+e*a+t*i}}function tl(e){let{seatCount:t,seatSpacing:n,curve:r,rotation:o,origin:i}=e,a=[];if(e.path)return Mr(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(r===0){for(let u=0;u<t;u++)a.push(co(u*n,0,o,i));return a}let s=r/(t-1)*ln,c=n/(2*Math.sin(Math.abs(s)/2));for(let u=0;u<t;u++){let d=u*s,p=c*Math.sin(d),m=-c+c*Math.cos(d);a.push(co(p,m,o,i))}return a}function nl(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function ol(e,t){let n=nl(e);return tl(e).map((r,o)=>{let i=n.get(o),a=ao(i),s=Cr(e,o,i),c={...e.commercial,...i?.commercial};return{index:o,x:r.x+(i?.dx??0),y:r.y+(i?.dy??0),label:s,displayLabel:to(e,o,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(u=>u!==void 0&&u!==!1&&u!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle}})}function zr(e){let t=[];for(let n of ol(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 rl(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)),r={top:0,bottom:0,left:0,right:0};if(!n.length)return r;let o=Math.max(0,Math.round(e.seatCount));for(let i=0;i<o;i++)r[n[i%n.length]]+=1;return r}function il(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let r=new Map((e.overrides??[]).map(d=>[d.index,d])),o=(d,p,m,l)=>{let f=r.get(d),h=ao(f),y=f?.label??`${e.label}-${d+1}`,b=e.displayLabel??e.label;return{index:d,label:y,displayLabel:f?.displayLabel??`${b}-${d+1}`,x:p+(f?.dx??0),y:m+(f?.dy??0),categoryKey:f?.categoryKey??e.categoryKey,skipped:!!f?.skip,accessible:h.length>0,accessibility:h,wheelchairSpaceType:f?.wheelchairSpaceType,commercial:f?.commercial,glyph:f?.glyph,viewUrl:f?.viewFromSeatUrl,viewMeta:f?.viewFromSeatUrl?f.viewFromSeatMeta:void 0,labelStyle:f?.labelStyle,...l?{side:l}:{}}};if(e.shape==="round"){let d=(e.radius??40)+Dt,p=e.rotation*ln,m=Math.max(0,Math.min(360,e.seatArc??360));if(m>=360||n===1){for(let y=0;y<n;y++){let b=p+y/n*2*Math.PI;t.push(o(y,e.center.x+d*Math.cos(b),e.center.y+d*Math.sin(b)))}return t}let l=m*ln,f=(2*Math.PI-l)/2,h=p+f;for(let y=0;y<n;y++){let b=h+y/(n-1)*l;t.push(o(y,e.center.x+d*Math.cos(b),e.center.y+d*Math.sin(b)))}return t}let i=e.width??80,a=e.height??50,s=rl(e),c=["top","bottom","left","right"],u=0;for(let d of c){let p=s[d];for(let m=0;m<p;m++){let l,f;d==="top"?(l=-i/2+(m+.5)*i/p,f=-a/2-Dt):d==="bottom"?(l=-i/2+(m+.5)*i/p,f=a/2+Dt):d==="left"?(l=-i/2-Dt,f=-a/2+(m+.5)*a/p):(l=i/2+Dt,f=-a/2+(m+.5)*a/p);let h=co(l,f,e.rotation,e.center);t.push(o(u++,h.x,h.y,d))}}return t}function al(e){return il(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 sl(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"}]}function Vr(e,t){let n=!1;for(let r=0,o=t.length-1;r<t.length;o=r++){let i=t[r].x,a=t[r].y,s=t[o].x,c=t[o].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function cl(e,t){return t.some((n,r)=>{let o=t[(r+1)%t.length],i=(e.y-n.y)*(o.x-n.x)-(e.x-n.x)*(o.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(o.x-n.x)+(e.y-n.y)*(o.y-n.y),s=(o.x-n.x)**2+(o.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function ot(e,t,n){return Vr(e,t)&&!(n??[]).some(r=>Vr(e,r)||cl(e,r))}function so(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;return{x:t/e.length,y:n/e.length}}function ll(e){switch(e.type){case"row":{let t=zr(e);if(!t.length)return{x:e.origin.x,y:e.origin.y};let n=0,r=0;for(let o of t)n+=o.x,r+=o.y;return{x:n/t.length,y:r/t.length}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return so(e.points);case"section":return so(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?so(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 Br(e,t){return e.length===t.length&&e.every((n,r)=>n.x===t[r].x&&n.y===t[r].y)}function ul(e,t){if(e.type!=="gaArea"||!Br(e.points,t.outline))return!1;let n=e.holes??[],r=t.holes??[];return n.length===r.length&&n.every((o,i)=>Br(o,r[i]))}function dl(e,t){let n=e.filter(a=>a.type==="section"),r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0,o=ll(t);return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(ul(t,a)||ot(o,a.outline,a.holes))):void 0)??n.find(a=>ot(o,a.outline,a.holes))}function Or(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 Nr(e,t,n,r,o,i,a,s,c){let u=[],d=wr(e),p=f=>!f?.eventConfigurationId||f.eventConfigurationId===r&&(f.eventConfigurationVersion===void 0||f.eventConfigurationVersion===c),m=f=>Ir(f,{activeConfigurationId:r,activeConfigurationVersion:c,activeBasisSha256:o,now:s}),l=(f,h)=>m(f)?{...f,coverage:h}:void 0;for(let f of e){let h=[];if(f.type==="row"?h=zr(f):f.type==="table"?h=al(f):f.type==="booth"&&(h=sl(f)),!h.length)continue;for(let v of h)v.viewUrl&&!p(v.viewMeta)&&(v.viewUrl=void 0,v.viewMeta=void 0);if(f.type==="row"){let v=d.get(f.id);if(v){let P=new Map((f.overrides??[]).map(S=>[S.index,S]));for(let S of h){let C=Number(S.id.slice(S.id.lastIndexOf(":")+1));if(!Number.isInteger(C))continue;S.logicalRowId=v.groupId,S.logicalSeatIndex=v.adjacencyOffset+C,P.get(C)?.displayLabel||(S.displayLabel=to(f,C,v)),!S.viewUrl&&v.viewFromSeatUrl&&p(v.viewFromSeatMeta)&&(S.viewUrl=v.viewFromSeatUrl,S.viewMeta=v.viewFromSeatMeta);let T=P.get(C)?.confidenceEvidence;S.confidenceEvidence=l(T,"exact-seat")??l(f.confidenceEvidence,"row-representative")??l(v.confidenceEvidence,"row-representative")}}}let y=dl(e,f),b=y?.viewFromSeatUrl,g=(y?.zone?t?.find(v=>v.id===y.zone):void 0)?.focalPoint??n;for(let v of h){if(!v.confidenceEvidence){let P=Number(v.id.slice(v.id.lastIndexOf(":")+1)),S=(f.type==="row"||f.type==="table")&&Number.isInteger(P)?f.overrides?.find(C=>C.index===P)?.confidenceEvidence:void 0;v.confidenceEvidence=l(S,"exact-seat")??(f.type==="row"?l(f.confidenceEvidence,"row-representative"):void 0)}v.confidenceEvidence??=l(y?.confidenceEvidence,"section-representative")??(a?l(a.evidence,a.coverage):void 0),!v.viewUrl&&b&&p(y?.viewFromSeatMeta)&&(v.viewUrl=b,v.viewMeta=y?.viewFromSeatMeta),!v.viewUrl&&i&&p(i.meta)&&(v.viewUrl=i.url,v.viewMeta=i.meta),y&&(v.sectionId=y.logicalSectionId??y.id),y?.zone&&(v.zoneId=y.zone),g&&(v.focalPoint={...g})}u.push(...h)}return u}function Hr(e,t={}){if(e.floors?.length){let r=[];for(let o of e.floors){let i=o.focalPoint??e.focalPoint,a=o.viewFromSeatUrl?{url:o.viewFromSeatUrl,meta:o.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=o.confidenceEvidence?{evidence:o.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=Nr(o.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Gr(o.objects,o.focalPoint??e.focalPoint,o.baseHeightM??0,c);for(let u of c)u.floorId=o.id;r.push(...c)}return r}let n=Nr(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&&Gr(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),ml(e,n,t)}function ml(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Dr(t,Fr(t,Lr(e))),t}function Gr(e,t,n,r){let o=e.filter(d=>d.type==="section"),i=n>0||o.some(d=>d.height!==void 0||d.rake!==void 0||(d.elevation??0)>0);if(!o.length||!i||!t){for(let d of r)d.eyeHeightM=n+Ee;return}let a=new Array(r.length),s=new Map,c=new Map;for(let d=0;d<r.length;d++){let p=r[d],l=(p.sectionId?o.find(h=>h.id===p.sectionId)??o.find(h=>h.logicalSectionId===p.sectionId&&ot({x:p.x,y:p.y},h.outline,h.holes)):void 0)??o.find(h=>ot({x:p.x,y:p.y},h.outline,h.holes))??null;if(a[d]=l,!l)continue;s.has(l.id)||s.set(l.id,Jt(l,{floorBaseHeightM:n}));let f=c.get(l.id);f?f.push(d):c.set(l.id,[d])}let u=new Array(r.length).fill(void 0);for(let[d,p]of c){let m=s.get(d);if(!m)continue;let l=m.rake>0?Math.tan(m.rake*Math.PI/180):0,f=sn(d,r,p,t);for(let h of f.rows){let y=h.blockDepth*he*l,b=m.height+y;for(let x of h.seatIndices)u[x]=b}}for(let d=0;d<r.length;d++){let p=r[d],m=a[d];if(!m){p.eyeHeightM=n+Ee;continue}let l=s.get(m.id);p.eyeHeightM=(u[d]??l.height)+Ee}}function fl(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let r=t-e.x,o=n-e.y,i=Math.hypot(r,o);return i<1e-9?[0,0]:[r/i,o/i]}}}function pl(e,t){if(!e.length)return null;let n=0,r=0,o=0;for(let l of e)n+=l.x,r+=l.y,o+=Math.hypot(l.x-t.x,l.y-t.y);let i=e.length;n/=i,r/=i,o/=i;let a=e[0],s=-1;for(let l of e){let f=Math.hypot(l.x-n,l.y-r);f>s&&(s=f,a=l)}let c=a.x-n,u=a.y-r,d=Math.hypot(c,u);d>1e-9?(c/=d,u/=d):(c=1,u=0);let p=[...e].sort((l,f)=>(l.x-n)*c+(l.y-r)*u-((f.x-n)*c+(f.y-r)*u)),m=0;for(let l of p){let f=Math.hypot(l.x-n,l.y-r);f>m&&(m=f)}return{pts:p,cx:n,cy:r,radius:m,depth:o}}function Ur(e,t,n){let r=e.pts;if(r.length===1)return Math.hypot(t-r[0].x,n-r[0].y);let o=1/0;for(let i=0;i+1<r.length;i++){let a=r[i],s=r[i+1],c=s.x-a.x,u=s.y-a.y,d=c*c+u*u,p=d>1e-12?((t-a.x)*c+(n-a.y)*u)/d:0;p<0?p=0:p>1&&(p=1);let m=Math.hypot(t-(a.x+p*c),n-(a.y+p*u));m<o&&(o=m)}return o}var un=8;function hl(e,t,n){let r=new Array(un).fill(1/0),o=new Array(un).fill(-1);for(let d=0;d<e.length;d++){let p=e[d],m=Math.hypot(t-p.cx,n-p.cy)-p.radius;for(let l=0;l<un;l++)if(m<r[l]){for(let f=un-1;f>l;f--)r[f]=r[f-1],o[f]=o[f-1];r[l]=m,o[l]=d;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let d of o){if(d<0)continue;let p=Ur(e[d],t,n);for(let m=0;m<3;m++)if(p<i[m]){for(let l=2;l>m;l--)i[l]=i[l-1],a[l]=a[l-1];i[m]=p,a[m]=d;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,u=0;for(let d=0;d<3;d++){let p=a[d];if(p<0||i[d]>s)continue;let m=1/(i[d]*i[d]);c+=m*e[p].depth,u+=m}return u>0?c/u:e[a[0]].depth}function bl(e){let t=(r,o)=>hl(e,r,o),n=(r,o)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(r-c.cx,o-c.cy)-c.radius>=i)continue;let u=Ur(c,r,o);u<i&&(i=u,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(r,o)=>{let i=(t(r+.5,o)-t(r-.5,o))/1,a=(t(r,o+.5)-t(r,o-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function jr(e,t){let n=[];for(let r of e){let o=pl(r.points,t);o&&n.push(o)}return n.length<2?fl(t):(n.sort((r,o)=>r.depth-o.depth),bl(n))}var mo=lt(require("polygon-clipping"),1);var Kr=lt(require("earcut"),1);var yl=.58,Yr=.01,we=De*1.5*Ue,gl=.5,xl=.6;function vl(e,t){let n=e.length,r=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],u=c.x-s.x,d=c.y-s.y,p=Math.hypot(u,d);if(p<1e-9){r.push([0,0]);continue}u/=p,d/=p,r.push([-d,u])}let o=0;for(let a=0;a<n;a++)o+=(e[a].x-t.x)*r[a][0]+(e[a].y-t.y)*r[a][1];return o<0?r.map(([a,s])=>[-a,-s]):r}function Sl(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],r=(a,s)=>{let c=s.x-a.x,u=s.y-a.y,d=Math.hypot(c,u)||1;return{x:c/d,y:u/d}},o=r(n[1],n[0]),i=r(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+o.x*t,y:n[0].y+o.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var Xr=Math.PI/12;function Ml(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),r=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},o=[...r(t),...r([...t].reverse())];return o.length>=3?o:[...e]}function qr(e,t){if(!e.length||!(t>0))return[];let n=Ml(e),r=(s,c,u,d)=>{let p=u-c;for(;p<0;)p+=Math.PI*2;for(;p>Math.PI*2;)p-=Math.PI*2;let m=Math.max(1,Math.ceil(p/Xr)),l=t/Math.cos(p/m/2);for(let f=0;f<=m;f++){let h=c+p*f/m;d.push({x:s.x+Math.cos(h)*l,y:s.y+Math.sin(h)*l})}};if(n.length<3){let s=0,c=0;for(let l of n)s+=l.x,c+=l.y;s/=n.length||1,c/=n.length||1;let u=0;for(let l of n)u=Math.max(u,Math.hypot(l.x-s,l.y-c));let d=[],p=Math.max(3,Math.ceil(Math.PI*2/Xr)),m=(u+t)/Math.cos(Math.PI/p);for(let l=0;l<p;l++){let f=l/p*Math.PI*2;d.push({x:s+Math.cos(f)*m,y:c+Math.sin(f)*m})}return d}let o=n.length,i=[];for(let s=0;s<o;s++){let c=n[s],u=n[(s+1)%o];i.push(Math.atan2(-(u.x-c.x),u.y-c.y))}let a=[];for(let s=0;s<o;s++)r(n[s],i[(s+o-1)%o],i[s],a);return ei(a)}function wl(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let r=1/0;for(let o=0;o+1<e.length;o++){let i=e[o],a=e[o+1],s=a.x-i.x,c=a.y-i.y,u=s*s+c*c,d=u>1e-12?((t-i.x)*s+(n-i.y)*c)/u:0;d<0?d=0:d>1&&(d=1);let p=Math.hypot(t-(i.x+d*s),n-(i.y+d*c));p<r&&(r=p)}return r}function dn(e){let t=e.map(o=>{let i=0,a=0;for(let u of o.pts)i+=u.x,a+=u.y;let s=o.pts.length||1;i/=s,a/=s;let c=0;for(let u of o.pts){let d=Math.hypot(u.x-i,u.y-a);d>c&&(c=d)}return{cx:i,cy:a,rad:c}}),n=o=>{let i=o.length;return i<=2?[...o]:[o[Math.floor(i*.25)],o[Math.floor(i*.5)],o[Math.floor(i*.75)]]},r=[];for(let o=0;o<e.length;o++){let i=n(e[o].pts),a=[],s=1/0,c=null;for(let d of i){let p=1/0;for(let m=0;m<e.length;m++){if(m===o||Math.abs(e[m].y-e[o].y)<.001)continue;let l=t[m],f=Math.hypot(d.x-l.cx,d.y-l.cy)-l.rad;if(f>=p&&f>=s)continue;let h=wl(e[m].pts,d.x,d.y);h<p&&(p=h),e[m].depth<e[o].depth&&h<s&&(s=h,c=e[m].y)}Number.isFinite(p)&&p>0&&a.push(p)}a.sort((d,p)=>d-p);let u=a.length?a[Math.floor(a.length/2)]:1;r.push({pitch:u,belowY:c})}return r}function Qr(e,t,n,r){let o=e[t],i=o.pts.length>=2?[...o.pts]:o.pts.length===1?(()=>{let d=o.pts[0],p=d.x-r.x,m=d.y-r.y,l=Math.hypot(p,m)||1;p/=l,m/=l;let f=Math.max(n[t].pitch,.001)*.5;return[{x:d.x+m*f,y:d.y-p*f},{x:d.x-m*f,y:d.y+p*f}]})():[];if(i.length<2)return null;let a=0,s=0;for(let d=1;d<i.length;d++){let p=Math.hypot(i[d].x-i[d-1].x,i[d].y-i[d-1].y);p>1e-6&&(a+=p,s++)}let c=s>0?a/s:0,u=Sl(i,Math.max(c*xl,we));return{pts:u,nrm:vl(u,r),front:Math.max(n[t].pitch*yl,we),back:Math.max(n[t].pitch*gl,we)}}var bt=1.5,Zr=.3;function lo(e,t){if(e.length<3)return e;let n=e[0],r=e[e.length-1],o=r.x-n.x,i=r.y-n.y,a=Math.hypot(o,i),s=-1,c=-1;for(let p=1;p<e.length-1;p++){let m=e[p],l=a>1e-12?Math.abs((m.x-n.x)*i-(m.y-n.y)*o)/a:Math.hypot(m.x-n.x,m.y-n.y);l>s&&(s=l,c=p)}if(s<=t||c<0)return[n,r];let u=lo(e.slice(0,c+1),t),d=lo(e.slice(c),t);return[...u.slice(0,-1),...d]}function $r(e,t){if(e.length<4)return e;let n=lo([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function Jr(e,t,n){if(e.length<2)return[];let r=n??dn(e),o=new Map;for(let a=0;a<e.length;a++){let s=o.get(e[a].blockId);s?s.push(a):o.set(e[a].blockId,[a])}let i=[];for(let[,a]of o){let s=[];for(let x of a){let g=e[x].patch;g&&g.length>=3?i.push({outline:[...g],holes:[],topY:e[x].y}):s.push(x)}if(!s.length)continue;s.sort((x,g)=>e[x].depth-e[g].depth);let u=s.map(x=>Qr(e,x,r,t)).filter(x=>x!==null);if(!u.length)continue;let d=(x,g)=>({x:x.pts[g].x-x.nrm[g][0]*(x.front+bt),y:x.pts[g].y-x.nrm[g][1]*(x.front+bt)}),p=(x,g)=>({x:x.pts[g].x+x.nrm[g][0]*(x.back+bt),y:x.pts[g].y+x.nrm[g][1]*(x.back+bt)}),m=u[0],l=u[u.length-1],f=[];for(let x=0;x<m.pts.length;x++)f.push(d(m,x));for(let x of u)f.push(p(x,x.pts.length-1));for(let x=l.pts.length-1;x>=0;x--)f.push(p(l,x));for(let x=u.length-1;x>=0;x--)f.push(d(u[x],0));let h=ei(f),y=1/0;for(let x of s)e[x].y<y&&(y=e[x].y);if(!Number.isFinite(y))continue;if(h.length>=3&&Math.abs(et(h))>1e-6&&u.every(x=>{let g=x.pts[Math.floor(x.pts.length/2)];return Tt(h,g.x,g.y)})){i.push({outline:$r(h,Zr),holes:[],topY:y});continue}for(let x of Pl(u))i.push({outline:x,holes:[],topY:y})}return i}function Pl(e){let t=[];for(let n of e){let r=[],o=[],i=n.front+bt,a=n.back+bt;for(let c=0;c<n.pts.length;c++){let u=n.pts[c],d=n.nrm[c];r.push([u.x-d[0]*i,u.y-d[1]*i]),o.push([u.x+d[0]*a,u.y+d[1]*a])}let s=[...r,...o.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=mo.default.union(t[0],...t.slice(1)),r=[];for(let o of n){if(!o.length||o[0].length<4)continue;let i=o[0].map(([c,u])=>({x:c,y:u})),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&&r.push($r(i,Zr))}return r}catch{return[]}}function ei(e){let t=[];for(let n of e){let r=t[t.length-1];r&&Math.hypot(n.x-r.x,n.y-r.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 uo=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 r of n)r.x<this.minX&&(this.minX=r.x),r.y<this.minY&&(this.minY=r.y),r.x>this.maxX&&(this.maxX=r.x),r.y>this.maxY&&(this.maxY=r.y)}containsAll(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 r=!0;for(let o of t)if(!Tt(n,o.x,o.y)){r=!1;break}if(r)return!0}return!1}};function Wr(e,t,n,r,o,i){if(r.length<3)return;if(n.containsAll(r)){let u=[0,1,0],d=r[0];for(let p=1;p+1<r.length;p++){let m=r[p],l=r[p+1];e.tri([d.x*G,o,d.y*G],[m.x*G,o,m.y*G],[l.x*G,o,l.y*G],u,i)}return}let a=r.map(u=>[u.x,u.y]);a.push(a[0]);let s;try{s=mo.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let u of s){if(!u.length||u[0].length<4)continue;let d=u[0],p=[],m=[];for(let f=0;f<d.length-1;f++)p.push(d[f][0],d[f][1]),m.push([d[f][0],d[f][1]]);if(m.length<3)continue;let l=(0,Kr.default)(p,void 0,2);for(let f=0;f<l.length;f+=3){let h=m[l[f]],y=m[l[f+1]],b=m[l[f+2]];e.tri([h[0]*G,o,h[1]*G],[y[0]*G,o,y[1]*G],[b[0]*G,o,b[1]*G],c,i)}}}function ti(e,t,n,r,o,i,a){if(t.length<2)return;let s=a??dn(t),c=[0,1,0],u=i&&i.length>=3?[[...i.map(l=>[l.x,l.y]),[i[0].x,i[0].y]]]:null,d=i&&i.length>=3?new uo([[...i]]):null,p=l=>{e.setMaterial(2),l(),e.setMaterial(0)},m=l=>{e.setMaterial(3),l(),e.setMaterial(0)};for(let l=0;l<t.length;l++){let f=t[l];if(f.patch&&f.patch.length>=3){let P=[...f.patch],S=s[l].belowY??r;if(m(()=>{if(u&&d)Wr(e,u,d,P,f.y,o.tread);else{let C=P[0];for(let T=1;T+1<P.length;T++){let B=P[T],z=P[T+1];e.tri([C.x*G,f.y,C.y*G],[B.x*G,f.y,B.y*G],[z.x*G,f.y,z.y*G],c,o.tread)}}}),f.y>S+Yr){let C=0,T=0;for(let B of P)C+=B.x,T+=B.y;C/=P.length,T/=P.length,p(()=>{for(let B=0;B<P.length;B++){let z=P[B],D=P[(B+1)%P.length],k=D.x-z.x,A=D.y-z.y,_=Math.hypot(k,A);if(_<1e-6)continue;let V=A/_,M=-k/_;(z.x-C)*V+(z.y-T)*M<0&&(V=-V,M=-M);let R=[V,0,M],E=[z.x*G,f.y,z.y*G],w=[D.x*G,f.y,D.y*G],L=[z.x*G,S,z.y*G],I=[D.x*G,S,D.y*G];e.tri(E,w,I,R,o.riser),e.tri(E,I,L,R,o.riser)}})}continue}let h=Qr(t,l,s,n);if(!h)continue;let{pts:y,nrm:b,front:x,back:g}=h,v=s[l].belowY??r;for(let P=0;P+1<y.length;P++){let S=y[P],C=y[P+1],T=b[P],B=b[P+1];if(Math.hypot(C.x-S.x,C.y-S.y)<1e-6||T[0]===0&&T[1]===0||B[0]===0&&B[1]===0)continue;let z=[(S.x-T[0]*x)*G,f.y,(S.y-T[1]*x)*G],D=[(C.x-B[0]*x)*G,f.y,(C.y-B[1]*x)*G],k=[(S.x+T[0]*g)*G,f.y,(S.y+T[1]*g)*G],A=[(C.x+B[0]*g)*G,f.y,(C.y+B[1]*g)*G];if(m(()=>{u&&d?Wr(e,u,d,[{x:S.x-T[0]*x,y:S.y-T[1]*x},{x:C.x-B[0]*x,y:C.y-B[1]*x},{x:C.x+B[0]*g,y:C.y+B[1]*g},{x:S.x+T[0]*g,y:S.y+T[1]*g}],f.y,o.tread):(e.tri(z,D,A,c,o.tread),e.tri(z,A,k,c,o.tread))}),f.y>v+Yr){let _=[z[0],v,z[2]],V=[D[0],v,D[2]],M=[-T[0],0,-T[1]];p(()=>{e.tri(z,D,V,M,o.riser),e.tri(z,V,_,M,o.riser)})}}}}function ni(e){let t=1/0,n=1/0,r=-1/0,o=-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>r&&(r=a.x),a.y>o&&(o=a.y));return i?{minX:t,minY:n,maxX:r,maxY:o}:null}function mn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var fo=lt(require("polygon-clipping"),1);function Cl(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function oi(e,t){return e.filter(n=>n.type!=="shape"||Cl(n,t))}function ri(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((r,o)=>({objects:oi(r.objects,t),focal:{x:(r.focalPoint??n).x,y:(r.focalPoint??n).y},baseHeightM:r.baseHeightM??0,index:o})):[{objects:oi(e.objects,t),focal:n,baseHeightM:0,index:0}]}var Al={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function yt(e){return ni(e)??Al}function ii(e,t){let n=on(e.outline,we),r=yt(n),o=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&mn(r,yt(a.outline)));if(!o.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=fo.default.difference([i(n)],...o.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let u=c[0].map(([d,p])=>({x:d,y:p}));if(u.length>1){let d=u[0],p=u[u.length-1];Math.abs(d.x-p.x)<1e-9&&Math.abs(d.y-p.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s.length?s:[n]}catch{return[n]}}function ai(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},r=t.map(i=>[n(i)]),o=[];for(let i of e){let a;try{a=fo.default.intersection([n(i.outline)],r.flat())}catch{o.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([u,d])=>({x:u,y:d}));if(c.length>1){let u=c[0],d=c[c.length-1];Math.abs(u.x-d.x)<1e-9&&Math.abs(u.y-d.y)<1e-9&&c.pop()}c.length>=3&&o.push({outline:c,holes:[],topY:i.topY})}}return o.length?o:e}var Rl=.05,si=.05,Il=.15,po=25;function ci(e,t,n){let r=new Map,o=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,u=[],d=new Set;for(let m=0;m<e.length;m+=1){let l=e[m];for(let f of l.objects){if(f.type==="table"&&d.add(f.id),f.type!=="section"||!f.outline||f.outline.length<3)continue;let h=on(f.outline,we);c.set(f.id,{section:f,unit:l,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),u.push({id:f.id,floorIndex:m,box:yt(h),section:f,unit:l,outline:h})}}let p=new Map;for(let m of u){let l=p.get(m.floorIndex);l?l.push(m):p.set(m.floorIndex,[m])}for(let m=0;m<t.length;m++){let l=t[m],f=n?p.get(n[m])??[]:u,h=l.sectionId?f.find(b=>b.id===l.sectionId)??f.find(b=>b.section.logicalSectionId===l.sectionId&&ot({x:l.x,y:l.y},b.outline,b.section.holes)):void 0,y=h?[h]:f;for(let b of y){if(n&&b.floorIndex!==n[m]||!h&&(l.x<b.box.minX||l.x>b.box.maxX||l.y<b.box.minY||l.y>b.box.maxY||!ot({x:l.x,y:l.y},b.outline,b.section.holes)))continue;o[m]=b.id;let x=c.get(b.id);x.hasSeats=!0;let g=l.focalPoint??b.unit.focal,v=Math.hypot(l.x-g.x,l.y-g.y);v<x.frontU&&(x.frontU=v),x.seatIndices.push(m);let P=l.rowId||`__seat-${m}`,S=x.rows.get(P);S?S.push({x:l.x,y:l.y}):x.rows.set(P,[{x:l.x,y:l.y}]);break}}for(let[m,l]of c){let f=Jt(l.section,{floorBaseHeightM:l.unit.baseHeightM}),h=l.unit.baseHeightM,y=f.rake>0?Math.tan(f.rake*Math.PI/180):0,b=f.rake<=.01&&f.height<=h+.001,x=l.section.surfaceKind,g=x==="flat"?!0:x==="rakedRows"&&f.rake>.01?!1:b,v=l.hasSeats?sn(m,t,l.seatIndices,l.unit.focal):{sectionId:m,rows:[],blockCount:0},S=v.rows.length<2?jr([...l.rows.values()].map(E=>({points:E})),l.unit.focal):null,C=1/0;if(S){if(l.hasSeats)for(let E of l.rows.values())for(let w of E){let L=S.depthAt(w.x,w.y);L<C&&(C=L)}if(!l.hasSeats||!Number.isFinite(C)){C=1/0;for(let E of l.section.outline){let w=S.depthAt(E.x,E.y);w<C&&(C=w)}}}let T=h+Rl,B=Math.max(T,f.height),z=E=>{let w=Math.max(0,E-C)*he,L=Math.min(w*y,po);return Math.max(T,f.height+L)},D=E=>{let w=Math.max(0,E)*he,L=Math.min(w*y,po);return Math.max(T,f.height+L)},k=g?[]:v.rows.map(E=>({pts:E.pts,y:D(E.blockDepth),depth:E.blockDepth,blockId:E.blockId,...d.has(E.id)?{patch:qr(E.pts,we)}:{}})),A=k.length?k[0].y:B,_=k.map(E=>{let w=E.patch&&E.patch.length>=3?E.patch:E.pts,L=0,I=0;for(let U of w)L+=U.x,I+=U.y;let O=w.length||1;L/=O,I/=O;let j=0;for(let U of w){let N=Math.hypot(U.x-L,U.y-I);N>j&&(j=N)}return{cx:L,cy:I,rad:j}}),V=g?()=>B:k.length>=2?(E,w)=>{let L=1/0,I=A;for(let O=0;O<k.length;O++){let j=_[O];if(Math.hypot(E-j.cx,w-j.cy)-j.rad>=L)continue;let U=k[O].patch,N=U&&U.length>=3?Tt(U,E,w)?0:pt(U,E,w):pt(k[O].pts,E,w);N<L&&(L=N,I=k[O].y)}return I}:(E,w)=>S?z(S.depthAt(E,w)):B,M=[0,1,0],R=k.length>=2||g?()=>M:(E,w)=>{if(!S)return M;let L=S.depthAt(E,w);if(L<=C)return M;let I=(L-C)*he;if(I*y>=po||f.height+I*y<=T)return M;let[O,j]=S.gradientAt(E,w);if(O===0&&j===0)return M;let U=1/Math.hypot(y,1);return[-O*y*U,U,-j*y*U]};if(!g)for(let E of v.rows){let w=D(E.blockDepth);for(let L of E.seatIndices)a[L]=w}for(let E of v.rows){let w=[];for(let U=1;U<E.pts.length;U++){let N=Math.hypot(E.pts[U].x-E.pts[U-1].x,E.pts[U].y-E.pts[U-1].y);N>1e-6&&w.push(N)}w.sort((U,N)=>U-N);let L=w.length?w[Math.floor(w.length/2)]:1/0,I=1/0,O=E.pts[Math.floor(E.pts.length/2)];if(O)for(let U of v.rows){if(U===E||U.blockId!==E.blockId)continue;let N=pt(U.pts,O.x,O.y);N>1e-6&&N<I&&(I=N)}let j=Math.min(L,Math.max(I,L*.5));if(Number.isFinite(j)&&j>0)for(let U of E.seatIndices)s[U]=j}r.set(m,{sectionId:m,deckAt:V,normalAt:R,flat:g,bottomY:h,rowLevels:k,landingY:A})}for(let m=0;m<t.length;m++){let l=o[m],f=t[m];if(l){let y=a[m];i[m]=(y??r.get(l).deckAt(f.x,f.y))+Il;continue}let h=f.eyeHeightM;i[m]=Number.isFinite(h)?Math.max(0,h-Ee):0}return{bySection:r,seatOwner:o,seatDeckY:m=>i[m],seatPitchU:m=>s[m]}}var le={top:1,wallBottom:.5,bottomCap:.4};function Oe(e,t){if(!e)return t;let n=Me(At(e,.4),.62);return ge(t,n,.72)}function li(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let r=new Map;for(let i of t){if(!i.sectionId)continue;let a=r.get(i.sectionId);a||(a=new Map,r.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let o=new Map;for(let[i,a]of r){let s=0,c=0,u=0,d=0;for(let[p,m]of a){let l=ne(n.get(p));l&&(s+=l[0]*m,c+=l[1]*m,u+=l[2]*m,d+=m)}d>0&&o.set(i,[s/d,c/d,u/d])}return o}function ui(e,t){return ne(e.color)??t.get(e.logicalSectionId??e.id)??null}var di=lt(require("polygon-clipping"),1);function El(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var fn=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let r=t.map(c=>[c.x,c.y]);if(r.length<3)return[];r.push(r[0]);let o=yt(t),i=this.rings.filter((c,u)=>mn(o,this.boxes[u])&&El(n,this.levels[u])),a=[[r]];if(i.length)try{a=di.default.difference([r],...i).map(u=>u.map(d=>d.map(([p,m])=>[p,m])))}catch{a=[[r]]}this.rings.push([r]),this.boxes.push(o),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let u=c[0].map(([d,p])=>({x:d,y:p}));if(u.length>1){let d=u[0],p=u[u.length-1];Math.abs(d.x-p.x)<1e-9&&Math.abs(d.y-p.y)<1e-9&&u.pop()}u.length>=3&&s.push(u)}return s}};function Tl(e,t){if(!t)return e;let n=1/0,r=-1/0,o=1/0,i=-1/0;for(let p of e)n=Math.min(n,p.x),r=Math.max(r,p.x),o=Math.min(o,p.y),i=Math.max(i,p.y);let a=(n+r)/2,s=(o+i)/2,c=t*Math.PI/180,u=Math.cos(c),d=Math.sin(c);return e.map(p=>{let m=p.x-a,l=p.y-s;return{x:a+m*u-l*d,y:s+m*d+l*u}})}function rt(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3&&(t=e.points),e.kind==="rect"&&e.width&&e.height&&(t=Lt(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,r=(e.y??0)+e.height/2;t=rn(n,r,e.width/2,e.height/2)}return t?Tl(t,e.rotation):null}function Ot(e){let t=e.role??"",n={stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}},r=t==="stage"&&cn(e.stageKind)?{kind:"stage",heightM:.06}:n[t]??{kind:"plate",heightM:.25};return{...r,heightM:e.heightM??r.heightM}}var _l=.08;function mi(e,t){let n=rt(e),r=Ot(e),o=r.heightM;if(!n||r.kind!=="plate"&&r.kind!=="stage")return o;let i=1/0,a=1/0,s=-1/0,c=-1/0;for(let d of n)i=Math.min(i,d.x),a=Math.min(a,d.y),s=Math.max(s,d.x),c=Math.max(c,d.y);let u=o;for(let d of t)s>d.minX&&i<d.maxX&&c>d.minY&&a<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+_l);return t.push({minX:i,minY:a,maxX:s,maxY:c,topOffsetM:u}),u}function je(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function fi(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 Vt(e,t,n){return[je(e[0],e[1],t),je(e[0],e[1],n),je(e[3],e[2],n),je(e[3],e[2],t)]}function pi(e,t,n){return[je(e[0],e[3],t),je(e[1],e[2],t),je(e[1],e[2],n),je(e[0],e[3],n)]}function Ve(e,t,n,r,o,i){ue(e,t,void 0,()=>n,r,o,i,le)}var ho=2.4,kl=.75,Ll=.15;function Bt(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:r,rotation:o}=e;if(!n||!r)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,u=r/2;return[[-c,-u],[c,-u],[c,u],[-c,u]].map(([d,p])=>({x:t.x+d*a-p*s,y:t.y+d*s+p*a}))}function hi(e,t,n,r,o){let i=Bt(t);i&&ue(e,i,void 0,()=>n+ho,n,Oe(r,o.boothTop),o.boothWall,le)}function bo(e){if(e.shape==="round"){let d=e.radius;return d?rn(e.center.x,e.center.y,d,d,24):null}let{width:t,height:n,rotation:r,center:o}=e;if(!t||!n)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,u=n/2;return[[-c,-u],[c,-u],[c,u],[-c,u]].map(([d,p])=>({x:o.x+d*a-p*s,y:o.y+d*s+p*a}))}function bi(e,t,n,r,o){let i=bo(t);i&&ue(e,i,void 0,()=>n+kl,n,Oe(r,o.tableTop),o.tableWall,le)}function yi(e,t,n,r,o,i,a,s){let c=rt(t);if(!c)return;let u=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",p=s?{kind:u?"stage":"solid",heightM:s.topY-s.baseY}:Ot(t),m=s?.baseY??n,l=s?.topY??n+r;if(u&&a){let x=1/0,g=-1/0,v=1/0,P=-1/0;for(let S of c)S.x<x&&(x=S.x),S.x>g&&(g=S.x),S.y<v&&(v=S.y),S.y>P&&(P=S.y);a.push({cx:(x+g)/2*G,cz:(v+P)/2*G,y:l,halfX:Math.max((g-x)/2*G,.5),halfZ:Math.max((P-v)/2*G,.5)})}let f=ne(t.fill),h=u&&f?ge(o.stageTop,Me(At(f,.18),.9),.9):Oe(f,u?o.stageTop:o.decorTop),y=d?f:null,b=u?f?ge(o.stageWall,Me(f,.58),.82):o.stageWall:d?y?ge(Me(y,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Oe(ne(t.fill),o.decorWall);if(p.kind==="portal"&&c.length===4){let x=fi(c);Ve(e,Vt(x,0,.16),l,m,h,b),Ve(e,Vt(x,.84,1),l,m,h,b),Ve(e,x,l,Math.max(m,l-.35),h,b);return}if(p.kind==="suite"&&c.length===4){let x=c.map((P,S)=>{let C=c[(S+1)%4],T=(P.x+C.x)/2,B=(P.y+C.y)/2;return Math.hypot(T-i.x,B-i.y)}),g=x.indexOf(Math.min(...x)),v=[0,1,2,3].map(P=>c[(g+P)%4]);Ve(e,Vt(v,0,.08),l,m,h,b),Ve(e,Vt(v,.92,1),l,m,h,b),Ve(e,pi(v,.88,1),l,m,h,b),Ve(e,v,l,Math.max(m,l-.18),h,b);return}Ve(e,c,l,m,h,b)}function yo(e){let{x:t,y:n,width:r,height:o}=e;if(!r||!o)return null;let i=t+r/2,a=n+o/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),u=Math.sin(s),d=r/2,p=o/2;return[[-d,-p],[d,-p],[d,p],[-d,p]].map(([m,l])=>({x:i+m*c-l*u,y:a+m*u+l*c}))}function Fl(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 r=n[1].trim();if(r==="none"||r==="transparent")return null;let o=r.match(/^url\(#([^)]+)\)$/);if(!o)return ne(r);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${o[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=ne(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,u)=>ge(s,c,1/(u+1)),a[0]):null}function gi(e,t,n,r){if(t.layer==="foreground")return;let o=yo(t);if(!o)return;let i=n+Ll,a=Oe(Fl(t.href),r.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(r.ground,a,s)),ue(e,o,void 0,()=>i,n,a,ge(a,r.decorWall,.5),le)}function xi(e,t,n,r,o){if(!t.points||t.points.length<3)return;let i=Oe(r,o.gaTop);ue(e,t.points,t.holes,()=>n+.15,n,i,o.gaWall,le)}var Dl=Math.PI/180,oe=96,Ol=6,Vl=60,Bl=150,vi=.2,Nl=.35;function Gl(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Dl;return n<0?n+360:n}function pn(e){if(!e.length)return NaN;let t=[...e].sort((n,r)=>n-r);return t[Math.floor(t.length/2)]}function hn(e,t,n=2){let r=e.length,o=new Float64Array(r);for(let i=0;i<r;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let u=i+c;if(t)u=(u%r+r)%r;else if(u<0||u>=r)continue;a+=e[u],s++}o[i]=a/s}return o}function Si(e,t){let n=e.filter(m=>m.rows.length>=1);if(n.length<1)return null;let r=[],o=0,i=0,a=0;for(let m of n)for(let l of m.rows){for(let f of l.pts)o+=f.x,i+=f.y,a++;if(l.pts.length>=4){let f=oo(l.pts);f&&Number.isFinite(f.cx)&&Number.isFinite(f.cy)&&r.push({x:f.cx,y:f.cy})}}if(!a)return null;let s={x:o/a,y:i/a},c=s;if(r.length>=8){let m=pn(r.map(b=>b.x)),l=pn(r.map(b=>b.y)),f=0;for(let b of n)for(let x of b.rows)for(let g of x.pts){let v=Math.hypot(g.x-s.x,g.y-s.y);v>f&&(f=v)}let h=0,y=f*.2;for(let b of n)for(let x of b.rows)for(let g of x.pts)Math.hypot(g.x-m,g.y-l)<y&&h++;Math.hypot(m-s.x,l-s.y)<=f&&h/a<.01&&(c={x:m,y:l})}let u=[];for(let m of n){let l={sectionId:m.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let f of m.rows)for(let h of f.pts){let y=Math.hypot(h.x-c.x,h.y-c.y),b=Math.min(oe-1,Math.floor(Gl(c,h)/(360/oe)));l.samples.push({r:y,bin:b,levelM:f.levelM}),y<l.rMin&&(l.rMin=y),y>l.rMax&&(l.rMax=y)}l.samples.length&&u.push(l)}if(!u.length)return null;u.sort((m,l)=>m.rMin+m.rMax-(l.rMin+l.rMax));let d=[];for(let m of u){let l=!1;for(let f of d){let h=Math.min(m.rMax,f.rMax)-Math.max(m.rMin,f.rMin),y=Math.min(m.rMax-m.rMin,f.rMax-f.rMin);if(y>1e-9&&h>=Nl*y){f.members.push(m),f.rMin=Math.min(f.rMin,m.rMin),f.rMax=Math.max(f.rMax,m.rMax),l=!0;break}}l||d.push({members:[m],rMin:m.rMin,rMax:m.rMax})}let p=[];for(let m of d){let l=new Array(oe).fill(null);for(let A of m.members)for(let _ of A.samples){let V=l[_.bin];V||(V={samples:[]},l[_.bin]=V),V.samples.push({r:_.r,levelM:_.levelM})}let f=l.map(A=>!!A);if(!f.filter(Boolean).length)continue;let y=[],b=[];for(let A of l){if(!A)continue;let _=1/0,V=-1/0;for(let M of A.samples)M.r<_&&(_=M.r),M.r>V&&(V=M.r);y.push(_),b.push(V)}let x=pn(y),g=pn(b);if(!(x>=vi*g)||!(g>0))continue;let v=[...y].sort((A,_)=>A-_);if(!(v[Math.floor(v.length*.1)]>=vi*g))continue;let S=l.map(A=>{if(!A)return null;let _=[...A.samples].sort((O,j)=>O.r-j.r),V=_[0].r,M=_[_.length-1].r,R=_[0].levelM,E=-1/0;for(let O of _)O.levelM>E&&(E=O.levelM);let w=[];for(let O of _){let j={r:O.r,l:O.levelM};for(;w.length&&Math.abs(w[w.length-1].r-j.r)<1e-9;){if(w[w.length-1].l<=j.l){j.skip=!0;break}w.pop()}if(!j.skip){for(;w.length>=2;){let U=w[w.length-2],N=w[w.length-1];if((N.r-U.r)*(j.l-U.l)-(N.l-U.l)*(j.r-U.r)<=0)w.pop();else break}w.push(j)}}let L=w.map(O=>O.r),I=w.map(O=>O.l);return{inner:V,outer:M,front:R,top:E,profile:{rs:L,ls:I}}}),C=f.slice();for(let A=0;A<oe;A++){if(C[A])continue;let _=-1,V=-1,M=0;for(let F=1;F<=oe;F++){let K=(A-F+oe*2)%oe;if(C[K]){_=K;break}}for(let F=1;F<=oe;F++){let K=(A+F)%oe;if(C[K]){V=K,M=F;break}}if(_<0||V<0)continue;let R=0;for(let F=1;F<=oe;F++){let K=(A-F+oe*2)%oe;if(f[K]){R=F;break}}if(R-1+M>Ol)continue;let w=S[_],L=S[V],I=R/(R+M),O=w.inner+(L.inner-w.inner)*I,j=w.outer+(L.outer-w.outer)*I,U=w.front+(L.front-w.front)*I,N=w.top+(L.top-w.top)*I;S[A]={inner:O,outer:j,front:U,top:N,profile:{rs:[O,j],ls:[U,N]}}}for(let A=0;A<oe;A++)S[A]&&(C[A]=!0);let T=360/oe,B=[],z=C.filter(Boolean).length,D=[];if(z===oe)D.push({start:0,len:oe});else{let A=0;for(;C[A];)A=(A+1)%oe;let _=-1;for(let V=0;V<=oe;V++){let M=(A+V)%oe,R=V<oe&&C[M];if(R&&_<0)_=M;else if(!R&&_>=0){let E=(M-_+oe)%oe||oe;D.push({start:_,len:E}),_=-1}}}for(let A of D){if(A.len*T<Vl&&A.len<oe)continue;let _=A.len===oe,V=new Float64Array(A.len),M=new Float64Array(A.len),R=new Float64Array(A.len),E=new Float64Array(A.len),w=[];for(let F=0;F<A.len;F++){let K=S[(A.start+F)%oe];V[F]=K.inner,M[F]=K.outer,R[F]=K.front,E[F]=K.top,w.push(K.profile??{rs:[K.inner,K.outer],ls:[K.front,K.top]})}let L=hn(V,_),I=hn(M,_),O=hn(R,_),j=hn(E,_);for(let F=0;F<A.len;F++)L[F]>V[F]&&(L[F]=V[F]),I[F]<M[F]&&(I[F]=M[F]),L[F]>I[F]-1e-6&&(L[F]=Math.max(0,I[F]-1e-6)),j[F]<O[F]&&(j[F]=O[F]);let U={startBin:A.start,binCount:A.len,closed:_,innerR:L,outerR:I,frontLevelM:O,topLevelM:j,profiles:w},N=(F,K,X)=>{let Q=w[F],W=Q.rs,Z=Q.ls;if(K<=W[0]){Z[0]>X&&(Z[0]=X);return}if(K>=W[W.length-1]){Z[Z.length-1]>X&&(Z[Z.length-1]=X);return}for(let $=0;$+1<W.length;$++)if(K<=W[$+1]){Z[$]>X&&(Z[$]=X),Z[$+1]>X&&(Z[$+1]=X);return}};for(let F=0;F<A.len;F++){let K=l[(A.start+F)%oe];if(K)for(let X of K.samples){N(F,X.r,X.levelM);let Q=_?(F-1+A.len)%A.len:F-1,W=_?(F+1)%A.len:F+1;Q>=0&&N(Q,X.r,X.levelM),W<A.len&&N(W,X.r,X.levelM)}}B.push(U)}B.reduce((A,_)=>A+_.binCount*T,0)<Bl||p.push({arcs:B,sectionIds:m.members.map(A=>A.sectionId),innerRMedian:x,outerRMedian:g})}if(!p.length)return null;if(p.sort((m,l)=>m.innerRMedian-l.innerRMedian),t){let m=p[p.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*m)return null}return{centre:c,binCount:oe,binStepDeg:360/oe,rings:p}}function Mi(e,t,n,r){let o=e.binStepDeg,i=n/o-.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,u=d=>{let p=t.profiles[d],m=p.rs,l=p.ls;if(r<=m[0])return l[0];if(r>=m[m.length-1])return l[l.length-1];for(let f=0;f+1<m.length;f++)if(r<=m[f+1]){let h=m[f+1]-m[f],y=h>1e-9?(r-m[f])/h:0;return l[f]+(l[f+1]-l[f])*y}return l[l.length-1]};return u(a)*(1-c)+u(s)*c}var zl=.25,Hl=1.2,Ul=.6,jl=.45,Yl=2.3,Xl=Math.PI/180;function it(e,t,n){let r=n*Xl;return{x:e.x+t*Math.sin(r),y:e.y+t*Math.cos(r)}}function Wl(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let r=n.outerRMedian*.85;for(let o of e){if(o.role!=="wall")continue;let i=o.points&&o.points.length>=2?o.points:o.x!==void 0&&o.y!==void 0&&o.width!==void 0&&o.height!==void 0?[{x:o.x,y:o.y},{x:o.x+o.width,y:o.y},{x:o.x+o.width,y:o.y+o.height},{x:o.x,y:o.y+o.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=r&&a++;if(a>=i.length/2)return!0}return!1}var Kl=24;function ql(e,t,n,r,o,i,a,s){let c=n.binCount,u=Kl,d=he,p=i+.02,m=[];for(let k=0;k<c;k++){let A=(n.startBin+k+.5)*t.binStepDeg,_=new Float64Array(u+1);for(let V=0;V<=u;V++){let M=r[k]+(o[k]-r[k])*V/u;_[V]=Math.max(p,Mi(t,n,A,M)-zl)}m.push(_)}let l=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],f=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],h=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],y=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],b=(k,A)=>{let _=(n.startBin+k+.5)*t.binStepDeg,V=r[k]+(o[k]-r[k])*A/u,M=it(t.centre,V,_);return[M.x*d,m[k][A],M.y*d]};{let k=Math.tan(12*Math.PI/180);for(let A=0;A<6;A++){let _=!1;for(let M=0;M<c;M++)for(let R=u-1;R>=0;R--)m[M][R]>m[M][R+1]&&(m[M][R]=m[M][R+1],_=!0);let V=n.closed?c:c-1;for(let M=0;M<V;M++){let R=(M+1)%c;for(let E=0;E<=u;E++){let w=m[R][E]-m[M][E];if(Math.abs(w)>1)continue;let L=r[M]+(o[M]-r[M])*E/u,I=r[R]+(o[R]-r[R])*E/u,O=it(t.centre,L,(n.startBin+M+.5)*t.binStepDeg),j=it(t.centre,I,(n.startBin+R+.5)*t.binStepDeg),U=k*Math.hypot(j.x-O.x,j.y-O.y)*d;w>U?(m[R][E]=m[M][E]+U,_=!0):-w>U&&(m[M][E]=m[R][E]+U,_=!0)}}if(!_)break}}let x=1,g=(k,A)=>{for(let _=0;_<=u;_+=4)if(Math.abs(m[k][_]-m[A][_])>x)return!0;return Math.abs(m[k][u]-m[A][u])>x},v=Math.tan(38*Math.PI/180),P=k=>(o[k]-r[k])/u*d,S=(k,A)=>m[k][A+1]-m[k][A]>v*Math.max(1e-6,P(k)),C=(k,A)=>{let _=n.closed?(k-1+c)%c:Math.max(0,k-1),V=n.closed?(k+1)%c:Math.min(c-1,k+1);Math.abs(m[_][A]-m[k][A])>x&&(_=k),Math.abs(m[V][A]-m[k][A])>x&&(V=k);let M=Math.max(0,A-1),R=Math.min(u,A+1);M<A&&S(k,M)&&(M=A),R>A&&S(k,A)&&(R=A);let E=b(_,A),w=b(V,A),L=b(k,M),I=b(k,R),O=w[0]-E[0],j=w[1]-E[1],U=w[2]-E[2],N=I[0]-L[0],F=I[1]-L[1],K=I[2]-L[2],X=j*K-U*F,Q=U*N-O*K,W=O*F-j*N,Z=Math.hypot(X,Q,W);return Z>1e-12?(X/=Z,Q/=Z,W/=Z,Q<0&&(X=-X,Q=-Q,W=-W),[X,Q,W]):[0,1,0]},T=(k,A)=>{let _=[k[0],i,k[2]],V=[A[0],i,A[2]],M=A[0]-k[0],R=A[2]-k[2],E=Math.hypot(M,R);if(!(E>1e-12))return;let w=[R/E,0,-M/E];e.tri(k,A,V,w,h,h,y),e.tri(k,V,_,w,h,y,y)},B=.05*Ue,z=k=>o[k]-r[k]<B,D=n.closed?c:c-1;for(let k=0;k<D;k++){let A=(k+1)%c;if(z(k)||z(A))continue;if(g(k,A)){let w=(n.startBin+k+1)*t.binStepDeg,L=(F,K)=>{let X=(r[k]+r[A])/2,Q=(o[k]+o[A])/2,W=X+(Q-X)*K/u,Z=it(t.centre,W,w);return[Z.x*d,m[F][K],Z.y*d]};for(let F=0;F<u;F++){let K=b(k,F),X=b(k,F+1),Q=L(k,F),W=L(k,F+1),Z=C(k,F),$=C(k,F+1);e.triN(K,Q,W,Z,Z,$,l),e.triN(K,W,X,Z,$,$,l);let te=b(A,F),Le=b(A,F+1),Pe=L(A,F),Be=L(A,F+1),Ne=C(A,F),Ae=C(A,F+1);e.triN(Pe,te,Le,Ne,Ne,Ae,l),e.triN(Pe,Le,Be,Ne,Ae,Ae,l);let Ce=L(k,F),me=L(k,F+1),qe=L(A,F+1),vt=L(A,F),Ge=me[0]-Ce[0],Fe=me[2]-Ce[2],Qe=Math.hypot(Ge,Fe);if(Qe>1e-12){let Ut=[Fe/Qe,0,-Ge/Qe];e.tri(Ce,me,qe,Ut,h),e.tri(Ce,qe,vt,Ut,h)}}let I=b(k,0),O=b(A,0),j=b(A,u),U=b(k,u),N=F=>[F[0],i,F[2]];e.tri(N(I),N(j),N(O),[0,-1,0],f),e.tri(N(I),N(U),N(j),[0,-1,0],f),T(I,O),T(U,j);continue}for(let w=0;w<u;w++){let L=C(k,w),I=C(A,w),O=C(A,w+1),j=C(k,w+1);if(S(k,w)||S(A,w)){let X=(me,qe)=>{let vt=(n.startBin+me+.5)*t.binStepDeg,Ge=r[me]+(o[me]-r[me])*(w+.5)/u,Fe=it(t.centre,Ge,vt);return[Fe.x*d,qe,Fe.y*d]},Q=b(k,w),W=b(A,w),Z=X(k,m[k][w]),$=X(A,m[A][w]);e.triN(Q,W,$,L,I,I,l),e.triN(Q,$,Z,L,I,L,l);let te=b(A,w+1),Le=b(k,w+1),Pe=X(k,m[k][w+1]),Be=X(A,m[A][w+1]);e.triN(Pe,Be,te,j,O,O,l),e.triN(Pe,te,Le,j,O,j,l);let Ne=$[0]-Z[0],Ae=$[2]-Z[2],Ce=Math.hypot(Ne,Ae);if(Ce>1e-12){let me=[-Ae/Ce,0,Ne/Ce];e.tri(Z,$,Be,me,h),e.tri(Z,Be,Pe,me,h)}continue}let U=b(k,w),N=b(A,w),F=b(A,w+1),K=b(k,w+1);e.triN(U,N,F,L,I,O,l),e.triN(U,F,K,L,O,j,l)}let _=b(k,0),V=b(A,0),M=b(A,u),R=b(k,u),E=w=>[w[0],i,w[2]];e.tri(E(_),E(M),E(V),[0,-1,0],f),e.tri(E(_),E(R),E(M),[0,-1,0],f),T(_,V),T(R,M)}if(!n.closed)for(let k of[0,c-1])for(let A=0;A<u;A++)T(b(k,A),b(k,A+1))}function wi(e,t,n){let{bottomY:r,colors:o,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let d of t.rings)for(let p of d.arcs){let m=new Float64Array(p.binCount),l=new Float64Array(p.binCount);for(let h=0;h<p.binCount;h++){let y=(p.startBin+h)%t.binCount,b=Math.max(0,p.innerR[h]-we);m[h]=Math.max(b,a[y]+.001),l[h]=Math.max(m[h]+.001,p.outerR[h]+we)}let f=0;for(let h=0;h<p.binCount;h++){let y=p.topLevelM[h]-r;y>f&&(f=y)}f>=Hl&&ql(e,t,p,m,l,r,o,i);for(let h=0;h<p.binCount;h++){let y=(p.startBin+h)%t.binCount;l[h]>a[y]&&(a[y]=l[h])}}if(n.deriveShell===!1||Wl(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Ul*Ue,u=jl*Ue;for(let d of s.arcs){let p=[],m=[];for(let h=0;h<d.binCount;h++){let y=(d.startBin+h+.5)*t.binStepDeg,b=d.outerR[h]+we+c;p.push(it(t.centre,b,y)),m.push(it(t.centre,b+u,y))}let l=-1/0;for(let h=0;h<d.binCount;h++)d.topLevelM[h]>l&&(l=d.topLevelM[h]);let f=()=>l+Yl;d.closed?ue(e,m,[p.slice().reverse()],f,r,o.shellTop,o.shellWall,i):ue(e,[...m,...p.slice().reverse()],void 0,f,r,o.shellTop,o.shellWall,i)}}function Pi(e,t,n,r,o,i,a,s){if(!t.outline||t.outline.length<3)return;let c=n.baseHeightM,u=Oe(r,s.tierTop);if(!o)return;let d=y=>o.deckAt(y.x,y.y),p=ii(t,a),m=p[0]??t.outline;if(o.rowLevels.length>=2){let y=dn(o.rowLevels),b=ai(Jr(o.rowLevels,n.focal,y),p),x=()=>[0,1,0];for(let v of b){let P=Math.max(c,v.topY-.02);for(let S of i.subtract(v.outline,P))ue(e,S,v.holes,()=>P,c,u,s.tierWall,le,void 0,x)}b.length||ue(e,m,t.holes,()=>o.landingY,c,u,s.tierWall,le);let g={tread:[u[0]*le.top,u[1]*le.top,u[2]*le.top],riser:[u[0]*.72,u[1]*.72,u[2]*.72]};for(let v of p.length?p:[m])ti(e,o.rowLevels,n.focal,o.landingY,g,v,y);return}let l=o.flat?1/0:si,f=y=>o.normalAt(y.x,y.y),h=o.flat?o.landingY:void 0;for(let y of i.subtract(m,h))ue(e,y,t.holes,d,c,u,s.tierWall,le,l,f)}function Ql(e,t,n){let r=new Set;for(let a of e.objects)a.type==="section"&&r.add(a.id);let o=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!r.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let u=t[a],d=o.get(s);d||(d=new Map,o.set(s,d));let p=u.rowId||`__seat-${a}`,m=d.get(p);m||(m={pts:[],levelM:0,n:0},d.set(p,m)),m.pts.push({x:u.x,y:u.y}),m.levelM+=n.seatDeckY(a),m.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 u=s.rowLevels.filter(d=>!d.patch).map(d=>({pts:d.pts,levelM:d.y}));u.length>=2&&i.push({sectionId:a.id,rows:u});continue}let c=o.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(u=>({pts:u.pts,levelM:u.levelM/u.n}))})}return i}function Ci(e,t,n,r,o,i,a=!0){let s=Ql(t,n,r);if(!s.length)return;let c=Si(s,t.focal);c&&(e.setMaterial(0),wi(e,c,{bottomY:t.baseHeightM,colors:{bandTop:Me(o.tierTop,.8),bandWall:o.tierWall,shellTop:i??Me(o.tierWall,1.15),shellWall:i??o.tierWall},ao:le,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a}))}function Ai(e,t,n){return n<0?t>1?e.filter(r=>r.kind==="floor"):[...e]:e.filter(r=>r.floorIndex===void 0||r.floorIndex===n)}function Ri(e,t){let n=[...e].sort((o,i)=>o.screen.y-i.screen.y),r=[];for(let o of n){let i=r.find(a=>a.some(s=>Math.abs(s.screen.x-o.screen.x)<104&&Math.abs(s.screen.y-o.screen.y)<34));i?i.push(o):r.push([o])}return r.flatMap(o=>o.length<2?o:o.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(o.length-1)/2)*104))}})))}var Zl=1.15,$l=2.75,Jl=4.5,eu=.85,tu=.5,nu=.26;function Ii(e,t,n){let r=Math.max(1e-6,t),o=e/r,i=n?.hasZoneLabels??!0,a=new Set;return o>=.75&&a.add("floor"),o>=Zl&&a.add("zone"),o<=(i?$l:Jl)&&(a.add("section"),a.add("ga")),o<=eu&&(a.add("annotation"),a.add("booth")),o<=tu&&a.add("row"),o<=nu&&a.add("seat"),a}function Ei(e,t,n,r,o,i=6){let a=i+t,s=r-i-t,c=i+n,u=o-i-n;return{...e,x:a>s?r/2:Math.max(a,Math.min(s,e.x)),y:c>u?o/2:Math.max(c,Math.min(u,e.y))}}function Ye(e,t,n,r){let o=e,i=t[0],a=t[1],s=t[2],c=o[0]*i+o[4]*a+o[8]*s+o[12],u=o[1]*i+o[5]*a+o[9]*s+o[13],d=o[2]*i+o[6]*a+o[10]*s+o[14],p=o[3]*i+o[7]*a+o[11]*s+o[15];if(!(p>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let m=c/p,l=u/p,f=d/p,h=m>=-1.05&&m<=1.05&&l>=-1.05&&l<=1.05&&f<=1;return{x:(m*.5+.5)*n,y:(1-(l*.5+.5))*r,depth:f,visible:h}}function Ti(e,t,n=t){let r=[],o=[...e].sort((i,a)=>i.screen.depth-a.screen.depth);for(let i of o){let a=!1;for(let s of r)if(go(i,s,t,n)){a=!0;break}a||r.push(i)}return r}var ou=6;function go(e,t,n,r){let o=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+ou):n;return o<a&&i<r}function _i(e,t,n){return e.length*t*.58+(n?14:0)}var ru={row:8,seat:14};function ki(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:ru}function Li(e,t,n,r){let o=Math.max(1,Math.min(n,r)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-r/2)/o);return t*(1+1.5*i)}function xo(e,t,n,r,o=[]){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>=r)break;let c=!1;for(let u of o)if(go(s,u,t,n)){c=!0;break}if(!c){for(let u of a)if(go(s,u,t,n)){c=!0;break}}c||a.push(s)}return a}var iu=6,au=2.2,Fi=.1,su=.3,cu=1.8,lu=.9,uu=.55,du=6e3;function Di(e){let{doc:t,units:n,seats:r,surfaces:o,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let d of n)for(let p of d.objects)p.type==="section"&&p.zone&&c.set(p.id,p.zone);let u=new Map;for(let d=0;d<r.length;d++){let p=r[d],m=o.seatOwner[d],l=p.zoneId??(m?c.get(m):void 0);if(!l)continue;let f=u.get(l);f||(f={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},u.set(l,f)),f.n++,p.x<f.minX&&(f.minX=p.x),p.y<f.minY&&(f.minY=p.y),p.x>f.maxX&&(f.maxX=p.x),p.y>f.maxY&&(f.maxY=p.y),f.sumY+=o.seatDeckY(d)}for(let d of a){let p=u.get(d.id),m=[];for(let[l,f]of c)f===d.id&&m.push(l);if(!p||p.n===0){s.push({id:d.id,label:d.label,color:ne(d.color),sectionIds:m,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(d.focalPoint??i).x*G,1.5,(d.focalPoint??i).y*G]});continue}s.push({id:d.id,label:d.label,color:ne(d.color),sectionIds:m,seatCount:p.n,center:[(p.minX+p.maxX)/2*G,p.sumY/p.n,(p.minY+p.maxY)/2*G],radius:.5*Math.hypot((p.maxX-p.minX)*G,(p.maxY-p.minY)*G)||1,focalWorld:[(d.focalPoint??i).x*G,1.5,(d.focalPoint??i).y*G]})}}return s}function Oi(e){let{doc:t,units:n,seats:r,surfaces:o,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,u=[],d=[],p=[];for(let m of s)m.seatCount!==0&&u.push({id:`zone:${m.id}`,kind:"zone",text:m.label,anchor:[m.center[0],m.center[1]+iu,m.center[2]],color:t.zones?.find(l=>l.id===m.id)?.color});{let m=new Map,l=new Map;for(let f=0;f<r.length;f++){let h=o.seatOwner[f];if(!h)continue;let y=m.get(h);y||(y={n:0,x:0,y:0,deck:0},m.set(h,y)),y.n++,y.x+=r[f].x,y.y+=r[f].y,y.deck+=o.seatDeckY(f);let b=l.get(h);b||(b={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0},l.set(h,b)),r[f].x<b.minX&&(b.minX=r[f].x),r[f].x>b.maxX&&(b.maxX=r[f].x),r[f].y<b.minY&&(b.minY=r[f].y),r[f].y>b.maxY&&(b.maxY=r[f].y)}for(let f of n)for(let h of f.objects){if(h.type!=="section")continue;let y=m.get(h.id);if(!y||y.n===0)continue;let b=l.get(h.id),x=[y.x/y.n*G,y.deck/y.n,y.y/y.n*G],g=h.displayLabel||h.label||h.id;d.push({id:h.id,floorIndex:f.index,label:g,seatCount:y.n,center:x,radius:Math.max(1,Math.hypot(b.maxX-b.minX,b.maxY-b.minY)*.5*G),focalWorld:[f.focal.x*G,f.baseHeightM+1.5,f.focal.y*G]});let v=t.floors?.[f.index]?.name?.trim().toLocaleLowerCase();n.length>1&&v===g.trim().toLocaleLowerCase()||u.push({id:`section:${h.id}`,kind:"section",text:g,anchor:[x[0],x[1]+au,x[2]],floorIndex:f.index})}}{for(let f of n)for(let h of f.objects){if(h.type!=="gaArea")continue;let y=Et(h.points);if(!y)continue;let b=h.displayLabel||h.label||h.id;u.push({id:`ga:${h.id}`,kind:"ga",text:h.capacity>0?`${b} \xB7 ${h.capacity.toLocaleString()}`:b,anchor:[y.x*G,f.baseHeightM+cu,y.y*G],floorIndex:f.index})}let m=new Map;for(let f=0;f<r.length;f++){let h=r[f],y=Math.hypot(h.x-c.x,h.y-c.y),b=m.get(h.rowId);(!b||y>b.far)&&m.set(h.rowId,{seat:h,index:f,far:y})}for(let[f,h]of m){let y=h.seat.label?h.seat.label.lastIndexOf("-"):-1,b=y>0?h.seat.label.slice(0,y):f;b&&u.push({id:`row:${f}`,kind:"row",text:b,anchor:[h.seat.x*G,o.seatDeckY(h.index)+lu,h.seat.y*G],floorIndex:a[h.index]})}let l=new Map;for(let f=0;f<r.length;f++){let h=r[f],y=h.label?h.label.lastIndexOf("-"):-1,b=l.get(h.rowId);b||(b={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:y>0?h.label.slice(0,y):h.rowId,sectionId:h.sectionId},l.set(h.rowId,b));let x=f*3,g=i.iPosition[x],v=i.iPosition[x+1],P=i.iPosition[x+2];b.n++,b.x+=g,b.y+=v,b.z+=P,b.minX=Math.min(b.minX,g),b.maxX=Math.max(b.maxX,g),b.minZ=Math.min(b.minZ,P),b.maxZ=Math.max(b.maxZ,P)}for(let[f,h]of l)p.push({id:f,label:h.label,sectionId:h.sectionId,seatCount:h.n,center:[h.x/h.n,h.y/h.n,h.z/h.n],radius:Math.max(.8,Math.hypot(h.maxX-h.minX,h.maxZ-h.minZ)*.5)});if(r.length<=du)for(let f=0;f<r.length;f++){let h=r[f],y=h.displayLabel||h.label;y&&u.push({id:`seat:${h.id}`,kind:"seat",text:y,anchor:[h.x*G,o.seatDeckY(f)+uu,h.y*G],floorIndex:a[f]})}}for(let m of n)for(let l of m.objects)if(l.type==="shape"&&l.role&&["entrance","exit","screen","suite","obstruction"].includes(l.role)){let f=rt(l),h=f?Et(f):null;if(!h||!l.label)continue;u.push({id:`architecture:${l.id}`,kind:"annotation",text:l.label,anchor:[h.x*G,m.baseHeightM+Ot(l).heightM+Fi,h.y*G],color:l.fill,floorIndex:m.index})}else if(l.type==="text"){if(!l.text)continue;u.push({id:`text:${l.id}`,kind:"annotation",text:l.text,anchor:[l.position.x*G,m.baseHeightM+Fi,l.position.y*G],color:l.color,rotation:l.rotation,floorIndex:m.index})}else if(l.type==="booth"){let f=Bt(l);if(!f)continue;let h=Et(f);if(!h)continue;u.push({id:`booth:${l.id}`,kind:"booth",text:l.displayLabel||l.label||l.id,anchor:[h.x*G,m.baseHeightM+ho+su,h.y*G],floorIndex:m.index})}return{labels:u,sections:d,rows:p}}function Vi(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 Bi(e){let{doc:t,units:n,seats:r,surfaces:o,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let u=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let m=0;m<i.floor.length;m+=1){let l=Math.max(0,Math.min(n.length-1,Math.round(i.floor[m]))),f=m*3,h=u[l];h.minX=Math.min(h.minX,i.position[f]),h.minY=Math.min(h.minY,i.position[f+1]),h.minZ=Math.min(h.minZ,i.position[f+2]),h.maxX=Math.max(h.maxX,i.position[f]),h.maxY=Math.max(h.maxY,i.position[f+1]),h.maxZ=Math.max(h.maxZ,i.position[f+2])}let d=new Map;for(let m=0;m<n.length;m++)for(let l of n[m].objects)l.type==="section"&&d.set(l.id,m);let p=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 m=0;m<r.length;m++){let l=o.seatOwner[m],f=(l!==null?d.get(l):void 0)??a[m];if(f===void 0)continue;let h=p[f],y=r[m];h.n++,y.x<h.minX&&(h.minX=y.x),y.y<h.minY&&(h.minY=y.y),y.x>h.maxX&&(h.maxX=y.x),y.y>h.maxY&&(h.maxY=y.y);let b=o.seatDeckY(m);h.sumX+=y.x*G,h.sumDeck+=b,h.sumZ+=y.y*G,h.minDeck=Math.min(h.minDeck,b),h.maxDeck=Math.max(h.maxDeck,b+1.6),s[m]=f}for(let m=0;m<n.length;m++){let l=p[m],f=t.floors?.[m],h=u[m],y=Math.min(l.n?l.minX*G:n[m].focal.x*G-1,Number.isFinite(h.minX)?h.minX:1/0),b=Math.max(l.n?l.maxX*G:n[m].focal.x*G+1,Number.isFinite(h.maxX)?h.maxX:-1/0),x=Math.min(l.n?l.minY*G:n[m].focal.y*G-1,Number.isFinite(h.minZ)?h.minZ:1/0),g=Math.max(l.n?l.maxY*G:n[m].focal.y*G+1,Number.isFinite(h.maxZ)?h.maxZ:-1/0),v=Math.min(l.n?Math.min(n[m].baseHeightM,l.minDeck):n[m].baseHeightM,Number.isFinite(h.minY)?h.minY:1/0),P=Math.max(l.n?Math.max(l.maxDeck,v+.5):v+.5,Number.isFinite(h.maxY)?h.maxY:-1/0),S=[l.n?l.sumX/l.n:(y+b)/2,l.n?l.sumDeck/l.n:(v+P)/2,l.n?l.sumZ/l.n:(x+g)/2],C=Math.max(1,.5*Math.hypot(b-y,P-v,g-x));c.push({index:m,id:f?.id??`floor-${m}`,label:f?.name??(n.length>1?`Floor ${m+1}`:"Venue"),seatCount:l.n,center:S,radius:C,box:{min:[y,v,x],max:[b,P,g]},focalWorld:[n[m].focal.x*G,n[m].baseHeightM+1.5,n[m].focal.y*G]})}}return c}function vo(e,t){let n=1/0,r=1/0,o=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<r&&(r=c),s>o&&(o=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 u of c.outline)a(u.x,u.y);else if(c.type==="shape"&&c.points)for(let u of c.points)a(u.x,u.y);else if(c.type==="gaArea")for(let u of c.points)a(u.x,u.y);else if(c.type==="booth"){let u=Bt(c);if(u)for(let d of u)a(d.x,d.y)}else if(c.type==="table"){let u=bo(c);if(u)for(let d of u)a(d.x,d.y)}else if(c.type==="decorImage"){let u=yo(c);if(u)for(let d of u)a(d.x,d.y)}return Number.isFinite(n)||(n=-100,r=-100,o=100,i=100),{minX:n,minY:r,maxX:o,maxY:i}}function Ni(e,t,n,r,o,i){if(t.length===1){let a=Math.max(60,(o.maxX-o.minX+o.maxY-o.minY)*.06),s=Lt(o.minX-a,o.minY-a,o.maxX-o.minX+a*2,o.maxY-o.minY+a*2);ue(e,s,void 0,()=>0,-.4,i.ground,i.ground,le)}else{let a=t.reduce((l,f)=>f.baseHeightM<l.baseHeightM?f:l);e.setFloor(a.index);let s=n.filter((l,f)=>r[f]===a.index),c=vo([a],s),u=Math.hypot(c.maxX-c.minX,c.maxY-c.minY),d=Math.max(28,Math.min(80,u*.04)),p=Lt(c.minX-d,c.minY-d,c.maxX-c.minX+d*2,c.maxY-c.minY+d*2),m=a.baseHeightM-.03;ue(e,p,void 0,()=>m,m-.22,i.ground,i.ground,le)}}function Gi(e,t,n){let{cx:r,cz:o,radius:i}=n,a=1/0,s=1/0,c=1/0,u=-1/0,d=-1/0,p=-1/0,m=(h,y,b)=>{a=Math.min(a,h),u=Math.max(u,h),s=Math.min(s,y),d=Math.max(d,y),c=Math.min(c,b),p=Math.max(p,b)};for(let h=0;h<e.position.length;h+=3)m(e.position[h],e.position[h+1],e.position[h+2]);for(let h=0;h<t.count;h++){let y=h*3,b=t.iPosition[y],x=t.iPosition[y+1],g=t.iPosition[y+2],v=Math.max(.35,t.iMaxRadius[h]??.35);m(b-v,x,g-v),m(b+v,x+1.6,g+v)}Number.isFinite(a)||(a=r-i,u=r+i,s=0,d=i*.16,c=o-i,p=o+i);let l=[(a+u)/2,(s+d)/2,(c+p)/2],f=Math.max(1,.5*Math.hypot(u-a,d-s,p-c));return{center:l,radius:f,minY:s,maxY:d}}function zi(e,t,n,r,o,i){let a=1/0,s=1/0,c=-1/0,u=-1/0;for(let v=0;v<e.count;v++){let P=v*3,S=e.iPosition[P],C=e.iPosition[P+2];S<a&&(a=S),S>c&&(c=S),C<s&&(s=C),C>u&&(u=C)}for(let v of t)a=Math.min(a,v.cx-v.halfX),c=Math.max(c,v.cx+v.halfX),s=Math.min(s,v.cz-v.halfZ),u=Math.max(u,v.cz+v.halfZ);let d=n.minX*G,p=n.maxX*G,m=n.minY*G,l=n.maxY*G,f=d,h=p,y=m,b=l;if(Number.isFinite(a)){let v=Math.max(2,.06*Math.hypot(c-a,u-s));f=Math.max(d,a-v),h=Math.min(p,c+v),y=Math.max(m,s-v),b=Math.min(l,u+v)}let x=Math.min(0,r),g=Math.max(o,i*.05);return{min:[f,x,y],max:[h,g,b]}}function Hi(e,t,n){let r=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return r();let o=_r(t);if(!o.ok||o.value.id!==e)return r();let i=new Map;for(let p of n)for(let m of p.objects)m.type==="shape"&&i.set(m.id,{shape:m,unit:p});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(p=>{let m=p.runtimeContentImageUrl;return[p.id,typeof m=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(m)?m:void 0]})),u=[];for(let p of o.value.overlay.productionElements??[]){let m=i.get(p.objectId),l=m?rt(m.shape):null,f=p.baseElevationM??0;if(!m||!l||l.length<3||!p.id||a.has(p.id)||s.has(p.objectId)||!Number.isFinite(p.heightM)||p.heightM<.05||p.heightM>50||!Number.isFinite(f)||f<-10||f>100)return r();a.add(p.id),s.add(p.objectId);let h=l.map(T=>T.x*G),y=l.map(T=>T.y*G),b=m.unit.baseHeightM+f,x=Math.min(...h),g=Math.max(...h),v=Math.min(...y),P=Math.max(...y),S,C=c.get(p.id)??p.contentImageUrl;if(p.kind==="screen"&&C)if(g-x>=P-v){let T=Math.abs(v-m.unit.focal.y*G)<=Math.abs(P-m.unit.focal.y*G)?v-.006:P+.006;S=[[x,b,T],[g,b,T],[x,b+p.heightM,T],[g,b+p.heightM,T]]}else{let T=Math.abs(x-m.unit.focal.x*G)<=Math.abs(g-m.unit.focal.x*G)?x-.006:g+.006;S=[[T,b,v],[T,b,P],[T,b+p.heightM,v],[T,b+p.heightM,P]]}u.push({id:p.id,objectId:p.objectId,kind:p.kind,floorIndex:m.unit.index,baseY:b,topY:b+p.heightM,bounds:{min:[x,b,v],max:[g,b+p.heightM,P]},occlusion:p.occlusion,...C?{contentImageUrl:C}:{},...S?{contentPlane:S}:{}})}let d=u.sort((p,m)=>p.id.localeCompare(m.id));return{byObjectId:new Map(d.map(p=>[p.objectId,p])),elements:d}}function ve(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function xe(e){return Array.isArray(e)?e:[]}function mu(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!ve(n))continue;let r=ve(n.extensions)?n.extensions:null;if(r&&Object.prototype.hasOwnProperty.call(r,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function bn(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function fu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function pu(e,t){let n=new Array(16).fill(0);for(let r=0;r<4;r++)for(let o=0;o<4;o++)for(let i=0;i<4;i++)n[r*4+o]+=e[i*4+o]*t[r*4+i];return n}function hu(e){let t=bn(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:bn(e.translation,3),r=e.rotation===void 0?[0,0,0,1]:bn(e.rotation,4),o=e.scale===void 0?[1,1,1]:bn(e.scale,3);if(!n||!r||!o)return null;let[i,a,s,c]=r,u=Math.hypot(i,a,s,c);if(!(u>1e-8))return null;let d=i/u,p=a/u,m=s/u,l=c/u,f=d+d,h=p+p,y=m+m,b=d*f,x=d*h,g=d*y,v=p*h,P=p*y,S=m*y,C=l*f,T=l*h,B=l*y;return[(1-(v+S))*o[0],(x+B)*o[0],(g-T)*o[0],0,(x-B)*o[1],(1-(b+S))*o[1],(P+C)*o[1],0,(g+T)*o[2],(P-C)*o[2],(1-(b+v))*o[2],0,n[0],n[1],n[2],1]}function bu(e,t,n,r){return[e[0]*t+e[4]*n+e[8]*r+e[12],e[1]*t+e[5]*n+e[9]*r+e[13],e[2]*t+e[6]*n+e[10]*r+e[14]]}function yu(e){let t=e[0],n=e[4],r=e[8],o=e[1],i=e[5],a=e[9],s=e[2],c=e[6],u=e[10],d=i*u-a*c,p=a*s-o*u,m=o*c-i*s,l=t*d+n*p+r*m;if(Math.abs(l)<1e-12)return null;let f=1/l;return[d*f,p*f,m*f,(r*c-n*u)*f,(t*u-r*s)*f,(n*s-t*c)*f,(n*a-r*i)*f,(r*o-t*a)*f,(t*i-n*o)*f]}function Ui(e,t,n,r){let o=e[0]*t+e[1]*n+e[2]*r,i=e[3]*t+e[4]*n+e[5]*r,a=e[6]*t+e[7]*n+e[8]*r,s=Math.hypot(o,i,a)||1;return o/=s,i/=s,a/=s,[o,i,a]}function gu(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,r=null,o=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&&!r)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!ve(c))return null;r=c}catch{return null}else if(a===5130562&&!o)o=s;else return null;n+=i}return n===e.byteLength&&r&&o?{json:r,bin:o}:null}function xu(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function vu(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function Su(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 Mu(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=gu(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:r,bin:o}=n;if(!ve(r.asset)||r.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=xe(r.extensionsUsed).filter(v=>typeof v=="string");if(i.includes("KHR_draco_mesh_compression")||mu(r))return{ok:!1,issue:"draco_not_allowed"};if(i.length||xe(r.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(xe(r.images).length||xe(r.textures).length)return{ok:!1,issue:"external_resource"};let a=xe(r.buffers);if(a.length!==1||!ve(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>o.byteLength)return{ok:!1,issue:"external_resource"};let s=xe(r.accessors),c=xe(r.bufferViews),u=xe(r.meshes),d=xe(r.nodes),p=xe(r.scenes),m=typeof r.scene=="number"?r.scene:0;if(!ve(p[m]))return{ok:!1,issue:"unsupported_glb"};let l=new DataView(o.buffer,o.byteOffset,o.byteLength),f=(v,P,S)=>{if(typeof v!="number"||!Number.isInteger(v)||!ve(s[v]))return null;let C=s[v];if(C.type!==P||C.sparse!==void 0||C.normalized===!0||typeof C.count!="number"||!Number.isInteger(C.count)||C.count<1||typeof C.componentType!="number"||!S.includes(C.componentType)||typeof C.bufferView!="number")return null;let T=c[C.bufferView];if(!ve(T)||T.buffer!==0||typeof T.byteLength!="number"||!Number.isInteger(T.byteLength)||T.byteLength<0)return null;let B=vu(C.type),z=xu(C.componentType),D=typeof T.byteStride=="number"?T.byteStride:B*z,k=typeof T.byteOffset=="number"?T.byteOffset:0,A=typeof C.byteOffset=="number"?C.byteOffset:0,_=k+A,V=A+(C.count-1)*D+B*z;if(!Number.isInteger(D)||!Number.isInteger(k)||!Number.isInteger(A)||D<B*z||k<0||A<0||k+T.byteLength>o.byteLength||V>T.byteLength)return null;let M=[];for(let R=0;R<C.count;R++){let E=[];for(let w=0;w<B;w++){let L=Su(l,_+R*D+w*z,C.componentType);if(!Number.isFinite(L))return null;E.push(L)}M.push(E)}return M},h=[],y=[],b=0,x=new Set,g=(v,P)=>{if(typeof v!="number"||!Number.isInteger(v)||!ve(d[v])||x.has(v))return!1;x.add(v);let S=d[v],C=hu(S);if(!C)return!1;let T=pu(P,C),B=yu(T);if(!B)return!1;if(S.mesh!==void 0){if(typeof S.mesh!="number")return!1;let z=u[S.mesh];if(!ve(z))return!1;for(let D of xe(z.primitives)){if(!ve(D)||D.mode!==void 0&&D.mode!==4||!ve(D.attributes))return!1;let k=f(D.attributes.POSITION,"VEC3",[5126]),A=D.attributes.NORMAL===void 0?null:f(D.attributes.NORMAL,"VEC3",[5126]);if(!k||D.attributes.NORMAL!==void 0&&!A)return!1;let _=k.length;if(D.indices!==void 0){let M=typeof D.indices=="number"?s[D.indices]:null;_=ve(M)?M.count:void 0}if(typeof _!="number"||!Number.isInteger(_)||_%3!==0||(b+=_/3,b>1e5))return!1;let V=D.indices===void 0?k.map((M,R)=>[R]):f(D.indices,"SCALAR",[5121,5123,5125]);if(!V||V.length%3!==0||V.length!==_)return!1;for(let M=0;M<V.length;M+=3){let R=[V[M][0],V[M+1][0],V[M+2][0]];if(R.some(L=>!Number.isInteger(L)||L<0||L>=k.length))return!1;let E=R.map(L=>bu(T,...k[L])),w=null;if(!A){let L=E[1][0]-E[0][0],I=E[1][1]-E[0][1],O=E[1][2]-E[0][2],j=E[2][0]-E[0][0],U=E[2][1]-E[0][1],N=E[2][2]-E[0][2];w=Ui([1,0,0,0,1,0,0,0,1],I*N-O*U,O*j-L*N,L*U-I*j)}for(let L=0;L<3;L++)h.push(...E[L]),y.push(...A?Ui(B,...A[R[L]]):w)}}}for(let z of xe(S.children))if(!g(z,T))return!1;return x.delete(v),!0};for(let v of xe(p[m].nodes))if(!g(v,fu()))return{ok:!1,issue:b>1e5?"triangle_limit":"unsupported_glb"};return!b||h.length!==b*9||y.length!==h.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:b,position:new Float32Array(h),normal:new Float32Array(y)}}function ji(e){try{return Mu(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function gt(e){let{doc:t}=e,n=xr(t.theme),r=n.structure,o=ri(t,e.eventConfigurationId??t.eventConfigurationId),i=Hi(e.eventConfigurationId,e.eventConfiguration,o),a=e.seats,s=new nn,c=null;if(e.registeredShellGlb){let M=ji(e.registeredShellGlb);if(M.ok){let R=M.position.length/3,E=new Float32Array(M.position.length),w=n.materials.shell??r.tierWall;for(let L=0;L<R;L++){let I=M.normal[L*3+1],O=I<-.25?.4:.62+.38*Math.max(0,I);E[L*3]=w[0]*O,E[L*3+1]=w[1]*O,E[L*3+2]=w[2]*O}c={position:M.position,normal:M.normal,color:E,floor:new Float32Array(R).fill(-2),material:new Float32Array(R),count:R}}}let u=new Map;for(let M of o)for(let R of M.objects)u.set(R.id,M.index),R.type==="section"&&u.set(R.logicalSectionId??R.id,M.index);let d=a.map(M=>u.get(M.sectionId??"")??u.get(M.rowId??"")??0),p=vo(o,a);Ni(s,o,a,d,p,r);let m=li(t,a),l=new Map,f=new Map;for(let M of t.categories??[])l.set(M.key,M.color),M.seatGlyph&&f.set(M.key,M.seatGlyph);let h=[],y=ci(o,a,d),b=new Float32Array(a.length),x=[];for(let M=0;M<o.length;M++){let R=o[M];s.setFloor(M);let E=new fn,w=[],L=R.objects.filter(I=>I.type==="section"&&!!I.outline&&I.outline.length>=3);for(let I of R.objects)if(I.type==="section"){let O=s.vertexCount;Pi(s,I,R,ui(I,m),y.bySection.get(I.id),E,L,r);let j=s.vertexCount-O;j>0&&x.push({sectionId:I.id,start:O,count:j})}else if(I.type==="shape"){let O=i.byObjectId.get(I.id);s.setMaterial((O?.kind??I.role)==="screen"?1:0),yi(s,I,R.baseHeightM,mi(I,w),r,R.focal,h,O),s.setMaterial(0)}else I.type==="gaArea"?xi(s,I,R.baseHeightM,ne(l.get(I.categoryKey)),r):I.type==="booth"?hi(s,I,R.baseHeightM,ne(l.get(I.categoryKey)),r):I.type==="table"?bi(s,I,R.baseHeightM,ne(I.fill??t.theme?.decorFill??"#232c40"),r):I.type==="decorImage"&&gi(s,I,R.baseHeightM,r);Ci(s,R,a,y,r,n.materials.shell,!c)}let g=o.length>1?{x:o.reduce((M,R)=>M+R.focal.x,0)/o.length,y:o.reduce((M,R)=>M+R.focal.y,0)/o.length}:t.focalPoint??{x:(p.minX+p.maxX)/2,y:(p.minY+p.maxY)/2},v=cr(c?[s.build(),c]:[s.build()]),P=yr(a,e.initialState,y,b,l,f),S=Di({doc:t,units:o,seats:a,surfaces:y,focal:g}),{labels:C,sections:T,rows:B}=Oi({doc:t,units:o,seats:a,surfaces:y,seatData:P,hintedSeatFloor:d,zones:S,focal:g}),z=Bi({doc:t,units:o,seats:a,surfaces:y,solids:v,hintedSeatFloor:d,seatFloor:b});Vi(C,z),P.iYaw=hr(P.iPosition,a.length,M=>a[M].rowId,M=>{let R=o[b[M]]?.focal??g;return[R.x*G,R.y*G]});let D=(p.minX+p.maxX)/2*G,k=(p.minY+p.maxY)/2*G,A=.5*Math.hypot((p.maxX-p.minX)*G,(p.maxY-p.minY)*G)||10,_=Gi(v,P,{cx:D,cz:k,radius:A}),V=zi(P,h,p,_.minY,_.maxY,A);return{solids:v,sectionSolidRanges:x,seats:P,bounds:{center:[(V.min[0]+V.max[0])/2,(V.min[1]+V.max[1])/2,(V.min[2]+V.max[2])/2],radius:A,groundY:0,box:V},renderBounds:{center:_.center,radius:_.radius},stateColorLUT:vr(n,fe),theme:n,seatCount:a.length,focalWorld:[g.x*G,1.5,g.y*G],zones:S,stages:h,productionElements:i.elements,sections:T,rows:B,labels:C,floors:z}}var wu=88,Pu=20,So={floor:{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},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:10.5,weight:"600",opacity:.8},seat:{size:9.5,weight:"500",opacity:.72}},Nt=new Set(["row","seat"]),Yi={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},yn={row:{x:62,y:16},seat:{x:46,y:18}},Xi=ne,Mo=e=>No(e);function Wi(e,t){let n=Mo(e),r=Mo(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function wo(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let r=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(o=>Number(n[o])/255*r+t[o-1]*(1-r))}function Cu(e,t=[.04,.06,.1],n=!0){let r=Mo(t)<.42,o=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?wo(i,t):t,s=Xi(e),c=n?7:4.5,u=s&&Wi(s,a)>=c?e:o;return r?{ink:u,backing:i,border:"rgba(210,222,245,.24)"}:{ink:u,backing:i,border:"rgba(11,18,32,.22)"}}var Au='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',gn=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=n.fontFamily||Au,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;for(let[n,r]of this.nodes)t.some(o=>o.id===n)||(r.remove(),this.nodes.delete(n))}setForcedDense(t){this.forcedDense=t}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let o=this.nodes.get(r.id),i=o?.getBoundingClientRect(),a=!!(n&&o&&o.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:a,renderedFontPx:o&&Number.parseFloat(o.style.fontSize)||0,contrast:o?Number(o.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,r,o,i,a){if(!this.labels.length)return;let s=Ii(o,i,{hasZoneLabels:this.labels.some(g=>g.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"));let c=[];for(let g of this.labels){if(!s.has(g.kind))continue;let v=Ye(t,g.anchor,n,r);if(!v.visible)continue;let P=_i(g.text,So[g.kind].size,!Nt.has(g.kind)),S=!Nt.has(g.kind),C=Ei(v,P/2,So[g.kind].size/2+(S?4:1),n,r),T=a?Math.hypot(g.anchor[0]-a[0],g.anchor[1]-a[1],g.anchor[2]-a[2]):1;c.push({label:g,screen:C,focus:Li(C,T,n,r),halfWidth:P/2,...this.selectedSeatLabelIds.has(g.id)?{priority:1}:{}})}let u=Ri(c.filter(g=>g.label.kind==="floor"),n),d=[...c.filter(g=>!Nt.has(g.label.kind)&&g.label.kind!=="floor"),...u],p=Ti(d,wu,Pu),m=ki(n),l=xo(c.filter(g=>g.label.kind==="row"),yn.row.x,yn.row.y,m.row,p),f=xo(c.filter(g=>g.label.kind==="seat"),yn.seat.x,yn.seat.y,m.seat,[...p,...l]),h=[...p,...l,...f],y=new Set(h.map(g=>g.label.id));for(let{label:g,screen:v}of h){let S=this.nodeFor(g).style;S.display="",S.transform=`translate(-50%, -50%) translate(${v.x.toFixed(1)}px, ${v.y.toFixed(1)}px)`}let b=h.filter(({label:g})=>!Nt.has(g.kind)).sort((g,v)=>Yi[v.label.kind]-Yi[g.label.kind]||g.screen.depth-v.screen.depth||g.focus-v.focus),x=[];for(let{label:g}of b){let v=this.nodes.get(g.id);if(!v||v.style.display==="none")continue;let P=v.getBoundingClientRect();x.some(C=>P.left<C.right+3&&P.right+3>C.left&&P.top<C.bottom+3&&P.bottom+3>C.top)?v.style.display="none":x.push(P)}for(let[g,v]of this.nodes)y.has(g)||(v.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let p=n.style;p.position="absolute",p.left="0",p.top="0",p.whiteSpace="nowrap",p.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",p.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}n.textContent=t.text,n.setAttribute("data-label-kind",t.kind);let r=this.selectedSeatLabelIds.has(t.id);n.toggleAttribute("data-selected-seat",r);let o=So[t.kind],i=n.style;i.fontSize=`${o.size}px`,i.fontWeight=r?"800":o.weight,i.opacity=r?"1":String(o.opacity);let a=!Nt.has(t.kind),s=Cu(t.color??this.opts.ink,this.opts.backgroundRgb,a);i.color=r?"#ecf8ff":s.ink,i.background=r?"rgba(10,28,45,.9)":a?s.backing:"",i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${s.border}`:"",i.borderRadius=r||a?"999px":"",i.padding=r||a?"3px 7px":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"",i.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let c=this.opts.backgroundRgb??[.04,.06,.1],u=Xi(r?"#ecf8ff":s.ink)??[1,1,1],d=r?wo("rgba(10,28,45,.9)",c):a?wo(s.backing,c):c;return n.dataset.qualityContrast=Wi(u,d).toFixed(3),(t.kind==="zone"||t.kind==="floor")&&(i.textTransform="uppercase"),n}dispose(){this.root.remove(),this.nodes.clear()}};var qi=1;var Ru=new Set(["floor","zone","section","ga","booth","annotation"]);function Iu(e){return e.every(t=>Number.isFinite(t))}function Eu(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 Ki(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function at(e){return Math.round(e*1e4)/1e4}function Tu(e){if(e)return{box:{x:at(e.box.x),y:at(e.box.y),width:at(e.box.width),height:at(e.box.height)},horizontalFillRatio:at(e.horizontalFillRatio),verticalFillRatio:at(e.verticalFillRatio),visibleAreaRatio:at(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function Te(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function xn(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>Ru.has(s.kind)),r=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,o=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)Eu(n[s].screenBox,n[c].screenBox)&&o.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=[Te("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),Te("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),Te("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),Te("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}`}]),Te("camera-invalid","The capture camera must have a finite physical pose",Iu(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),Te("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}]),Te("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),Te("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}))),Te("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}))),Te("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",o)].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:u})=>({id:s,kind:c,text:u})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:Tu(e.framing)},metrics:{minimumHierarchyFontPx:Ki(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:Ki(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}var ce=require("ogl");var Xe=require("ogl");var vn=`
|
|
21
21
|
float chairWeight(float depth) {
|
|
22
22
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
23
23
|
}`,Qi=`
|
|
24
24
|
float occupantWeight(float depth) {
|
|
25
|
-
float nearWeight = smoothstep(${
|
|
26
|
-
float farWeight = 1.0 - smoothstep(${
|
|
25
|
+
float nearWeight = smoothstep(${Ko.toFixed(1)}, ${qo.toFixed(1)}, depth);
|
|
26
|
+
float farWeight = 1.0 - smoothstep(${Xo.toFixed(1)}, ${Wo.toFixed(1)}, depth);
|
|
27
27
|
return nearWeight * farWeight;
|
|
28
28
|
}`,Zi=`
|
|
29
29
|
float glyphEq(float glyph, float expected) {
|
|
@@ -630,7 +630,7 @@ out vec4 fragColor;
|
|
|
630
630
|
void main() {
|
|
631
631
|
if (vHidden > 0.5) discard;
|
|
632
632
|
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
633
|
-
}`;function $i(e){return new Xe.Program(e,{vertex:Nu,fragment:Gu,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:De},uSeatScale:{value:1},uMinPixels:{value:mt},uPixelToWorld:{value:.002},uChairFull:{value:It},uChairNone:{value:ft},uFocusFloor:{value:-1}}})}function Ji(e){return new Xe.Program(e,{vertex:zu,fragment:Hu,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:It},uChairNone:{value:ft},uBackRake:{value:qn},uBackBase:{value:an},uFocusFloor:{value:-1}}})}function ea(e){return new Xe.Program(e,{vertex:Uu,fragment:ju,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function ta(e,t=.78){return new Xe.Program(e,{vertex:_u,fragment:ku,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:t}}})}function na(e){return new Xe.Program(e,{vertex:Lu,fragment:Fu,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:De},uSeatScale:{value:1},uMinPixels:{value:mt},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:It},uChairNone:{value:ft}}})}function oa(e,t=.78){return new Xe.Program(e,{vertex:Du,fragment:Ou,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:It},uChairNone:{value:ft},uBackRake:{value:qn},uBackBase:{value:an},uFocusFloor:{value:-1},uRoughness:{value:t}}})}function ra(e,t,n){return new Xe.Program(e,{vertex:Vu,fragment:Bu,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)}}})}var Yu=.65,Xu=new Set(["dimmed","sold"]),Wu=new Set(["dimmed","sold","held"]);function ia(e,t,n){let r=new Set,o=!1,i=fe.indexOf("dimmed"),a=!1;for(let c=0;c<n.length;c+=1)if(n[c]===i){a=!0;break}let s=a?Wu:Xu;for(let c of e){let u=t.get(c.sectionId);if(!u||!u.length){r.add(c.sectionId);continue}let d=!1;for(let p of u){let m=fe[n[p]]??"available";if(!s.has(m)){d=!0;break}}d?r.add(c.sectionId):o=!0}return{lit:r,anyUnlit:o}}function aa(e,t,n,r,o,i){let a=[];for(let s of e){let c=o===null||o.has(s.sectionId);if(r.get(s.sectionId)===c)continue;r.set(s.sectionId,c);let u=(s.start+s.count)*3;for(let d=s.start*3;d<u;d++)t[d]=c?n[d]:n[d]+(i[d%3]-n[d])*Yu;a.push(s)}return a}function sa(e,t,n,r,o,i){for(let a=n;a<n+r;a++){let c=i&&t[a]===0?null:o[t[a]]??o[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 Ku=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),qu=new Float32Array([-1,-1,3,-1,-1,3]);function ca(e,t){let n=new ce.Transform,r=new ce.Transform,o=new ce.Geometry(e,{position:{size:2,data:qu}}),i=ra(e,t.theme.background.top,t.theme.background.bottom),a=new ce.Mesh(e,{geometry:o,program:i});a.frustumCulled=!1,a.setParent(r);let s=new ce.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=ta(e,t.theme.materials.roughness),u=new ce.Mesh(e,{geometry:s,program:c});u.frustumCulled=!1,u.setParent(n);let d=na(e),p=new Float32Array(t.seats.count*3),m=fe.map(X=>t.theme.seatStates[X]);sa(p,t.seats.iState,0,t.seats.count,m,t.seats.iCategory);let l=new ce.Geometry(e,{position:{size:2,data:Ku},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:p,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,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}}),f=new ce.Mesh(e,{geometry:l,program:d});f.frustumCulled=!1,t.seats.count>0&&f.setParent(n);let h=l.attributes.iColor,y=t.solids.color.slice(),b=t.theme.structure.ground,x=new Map(t.sectionSolidRanges.map(X=>[X.sectionId,!0])),g=
|
|
633
|
+
}`;function $i(e){return new Xe.Program(e,{vertex:Nu,fragment:Gu,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:De},uSeatScale:{value:1},uMinPixels:{value:mt},uPixelToWorld:{value:.002},uChairFull:{value:It},uChairNone:{value:ft},uFocusFloor:{value:-1}}})}function Ji(e){return new Xe.Program(e,{vertex:zu,fragment:Hu,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:It},uChairNone:{value:ft},uBackRake:{value:qn},uBackBase:{value:an},uFocusFloor:{value:-1}}})}function ea(e){return new Xe.Program(e,{vertex:Uu,fragment:ju,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function ta(e,t=.78){return new Xe.Program(e,{vertex:_u,fragment:ku,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:t}}})}function na(e){return new Xe.Program(e,{vertex:Lu,fragment:Fu,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:De},uSeatScale:{value:1},uMinPixels:{value:mt},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:It},uChairNone:{value:ft}}})}function oa(e,t=.78){return new Xe.Program(e,{vertex:Du,fragment:Ou,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:It},uChairNone:{value:ft},uBackRake:{value:qn},uBackBase:{value:an},uFocusFloor:{value:-1},uRoughness:{value:t}}})}function ra(e,t,n){return new Xe.Program(e,{vertex:Vu,fragment:Bu,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)}}})}var Yu=.65,Xu=new Set(["dimmed","sold"]),Wu=new Set(["dimmed","sold","held"]);function ia(e,t,n){let r=new Set,o=!1,i=fe.indexOf("dimmed"),a=!1;for(let c=0;c<n.length;c+=1)if(n[c]===i){a=!0;break}let s=a?Wu:Xu;for(let c of e){let u=t.get(c.sectionId);if(!u||!u.length){r.add(c.sectionId);continue}let d=!1;for(let p of u){let m=fe[n[p]]??"available";if(!s.has(m)){d=!0;break}}d?r.add(c.sectionId):o=!0}return{lit:r,anyUnlit:o}}function aa(e,t,n,r,o,i){let a=[];for(let s of e){let c=o===null||o.has(s.sectionId);if(r.get(s.sectionId)===c)continue;r.set(s.sectionId,c);let u=(s.start+s.count)*3;for(let d=s.start*3;d<u;d++)t[d]=c?n[d]:n[d]+(i[d%3]-n[d])*Yu;a.push(s)}return a}function sa(e,t,n,r,o,i){for(let a=n;a<n+r;a++){let c=i&&t[a]===0?null:o[t[a]]??o[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 Ku=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),qu=new Float32Array([-1,-1,3,-1,-1,3]);function ca(e,t){let n=new ce.Transform,r=new ce.Transform,o=new ce.Geometry(e,{position:{size:2,data:qu}}),i=ra(e,t.theme.background.top,t.theme.background.bottom),a=new ce.Mesh(e,{geometry:o,program:i});a.frustumCulled=!1,a.setParent(r);let s=new ce.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=ta(e,t.theme.materials.roughness),u=new ce.Mesh(e,{geometry:s,program:c});u.frustumCulled=!1,u.setParent(n);let d=na(e),p=new Float32Array(t.seats.count*3),m=fe.map(X=>t.theme.seatStates[X]);sa(p,t.seats.iState,0,t.seats.count,m,t.seats.iCategory);let l=new ce.Geometry(e,{position:{size:2,data:Ku},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:p,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,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}}),f=new ce.Mesh(e,{geometry:l,program:d});f.frustumCulled=!1,t.seats.count>0&&f.setParent(n);let h=l.attributes.iColor,y=t.solids.color.slice(),b=t.theme.structure.ground,x=new Map(t.sectionSolidRanges.map(X=>[X.sectionId,!0])),g=pr(),v=oa(e,t.theme.materials.roughness),P=$t,S=new Float32Array(P*3),C=new Float32Array(P*3),T=new Float32Array(P),B=new Float32Array(P),z=new Float32Array(P),D=new Float32Array(P*3),k=new Float32Array(P),A=new Float32Array(P),_=new Float32Array(P),V=new Float32Array(P),M=new ce.Geometry(e,{position:{size:3,data:g.position},normal:{size:3,data:g.normal},part:{size:1,data:g.part},index:{data:g.index},iOffset:{size:3,data:S,instanced:1},iColor:{size:3,data:C,instanced:1},iRadius:{size:1,data:T,instanced:1},iYaw:{size:1,data:B,instanced:1},iGlyph:{size:1,data:z,instanced:1},iRing:{size:3,data:D,instanced:1},iFloor:{size:1,data:k,instanced:1},iPhysicalSeat:{size:1,data:A,instanced:1},iSeed:{size:1,data:V,instanced:1},iPickIndex:{size:1,data:_,instanced:1}}),R=new ce.Mesh(e,{geometry:M,program:v});R.frustumCulled=!1;let E=0,w=!1,L=!1,I=null,O=null,j=null,U=new Int32Array(0),N=()=>{let X=t.seats;for(let Q=0;Q<E;Q++){let W=U[Q];V[Q]=br(X.iState[W],W);let $=X.iCategory&&X.iState[W]===0?null:m[X.iState[W]]??m[0];if($)C[Q*3]=$[0],C[Q*3+1]=$[1],C[Q*3+2]=$[2];else{let te=t.theme.materials.seat??zo([X.iCategory[W*3],X.iCategory[W*3+1],X.iCategory[W*3+2]]);C[Q*3]=te[0],C[Q*3+1]=te[1],C[Q*3+2]=te[2]}}M.attributes.iColor.needsUpdate=!0,M.attributes.iSeed.needsUpdate=!0},F={main:n,background:r,seatProgram:d,solidProgram:c,chairProgram:v,seatGeometry:l,chairGeometry:M,solidGeometry:s,drawCalls:3,setNearSeats(X,Q){let W=Math.min(Q,P);if(U=X,E=W,W===0){R.parent&&R.setParent(null),M.instancedCount=0,F.drawCalls=3+(w?1:0);return}let Z=t.seats;for(let $=0;$<W;$++){let te=X[$];S[$*3]=Z.iPosition[te*3],S[$*3+1]=Z.iPosition[te*3+1],S[$*3+2]=Z.iPosition[te*3+2],T[$]=Z.iChairWidth[te],B[$]=Z.iYaw[te],z[$]=Z.iGlyph[te],D[$*3]=Z.iRing[te*3],D[$*3+1]=Z.iRing[te*3+1],D[$*3+2]=Z.iRing[te*3+2],k[$]=Z.iFloor[te],A[$]=Z.iPhysicalSeat[te],_[$]=te+1}N(),M.attributes.iOffset.needsUpdate=!0,M.attributes.iRadius.needsUpdate=!0,M.attributes.iYaw.needsUpdate=!0,M.attributes.iGlyph.needsUpdate=!0,M.attributes.iRing.needsUpdate=!0,M.attributes.iFloor.needsUpdate=!0,M.attributes.iPhysicalSeat.needsUpdate=!0,M.attributes.iSeed.needsUpdate=!0,M.attributes.iPickIndex.needsUpdate=!0,M.instancedCount=W,R.parent||R.setParent(n),F.drawCalls=4+(w?1:0)},nearSeatCount(){return E},setSectionShellLit(X){let Q=aa(t.sectionSolidRanges,t.solids.color,y,x,X,b);if(!Q.length)return;let W=s.attributes.color,Z=W.buffer;if(!Z){W.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,Z);for(let $ of Q){let te=t.solids.color.subarray($.start*3,($.start+$.count)*3);e.bufferSubData(e.ARRAY_BUFFER,$.start*3*Float32Array.BYTES_PER_ELEMENT,te)}},uploadSeatStateRuns(X){if(!X.length)return;E&&N();for(let W of X)sa(p,t.seats.iState,W.start,W.length,m,t.seats.iCategory);let Q=h.buffer;if(!Q){h.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,Q);for(let W of X){let Z=p.subarray(W.start*3,(W.start+W.length)*3);e.bufferSubData(e.ARRAY_BUFFER,W.start*3*Float32Array.BYTES_PER_ELEMENT,Z)}},dispose(){L=!0,o.remove(),i.remove(),s.remove(),c.remove(),l.remove(),d.remove(),M.remove(),v.remove(),I?.remove(),O?.remove(),j?.texture&&e.deleteTexture(j.texture)}},K=t.productionElements.find(X=>X.contentImageUrl&&X.contentPlane);if(K?.contentImageUrl&&K.contentPlane?.length===4&&typeof Image<"u"){let X=new Image;X.crossOrigin="anonymous",X.onload=()=>{if(L)return;let Q=K.contentPlane;I=new ce.Geometry(e,{position:{size:3,data:new Float32Array(Q.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(K.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),j=new ce.Texture(e,{image:X,generateMipmaps:!0,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,flipY:!1}),O=new ce.Program(e,{vertex:`#version 300 es
|
|
634
634
|
precision highp float;
|
|
635
635
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
636
636
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -638,4 +638,4 @@ void main() {
|
|
|
638
638
|
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
|
|
639
639
|
precision highp float;
|
|
640
640
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
641
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:j},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let W=new ce.Mesh(e,{geometry:I,program:O});W.frustumCulled=!1,W.setParent(n),F.screenProgram=O,w=!0,F.drawCalls=3+(E?1:0)+1},X.src=K.contentImageUrl}return F}var _e=require("ogl");function Qu(e,t,n){let r=e+(t<<8)+(n<<16);return r===0?-1:r-1}function la(e,t,n,r,o,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let u=0;u<t;u++){let d=(c*t+u)*4,p=Qu(e[d],e[d+1],e[d+2]);if(p<0||p>=i)continue;let m=u-r,l=c-o,f=m*m+l*l;f<s&&(s=f,a=p)}return a}function ua(e,t,n,r,o,i){let a=e-n.left,s=t-n.top,c=Math.round(a*r),u=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(o-1,c)),y:Math.max(0,Math.min(i-1,u))}}var Zu=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Sn=class{constructor(t,n,r,o,i){this.seatScene=new _e.Transform;this.chairScene=new _e.Transform;this.solidScene=new _e.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=$i(this.gl),this.chairProg=Ji(this.gl),this.depthProg=ea(this.gl);let a=new _e.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new _e.Mesh(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new _e.Mesh(this.gl,{geometry:o,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of Zu)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}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 _e.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,r,o){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,u=Math.max(0,n-o),d=Math.max(0,r-o),p=Math.max(1,Math.min(s,n+o+1)-u),m=Math.max(1,Math.min(c,r+o+1)-d);i.enable(i.SCISSOR_TEST),i.scissor(u,d,p,m);let[l,f,h]=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(l,f,h,1),i.disable(i.SCISSOR_TEST);let y=new Uint8Array(p*m*4);return this.renderer.bindFramebuffer(a),i.readPixels(u,d,p,m,i.RGBA,i.UNSIGNED_BYTE,y),this.renderer.bindFramebuffer(),la(y,p,m,n-u,r-d,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function da(e,t){let n=[];for(let r of t)e.has(r.seatId)?e.set(r.seatId,Rt(r.state)):n.push(r);return n}function ma(e,t,n){let r=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&r.add(a);let o=new Map(e),i=[];for(let[a,s]of e)r.has(a)||(i.push({seatId:a,state:fe[s]??"available"}),o.delete(a));for(let a of r){if(o.has(a))continue;let s=n(a);s!==void 0&&(o.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:o}}var We=require("ogl");function $u(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function fa(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function Ju(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function pa(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 wo(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function Po(e,t){return Math.max(0,Math.min(1,e+t))}function ha(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let r=Math.max(0,Math.min(1,t)),o=n-1,i=Math.floor(r*o);i>=o&&(i=o-1);let a=r*o-i,s=e[Math.max(0,i-1)],c=e[i],u=e[i+1],d=e[Math.min(n-1,i+2)],p=a*a,m=p*a,l=[0,0,0];for(let f=0;f<3;f++)l[f]=.5*(2*c[f]+(-s[f]+u[f])*a+(2*s[f]-5*c[f]+4*u[f]-d[f])*p+(-s[f]+3*c[f]-3*u[f]+d[f])*m);return l}function Co(e,t,n,r,o){let i=pa($u(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=fa(fa(t,Ju(i,2.5)),[0,1.5,0]),s=[t[0]-r[0],0,t[2]-r[2]],c=pa(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let u=Math.max(1,o),d=[r[0]+c[0]*u*1.3,r[1]+u*.75,r[2]+c[2]*u*1.3];return{waypoints:[e,d,a],finalPos:a}}function Ao(e,t,n=35,r=28){let o=wo(t),i=ha(e,o),a=wo(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(r-n)*a,eased:o}}function xa(e,t,n){let r=e.position.clone(),o=new We.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new We.Vec3(n[0],n[1],n[2]));let i=new We.Quat().copy(e.quaternion);return e.position.copy(r),e.quaternion.copy(o),i}var Mn=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new We.Quat;this.endQuat=new We.Quat;this.outQuat=new We.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,r,o=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=o,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:r,fov:o,eased:i}=Ao(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,Po(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=o,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 va=Zn,ed=.12,td=.25,nd=1.5;function Sa(e,t,n=0,r,o){let i=[t.x*G,n+nd,t.y*G],a=o?[o[0],o[1],o[2]]:i,s=e[1],c=Number.isFinite(s)?s+va:Number.isFinite(r)?n+r:n+va,u=i[0]-e[0],d=i[2]-e[2],p=Math.hypot(u,d),m=p>.001?Math.min(ed,p*td):0,l=p>.001?u/p:0,f=p>.001?d/p:0;return{eye:[e[0]+l*m,c,e[2]+f*m],focal:a}}var st=Math.PI/180,od=45,Ma=80,wn=70,rd=1,id=.99;function ad(e,t){if(!(e<rd))return Ma;if(!(Number.isFinite(t)&&t>0))return wn;let n=2*Math.atan(t/(2*Pn*id)/Math.max(.05,e))/st;return Math.max(wn,Math.min(Ma,n))}var sd=.25,Pn=1,cd=.25,ld=12*st,ud=.2,dd=1.5,wa=.8,Pa=6,Ia=1.9,md=2/3,fd=.12,pd=.9,hd=1.2,bd=2,Ea=.05,yd=6;function Ta(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+wa,t[1]),t[2]+6]};let r=1/0,o=-1/0,i=1/0,a=-1/0,s=n;for(let f of e)r=Math.min(r,f.cx-f.halfX),o=Math.max(o,f.cx+f.halfX),i=Math.min(i,f.cz-f.halfZ),a=Math.max(a,f.cz+f.halfZ),s=Math.max(s,f.y);let c=o-r,u=a-i,d=Math.max(c,Math.min(u,Pa))/2,p=Math.max(u,Math.min(c,Pa))/2,m=(r+o)/2,l=(i+a)/2;return{min:[m-d,n,l-p],max:[m+d,Math.max(n+wa,s),l+p]}}function gd(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+Ia,e.max[2]]}}function Ro(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+dd,t+ud,t+Ia*md),(e.min[2]+e.max[2])/2]}function _a(e,t){let n=e[0]-t[0],r=e[2]-t[2],o=Math.hypot(n,r);return o<.001?{x:0,z:1}:{x:n/o,z:r/o}}function Ca(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(r,o,i)||1;r/=a,o/=a,i/=a;let s=-i,c=r,u=Math.hypot(s,c);if(u<1e-6)return 1/0;s/=u,c/=u;let d=1/0,p=-1/0;for(let m=0;m<8;m++){let l=(m&1?n.max[0]:n.min[0])-e[0],f=(m&2?n.max[1]:n.min[1])-e[1],h=(m&4?n.max[2]:n.min[2])-e[2],y=Math.max(Ea,l*r+f*o+h*i),b=(l*s+h*c)/y;b<d&&(d=b),b>p&&(p=b)}return p-d}function Aa(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(r,o,i)||1;r/=a,o/=a,i/=a;let s=-i,c=r,u=Math.hypot(s,c);if(u<1e-6)return 1/0;s/=u,c/=u;let d=-c*o,p=c*r-s*i,m=s*o,l=1/0,f=-1/0;for(let h=0;h<8;h++){let y=(h&1?n.max[0]:n.min[0])-e[0],b=(h&2?n.max[1]:n.min[1])-e[1],x=(h&4?n.max[2]:n.min[2])-e[2],g=Math.max(Ea,y*r+b*o+x*i),v=(y*d+b*p+x*m)/g;v<l&&(l=v),v>f&&(f=v)}return f-l}function Cn(e,t){return Math.tan(e*st/2)*Math.max(.05,t)}function Ra(e,t,n){let r=ad(n,e),o=c=>Math.max(od,Math.min(r,c)),i=c=>2*Math.atan(c)/st,a=Number.isFinite(e)&&e>0?o(i(e/(2*sd)/Math.max(.05,n))):r;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,o(i(t/(2*fd))));return e/(2*Cn(s,n))>Pn?a:s}function ka(e,t,n){let r=Ro(t),o=[e[0],e[1],e[2]],i=0,a=0,s=l=>{if(!(l>0))return;let f=_a(o,r);o[0]+=f.x*l,o[2]+=f.z*l,a+=l},c=t.max[1]+cd-o[1];c>0&&(o[1]+=c,i=c,s(c/Math.tan(ld)));let u=gd(t),d=Ca(o,r,t),p=Ra(d,Aa(o,r,u),n),m=d/(2*Cn(p,n));for(let l=0;l<yd&&m>Pn;l++){let f=Math.max(1,Math.hypot(o[0]-r[0],o[2]-r[2])),h=Number.isFinite(m)?m/Pn:2;s(Math.min(60,f*(Math.min(4,h)-1)+.5)),d=Ca(o,r,t),p=Ra(d,Aa(o,r,u),n),m=d/(2*Cn(p,n))}return{eye:o,focal:r,fov:p,raisedM:i,pulledBackM:a,stageFrameWidth:m}}function xd(e,t,n){let r=Math.tan(t*st/2),o=Cn(t,n);return Math.max(1,e/Math.max(.05,Math.min(r,o)))}function La(e,t){let{aspect:n,venue:r}=t,o=e.focal,i=_a(e.eye,o),a=m=>(m[0]-o[0])*i.x+(m[2]-o[2])*i.z,s=[{name:"seat",eye:e.eye,focal:o,fov:e.fov}],c=bd*(t.rowDepthM??pd);s.push({name:"row",eye:[e.eye[0]+i.x*c,e.eye[1]+hd,e.eye[2]+i.z*c],focal:o,fov:e.fov});let u=(m,l,f,h)=>{let y=xd(f,e.fov,n)*1.08,b=y*Math.sin(h*st),x=y*Math.cos(h*st);return{name:m,eye:[l[0]+i.x*x,l[1]+b,l[2]+i.z*x],focal:l,fov:e.fov}};t.section&&t.section.radius>0&&s.push(u("section",t.section.center,t.section.radius,14)),s.push(u("venue",r.center,Math.max(1,r.radius),26));let d=[],p=-1/0;for(let m of s){let l=a(m.eye);d.length&&l<=p+.5||(d.push(m),p=l)}return d}var Ba=require("ogl"),zt=Math.PI/180,Fa=320,Da=70*zt,vd=32*zt,Sd=24*zt,Oa=.0026,Md=.22,wd=.006,Pd=180,Cd=4,Se=(e,t,n)=>Math.max(t,Math.min(n,e)),Va=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function Na(e){let{canvas:t,camera:n}=e,r=[],o=!1,i=0,a=0,s=0,c=0,u=0,d=0,p=!1,m=[0,0],l=0,f=!1,h=null,y=null,b=new Map,x=!1,g=0,v=0,P=0,S=0,C=()=>o&&r.length?r[Se(Math.round(i),0,r.length-1)].name:null,T=()=>{let w=C();w!==h&&(h=w,e.onStopChange?.(w))},B=()=>{if(!o||!r.length)return;let w=r[Se(Math.floor(i),0,r.length-1)],L=r[Se(Math.ceil(i),0,r.length-1)],I=Se(i-Math.floor(i),0,1),O=(Le,Pe)=>Le+(Pe-Le)*I,j=[O(w.eye[0],L.eye[0]),O(w.eye[1],L.eye[1]),O(w.eye[2],L.eye[2])],U=[O(w.focal[0],L.focal[0]),O(w.focal[1],L.focal[1]),O(w.focal[2],L.focal[2])],N=U[0]-j[0],F=U[1]-j[1],K=U[2]-j[2],X=Math.hypot(N,F,K)||1,Q=Math.atan2(N,K),W=Math.asin(Se(F/X,-1,1)),Z=Q+a,$=Se(W+s,-80*zt,80*zt),te=Math.cos($)*X;N=Math.sin(Z)*te,F=Math.sin($)*X,K=Math.cos(Z)*te,n.position.set(j[0],j[1],j[2]),n.fov=O(w.fov,L.fov),n.updateProjectionMatrix(),n.lookAt(new Ba.Vec3(j[0]+N,j[1]+F,j[2]+K)),e.onApplied?.()},z=()=>{if(!o||!r.length)return;let w=Se(Math.round(i),0,r.length-1);if(e.reducedMotion()){p=!1,i=w,B(),T(),e.requestRender();return}if(Math.abs(w-i)<.001){p=!1,T();return}c=i,u=w,d=performance.now(),p=!0,e.requestRender()},D=w=>{!o||r.length<2||(p=!1,i=Se(i+w,0,r.length-1),B(),T(),e.requestRender())},k=(w,L)=>{o&&(p=!1,f=!1,a=Se(a-w*Oa,-Da,Da),s=Se(s-L*Oa,-Sd,vd),B(),e.requestRender())},A=w=>{o&&(b.set(w.pointerId,{x:w.clientX,y:w.clientY}),b.size===1?(x=!0,S=0,g=w.clientX,v=w.clientY):b.size===2&&(x=!1,P=_()))},_=()=>{let w=[...b.values()];return w.length<2?0:Math.hypot(w[0].x-w[1].x,w[0].y-w[1].y)},V=w=>{if(!o||!b.has(w.pointerId))return;if(b.set(w.pointerId,{x:w.clientX,y:w.clientY}),b.size>=2){let O=_();P>0&&D((P-O)*wd),P=O;return}if(!x)return;let L=w.clientX-g,I=w.clientY-v;g=w.clientX,v=w.clientY,S+=Math.abs(L)+Math.abs(I),!(S<=Cd)&&k(L,I)},M=w=>{b.delete(w.pointerId)&&(b.size<2&&(P=0),b.size===0&&(x=!1,z()))},R=w=>{if(!o)return;w.preventDefault();let L=w.deltaMode===1?16:w.deltaMode===2?100:1,I=Se(w.deltaY*L/100,-2,2);D(I*Md),y&&clearTimeout(y),y=setTimeout(()=>{y=null,z()},Pd)},E=()=>{o&&(o=!1,p=!1,f=!1,r=[],b.clear(),x=!1,y&&(clearTimeout(y),y=null),h!==null&&(h=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",A),t.addEventListener("pointermove",V),t.addEventListener("pointerup",M),t.addEventListener("pointercancel",M),t.addEventListener("wheel",R,{passive:!1}),{get active(){return o},enter(w){if(w.length<2){E();return}r=w,o=!0,i=0,a=0,s=0,p=!1,f=!1,h=null,B(),T(),e.requestRender()},exit:E,recentre(){return o?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(f=!1,a=0,s=0,B(),e.requestRender(),!0):(m=[a,s],l=performance.now(),f=!0,e.requestRender(),!0):!1},update(w){if(!o)return!1;let L=!1;if(f){let I=Se((w-l)/Fa,0,1),O=1-Va(I);a=m[0]*O,s=m[1]*O,I>=1?(f=!1,a=0,s=0):L=!0}if(p){let I=Se((w-d)/Fa,0,1);i=c+(u-c)*Va(I),I>=1?(p=!1,i=u,T()):L=!0}return B(),L},currentStop:C,dispose(){E(),t.removeEventListener("pointerdown",A),t.removeEventListener("pointermove",V),t.removeEventListener("pointerup",M),t.removeEventListener("pointercancel",M),t.removeEventListener("wheel",R)}}}function Ga(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var _o=null;function Ja(){return _o??=Promise.resolve().then(()=>($a(),Za)).catch(e=>{throw _o=null,e}),_o}var es=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),kn=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,r,o){this.emit("3d_opened",{seats:t,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...o===void 0?{}:{prepSource:o}})}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=es(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(es()-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 ts(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function ns(e){let{container:t,model:n,opts:r,expandedSeatById:o,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let p=a();Object.assign(s.style,p?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},u=()=>{s?.remove(),s=null};return{show:(p,m,l=!1)=>{if(u(),e.isDisposed())return null;let f=document.createElement("div");f.setAttribute("role","group"),Object.assign(f.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let h=r.chrome?.caption!==!1,y=r.chrome?.seatStepper!==!1;if(!h&&!y)return null;let b=o.get(p),x=b?.sectionId?n.sections.find(z=>z.id===b.sectionId):void 0,g=b?.label??p;f.setAttribute("aria-label",`Explore views near ${x?.label?`${x.label}, `:""}seat ${g}`);let v=document.createElement("span");v.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",x?.label,g].filter(Boolean).join(" \xB7 "),Object.assign(v.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)"}),h&&f.appendChild(v);let P=document.createElement("div");Object.assign(P.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),f.appendChild(P);let S=b?.rowId?i.get(b.rowId):void 0,C=S?.indexOf(p)??-1,T=C>=0?[S?.[C-1],S?.[C+1]]:[void 0,void 0],B=(z,D,k,A=!1)=>{let _=document.createElement("button");_.type="button",_.textContent=z,_.setAttribute("aria-label",D),Object.assign(_.style,{minHeight:"44px",padding:A?"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"}),A||(_.style.minWidth="44px"),A&&(_.dataset.panoramaTrigger=""),_.addEventListener("click",k),P.appendChild(_)};if(y&&T[0]){let z=o.get(T[0])?.label??T[0];B("\u2039",`View previous seat ${z}`,()=>{e.flyToSeat(T[0])})}if(y&&r.getSeatView){let z=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";B(l?`\u21BB Retry ${z}`:`\u25C9 ${z}`,`${l?"Retry":z} from seat ${g}`,()=>{if(e.isDisposed()||m!==e.flightGen()){u();return}u(),e.openPanorama(p,400,m)},!0)}if(y&&T[1]){let z=o.get(T[1])?.label??T[1];B("\u203A",`View next seat ${z}`,()=>{e.flyToSeat(T[1])})}return!P.childElementCount&&!h?null:(t.appendChild(f),s=f,c(),f)},remove:u,layout:c}}function os(e){let{container:t,orbit:n,isNarrow:r}=e,o=document.createElement("div"),i=!1;o.className="sl-3d-navigation-controls",Object.assign(o.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let a=document.createElement("div");a.setAttribute("role","group"),a.setAttribute("aria-label","3D drag mode"),Object.assign(a.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let s=document.createElement("div");s.setAttribute("role","group"),s.setAttribute("aria-label","3D view controls"),Object.assign(s.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let c=document.createElement("button");c.type="button",c.textContent="\u21BB",c.setAttribute("aria-label","Drag to rotate the 3D venue"),c.dataset.tooltip="Rotate venue";let u=document.createElement("button");u.type="button",u.textContent="\u2725",u.setAttribute("aria-label","Drag to move the 3D venue left, right, up or down"),u.dataset.tooltip="Move venue";let d=document.createElement("button");d.type="button",d.textContent="\u2212",d.setAttribute("aria-label","Zoom out of the 3D venue"),d.dataset.tooltip="Zoom out";let p=document.createElement("button");p.type="button",p.textContent="+",p.setAttribute("aria-label","Zoom into the 3D venue"),p.dataset.tooltip="Zoom in";for(let y of[c,u,d,p])y.className="sl-3d-icon-control",Object.assign(y.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"});a.append(c,u),s.append(p,d);let m=y=>{n.setPrimaryDragMode(y);let b=y==="orbit";c.setAttribute("aria-pressed",String(b)),u.setAttribute("aria-pressed",String(!b)),c.style.background=b?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",u.style.background=b?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",o.title=b?"Drag to rotate \xB7 Shift-drag to move":"Drag to move \xB7 Shift-drag to rotate"};c.addEventListener("click",()=>m("orbit")),u.addEventListener("click",()=>m("pan")),d.addEventListener("click",()=>n.zoomBy(1.22)),p.addEventListener("click",()=>n.zoomBy(.82)),o.append(a,s),m("orbit"),t.appendChild(o);let l=e.enabled!==!1,f=()=>{let y=r();o.style.display=i||!l?"none":"flex",o.style.right=y?"12px":"14px",o.style.bottom=y?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",a.style.display=y?"none":"flex",p.style.display=y?"none":"",d.style.display=y?"none":""};return f(),{element:o,utilityControls:s,setNavigationMode:m,setSeatViewLocked:y=>{i=y,n.setInteractionEnabled(!y),f()},seatViewLocked:()=>i,layout:f}}function rs(e){let{glctx:t,orbit:n,model:r,seats:o,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:u,tapSlop:d,tapMs:p,cancelFlight:m,focusSectionCamera:l,setSelection:f,ensureSeatView:h}=e,y=0,b=0,x=0,g=-1,v=!1,P=!1,S=D=>{e.seatViewLocked()||g===-1&&(g=D.pointerId,y=D.clientX,b=D.clientY,x=performance.now(),v=!1,P=a.active,a.active&&(s.cinematicCancelled(),m(),i.onViewTargetChange?.(null)))},C=D=>{D.pointerId===g&&Math.hypot(D.clientX-y,D.clientY-b)>d&&(v=!0)},T=(D,k,A,_,V)=>{let M=t.canvas.getBoundingClientRect(),R=t.canvas.clientWidth||M.width||1,E=t.canvas.clientHeight||M.height||1,w=D-M.left,L=k-M.top,I=_*_,O=-1,j=I,U=1/0;for(let N of o){if(A&&N.sectionId!==A)continue;let F=r.seats.idToIndex.get(N.id);if(F===void 0)continue;if(V){let $=Math.round(r.seats.iState[F]??0);if($!==0&&$!==3)continue}let K=F*3,X=Ye(n.camera.projectionViewMatrix,[r.seats.iPosition[K],r.seats.iPosition[K+1]+.55,r.seats.iPosition[K+2]],R,E);if(!X.visible)continue;let Q=X.x-w,W=X.y-L,Z=Q*Q+W*W;(Z<j||Math.abs(Z-j)<1&&X.depth<U)&&(O=F,j=Z,U=X.depth)}return O},B=(D,k)=>{let A=e.gpu(),_=e.pick();if(!A||!_)return-1;_.syncFromSeatProgram(A.seatProgram);let V=t.canvas.getBoundingClientRect(),M=t.renderer.dpr,{x:R,y:E}=ua(D,k,V,M,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),w=Math.max(2,Math.round(8*M));return _.pick(n.camera,R,E,w)};return{onDown:S,onMove:C,onUp:D=>{if(D.pointerId!==g)return;let k=!v&&performance.now()-x<p;if(g=-1,P){P=!1;return}let A=e.gpu(),_=e.pick();if(!k||!A||!_)return;let V=B(D.clientX,D.clientY);if(e.focusedSectionId()&&V>=0){let E=c[V],w=E?u.get(E):void 0;if(w&&w!==e.focusedSectionId()&&l(w))return}if(e.focusedSectionId()&&V<0&&(V=T(D.clientX,D.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&V<0){let E=T(D.clientX,D.clientY,null,72,!1),w=E>=0?c[E]:void 0,L=w?u.get(w):void 0;if(L&&L!==e.focusedSectionId()&&l(L))return}if(!e.focusedSectionId()){V<0&&(V=T(D.clientX,D.clientY,null,42,!1));let E=V>=0?c[V]:void 0,w=E?u.get(E):void 0;if(w&&l(w))return}if(V<0||V>=c.length){e.selection().size&&(f([]),i.onViewTargetChange?.(null));return}let M=c[V],R=fe[Math.round(r.seats.iState[V]??0)]??"available";if(R!=="available"&&R!=="selected"){i.onSeatInspect?.(M,R);return}if(e.selection().has(M)&&e.selection().size===1){f([]),i.onViewTargetChange?.(null),i.onSeatPick?.(M);return}f([M]),h(M),s.seatPicked(M,u.get(M)),i.onSeatPick?.(M)}}}var Ln=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,r=1/0,o=-1/0,i=-1/0;for(let l=0;l<this.count;l++){let f=t[l*3],h=t[l*3+2];f<n&&(n=f),f>o&&(o=f),h<r&&(r=h),h>i&&(i=h)}let a=Math.max(o-n,.001),s=Math.max(i-r,.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=r;let c=this.cols*this.rows,u=new Int32Array(c+1),d=l=>{let f=Math.min(this.cols-1,Math.max(0,Math.floor((t[l*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[l*3+2]-r)/this.cell)))*this.cols+f};for(let l=0;l<this.count;l++)u[d(l)+1]++;for(let l=0;l<c;l++)u[l+1]+=u[l];let p=new Int32Array(this.count),m=u.slice(0,c);for(let l=0;l<this.count;l++)p[m[d(l)]++]=l;this.cellStart=u,this.cellItems=p}gather(t,n,r,o){this.ensureGrid();let i=this.cellStart,a=this.cellItems;if(!i||!a)return 0;let s=o.length,c=r*r,u=Math.floor((t-this.minX)/this.cell),d=Math.floor((n-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,m=this.iPosition,l=0;for(let f=0;f<=p&&l<s;f++){let h=d-f,y=d+f,b=u-f,x=u+f;for(let g=h;g<=y&&l<s;g++){if(g<0||g>=this.rows)continue;let v=g===h||g===y;for(let P=b;P<=x&&l<s;P++){if(!v&&P!==b&&P!==x){P=x-1;continue}if(P<0||P>=this.cols)continue;let S=g*this.cols+P;for(let C=i[S],T=i[S+1];C<T&&l<s;C++){let B=a[C],z=m[B*3]-t,D=m[B*3+2]-n;z*z+D*D<=c&&(o[l++]=B)}}}}return l}};var Fn=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array($t);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new Ln(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,r=this.ctx.gpu();if(!r)return;if(!t){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let o=this.ctx.orbit().camera.position;if(Math.hypot(o.x-this.lastGatherX,o.z-this.lastGatherZ)<jn)return;if(this.lastGatherX=o.x,this.lastGatherZ=o.z,Math.hypot(o.x-n.bounds.center[0],o.z-n.bounds.center[2])-n.bounds.radius>Un){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(o.x,o.z,Un,this.nearBuf);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(t,n,r){let o=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?o:i),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?o:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};var Dn=require("ogl");function is(){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 as(e){let{container:t,model:n,opts:r,orbit:o,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:u,overviewFraming:d}=e,p=0,m=-1,l=(P,S,C=28)=>{o.camera.position.set(P[0],P[1],P[2]),o.camera.lookAt(new Dn.Vec3(S[0],S[1],S[2])),o.camera.fov=C,o.camera.updateProjectionMatrix()},f=document.createElement("button");f.className="sl-3d-overview-control sl-3d-icon-control",f.type="button",f.replaceChildren(is()),f.setAttribute("aria-label","Fit the active level or whole venue in view"),f.dataset.tooltip="Fit view",Object.assign(f.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 h=()=>{f.firstElementChild||f.replaceChildren(is())};h();let y=P=>{m=P;let S=e.gpu();S&&(S.seatProgram.uniforms.uFocusFloor.value=P,S.solidProgram.uniforms.uFocusFloor.value=P,S.chairProgram.uniforms.uFocusFloor.value=P),e.showSectionSeatLabels(null)},b=()=>{if(e.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),f.style.display="",c.setVisible(!0),e.setFrozen(!1);let P=m>=0?n.floors[m]:null;if(e.setNearFieldDetailEnabled(!!P),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("orbit"),P){let S=P.focalWorld[0]-P.center[0],C=P.focalWorld[2]-P.center[2],T=Math.hypot(S,C)>P.radius*.12?Math.atan2(S,C):u,B={center:P.center,radius:P.radius,box:P.box},z={polarDeg:58,margin:1.12};e.reducedMotion()?o.frame(B,!1,T,!1,z):o.frameSoft(B,T,!1,z)}else e.reducedMotion()?o.frame(n.bounds,!1,u,r.portraitOverviewCrop===!0,d):o.frameSoft(n.bounds,u,r.portraitOverviewCrop===!0,d);e.showSectionSeatLabels(null),s.requestRender()},x=()=>{p++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),o.resumeAfterFlight(n.focalWorld))},g=P=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let S=n.seats.idToIndex.get(P);if(S===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(P),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),f.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let C=e.inSeatView()&&r.arriveAtSeatEye===!0;e.setSeatStepping(C),e.setSeatViewLocked(!1);let T=++p;C?e.showArriveChip(P,T):e.removeArriveChip();let{eye:B,focal:z}=e.resolvedSeatViewPose(P,S),D=r.arriveAtSeatEye?e.seatViewArrival(P,S):null,k=D?D.focal:z,A=[o.camera.position.x,o.camera.position.y,o.camera.position.z],_=Co(A,D?.eye??B,k,n.bounds.center,n.bounds.radius),V=D?D.eye:r.arriveAtSeatEye?B:_.finalPos,M=D?D.fov:r.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?wn:65:28,R=[_.waypoints[0],_.waypoints[1],V];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),l(V,k,M),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||o.syncFromCamera(),e.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&e.enterSeatView(D.stops),e.showArriveChip(P,T),Promise.resolve();let E=new Dn.Quat().copy(o.camera.quaternion),w=xa(o.camera,V,k);s.requestRender();let L=C?700:2500;return i.start(R,E,w,L,M).then(()=>{e.isDisposed()||T!==p||(e.setSeatStepping(!1),a.cinematicPlayed(L),o.resumeAfterFlight(k),e.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&e.enterSeatView(D.stops),s.requestRender(),e.showArriveChip(P,T))})},v=P=>{let S=n.sections.find(z=>z.id===P);if(!S||S.seatCount===0)return!1;e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&m!==S.floorIndex&&y(S.floorIndex),e.setNavigationMode("pan"),e.showSectionSeatLabels(P);let C=S.focalWorld[0]-S.center[0],T=S.focalWorld[2]-S.center[2],B=Math.hypot(C,T)>S.radius*.12?Math.atan2(C,T):void 0;return o.frame({center:S.center,radius:Math.max(5,S.radius*.5)},!1,B),r.onSectionFocusChange?.(P),s.requestRender(),!0};return f.addEventListener("click",b),{overviewChip:f,layoutOverviewChip:h,flightGen:()=>p,focusedFloor:()=>m,applyFloorFocus:y,placeCameraFinal:l,cancelFlight:x,focusOverview:b,flyToSeat:g,focusSectionCamera:v}}var zd={};function ss(e){let t=performance.now();return{model:gt(e),buildMs:performance.now()-t,source:"main"}}function Gd(e){let t=Hr(e.doc);return{...ss({...e,seats:t}),seats:t}}function cs(e,t,n){if(typeof Worker>"u")return Promise.resolve(t());let r;try{r=new Worker(new URL("./scene/scene.worker.js",zd.url),{type:"module"})}catch{return Promise.resolve(t())}return new Promise(o=>{let i=!1,a=u=>{i||(i=!0,clearTimeout(c),r.terminate(),o(u))},s=()=>a(t()),c=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=u=>{let d=n(u.data);d?a(d):s()},r.postMessage(e)})}function ls(e){return cs(e,()=>ss(e),({model:t,buildMs:n})=>({model:t,buildMs:n,source:"worker"}))}function us(e){return cs(e,()=>Gd(e),({model:t,buildMs:n,seats:r})=>r?{model:t,buildMs:n,seats:r,source:"worker"}:null)}var Hd=Math.PI/180,Ud=6,jd=500;function Yd(e,t,n={}){let r=performance.now(),o=t.prepared?.model??gt(t),i=new kn(n.onAnalytics),a=new Array(o.seats.count);for(let[H,Y]of o.seats.idToIndex)a[Y]=H;let s=new Map(t.seats.map(H=>[H.id,H])),c=new Map;for(let H of t.seats){if(!H.rowId)continue;let Y=c.get(H.rowId);Y?Y.push(H.id):c.set(H.rowId,[H.id])}let u=new Map;for(let H of t.seats)u.set(H.id,H.sectionId);let d=new Map;for(let[H,Y]of o.seats.idToIndex){let q=u.get(H);if(!q)continue;let ee=d.get(q);ee?ee.push(Y):d.set(q,[Y])}let p=()=>{if(!l||!o.sectionSolidRanges.length)return;let{lit:H,anyUnlit:Y}=ia(o.sectionSolidRanges,d,o.seats.iState);l.setSectionShellLit(Y?H:null)},m=t.doc.floors?.some(Y=>(Y.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(Y=>Y.objects)??t.doc.objects).some(Y=>Y.type==="section"&&((Y.height??0)>0||(Y.rake??0)>0)),l=null,f=null,h=!1,y=!1,b=!1,x=new Map,g=null,v=null,P=null,S=new Map,C=null,T=()=>{P===null&&(P=e.style.zIndex,e.style.zIndex="20")},B=()=>{P!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=P),P=null)},z=!1,D=()=>z?be.focusedFloor():-1,k=()=>{l=ca(M.gl,o),p(),f=new Sn(M.renderer,l.seatGeometry,l.chairGeometry,l.solidGeometry,o.seats.count),M.setClearColor(o.theme.background.top),f.setRestoreClear(o.theme.background.top),l.seatProgram.uniforms.uSeatRadius.value=De*o.theme.seatScale,l.seatProgram.uniforms.uFocusFloor.value=D(),l.solidProgram.uniforms.uFocusFloor.value=D(),l.chairProgram.uniforms.uFocusFloor.value=D(),l.screenProgram&&(l.screenProgram.uniforms.uFocusFloor.value=D()),_.forceRegather()},A=!1,_=new Fn({model:o,orbit:()=>R,gpu:()=>l}),V=H=>_.setDetailEnabled(H),M=new qt(e,{onContextLost:()=>{b||i.contextLost(),h=!0,W.stop(),l=null,f=null},onContextRestored:()=>{k(),h=!1,b||i.contextRestored(),W.requestRender()}}),R=new Qt(M.gl,M.canvas,()=>W.requestRender(),()=>i.orbitEngaged());R.setAspect(M.aspect);let E=(t.doc.floors?.flatMap(H=>H.objects)??t.doc.objects).some(H=>H.type==="section"&&H.physical3dProvenance?.surfaceKind?.status==="inferred"),w=(()=>{if(E&&o.stages.length===0)return;let H=o.focalWorld[0]-o.bounds.center[0],Y=o.focalWorld[2]-o.bounds.center[2];return Math.hypot(H,Y)>o.bounds.radius*.12?Math.atan2(H,Y):void 0})(),L=o.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},I=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;R.frame(o.bounds,!I&&n.skipInitialOverviewAnimation!==!0,w,n.portraitOverviewCrop===!0,L);let O=new Mn(R.camera),j=ts(e),U=new gn(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),N=o.labels,F=()=>Ai(N,o.floors.length,D());U.setLabels(F());let K=null,X=H=>{if(K=H,U.setForcedDense(!!H),!H){U.setLabels(F());return}let Y=t.seats.filter(J=>J.sectionId===H),q=new Set(Y.map(J=>J.id)),ee=new Set(Y.map(J=>J.rowId)),re=new Set(x.keys()),ie=new Set(Y.filter(J=>re.has(J.id)).map(J=>J.id)),se=F().filter(J=>J.kind!=="row"&&J.kind!=="seat"||(J.kind==="row"?ee.has(J.id.slice(4)):q.has(J.id.slice(5))&&(ie.size===0||ie.has(J.id.slice(5)))));if(o.seatCount<=6e3&&ie.size===0){U.setLabels(se);return}let de=ie.size?Y.filter(J=>ie.has(J.id)):Y,Ze=new Set(de.map(J=>`seat:${J.id}`)),He=de.flatMap(J=>{let ye=o.seats.idToIndex.get(J.id);if(ye===void 0)return[];let Re=ye*3;return[{id:`seat:${J.id}`,kind:"seat",text:J.displayLabel||J.label,anchor:[o.seats.iPosition[Re],o.seats.iPosition[Re+1]+(re.has(J.id)?1.05:.55),o.seats.iPosition[Re+2]]}]});U.setLabels([...se.filter(J=>!Ze.has(J.id)),...He])};k();let Q=null,W=new Zt(H=>{if(h||!l||y)return!1;let Y=Ga({flying:O.active,panoramaMounted:g!==null,seatViewActive:Q?.active===!0}),q=Y==="cinematic"?O.update(performance.now()):Y==="seatView"?Q.update(performance.now()):Y==="orbit"?R.update():!1,ee=D()>=0?o.floors[D()]:null,re=ee?.radius??o.bounds.radius,ie=qo(R.currentDistance,re),se=A?{center:[R.camera.position.x,R.camera.position.y,R.camera.position.z],radius:520}:o.renderBounds;R.updateClipping(se);let de=ee?.center??o.renderBounds.center,Ze=ee?.radius??o.renderBounds.radius,He=(Ie,Pt)=>Math.hypot(R.camera.position.x-Ie[0],R.camera.position.y-Ie[1],R.camera.position.z-Ie[2])<=Pt*(_.detailVisible?1.8:1.55),J=He(de,Ze);if(!J&&K){let Ie=o.sections.find(Pt=>Pt.id===K);Ie&&(J=He(Ie.center,Math.max(12,Ie.radius*2)))}_.detailVisible=J;let ye=l.seatProgram.uniforms;ye.uSeatScale.value=ie.scale,ye.uSeatFade.value=ie.fade;let Re=!!ee&&Qo(ee.seatCount,M.canvas.clientWidth||1,M.canvas.clientHeight||1),Yt=Zo(o.seats.count,re,R.currentDistance,R.camera.fov,M.canvas.clientHeight||1),wt=_.detailVisible||Re||Yt?1:0,Xt=_.detailVisible||D()>=0||o.floors.length>1?1:0;return _.ease(H,wt,Xt),ye.uSeatDetail.value=_.seatDetailMix,l.solidProgram.uniforms.uStructureDetail.value=_.structureDetailMix,ye.uMinPixels.value=ie.minPixels,ye.uPixelToWorld.value=2*Math.tan(R.camera.fov*Hd/2)/Math.max(1,M.pixelHeight),_.update(_.detailVisible),M.renderer.render({scene:l.background,clear:!0}),M.renderer.render({scene:l.main,camera:R.camera,clear:!1}),U.update(R.camera.projectionViewMatrix,M.canvas.clientWidth||1,M.canvas.clientHeight||1,R.currentDistance,re,[R.camera.position.x,R.camera.position.y,R.camera.position.z]),q||_.seatDetailMix!==wt||_.structureDetailMix!==Xt}),Z=typeof ResizeObserver<"u"?new ResizeObserver(()=>Vn.resize()):null;Z?.observe(e);let $=H=>{let Y=re=>{let ie=o.seats.idToIndex.get(re);return ie===void 0?void 0:o.seats.iState[ie]},{updates:q,next:ee}=ma(x,H,Y);if(x=ee,U.setSelectedSeatIds(x.keys()),K&&X(K),q.length){let re=$n(o.seats,q);l&&l.uploadSeatStateRuns(re),p(),W.requestRender()}},te=()=>C!==null?C:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Le=8,Pe=H=>{if(!n.getSeatView)return null;let Y=S.get(H);if(!Y)for(Y=Promise.resolve(n.getSeatView(H)),S.set(H,Y),Y.catch(()=>{S.get(H)===Y&&S.delete(H)});S.size>Le;){let q=S.keys().next().value;if(q===void 0)break;S.delete(q)}return Y},Be=Ta(o.stages,o.focalWorld,o.bounds.groundY??0),Ne=Ro(Be),Ae=(H,Y)=>{let q=s.get(H),ee=Math.max(0,Math.round(o.seats.iFloor[Y]??0)),re=t.doc.floors?.[ee],ie=o.floors[ee],se=re?.focalPoint??t.doc.focalPoint,de=ie?{x:ie.focalWorld[0]/G,y:ie.focalWorld[2]/G}:se,Ze=q?.focalPoint?{x:q.focalPoint.x+de.x-se.x,y:q.focalPoint.y+de.y-se.y}:de,He=[o.seats.iPosition[Y*3],o.seats.iPosition[Y*3+1],o.seats.iPosition[Y*3+2]];return Sa(He,Ze,re?.baseHeightM??0,q?.eyeHeightM,Ne)},Ce=()=>(e.clientWidth||M.canvas.clientWidth)<=520,me=null,qe=null,vt=async(H,Y,q)=>{if(!n.getSeatView||b||q!==be.flightGen())return;let ee;try{ee=await Ja()}catch{if(i.panoramaFailed(H,"mount"),!b&&q===be.flightGen()){let re=Fe(H,q,!0);requestAnimationFrame(()=>re?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(b||q!==be.flightGen()||!me))return qe??=ee.createOpenPanorama(me),qe(H,Y,q)},Ge=ns({container:e,model:o,opts:n,expandedSeatById:s,seatIdsByRow:c,isNarrow:Ce,isDisposed:()=>b,flightGen:()=>be.flightGen(),flyToSeat:H=>Fo(H),openPanorama:(H,Y,q)=>vt(H,Y,q)}),Fe=Ge.show,Qe=Ge.remove,Ut=Ge.layout,ct=os({container:e,orbit:R,isNarrow:Ce,enabled:n.chrome?.controlDock!==!1}),ds=ct.element,St=ct.setNavigationMode,ms=ct.layout,fs=ct.utilityControls,Mt=null,ko=!1,jt=H=>{ct.setSeatViewLocked(H),H||Q?.exit()};Q=Na({canvas:M.canvas,camera:R.camera,requestRender:()=>W.requestRender(),reducedMotion:te,onStopChange:H=>{let Y=H??(ko?"seat":null);Mt=Y;try{n.onSeatViewStopChange?.(Y)}catch{}},onApplied:()=>{b||R.syncFromCamera()}});let ps=(H,Y)=>{let{eye:q}=Ae(H,Y),ee=(e.clientWidth||M.canvas.clientWidth||1)/Math.max(1,e.clientHeight||M.canvas.clientHeight||1),re=ka(q,Be,ee);if(n.seatViewStops===!1)return{...re,stops:[]};let ie=u.get(H),se=ie?o.sections.find(de=>de.id===ie):void 0;return{...re,stops:La(re,{aspect:ee,section:se&&se.seatCount>0?{center:se.center,radius:se.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},be=as({container:e,model:o,opts:n,orbit:R,cinematic:O,analytics:i,loop:W,labelOverlay:U,stageAzimuth:w,overviewFraming:L,gpu:()=>l,isDisposed:()=>b,panorama:()=>g,setPanorama:H=>{g=H},setPanoramaSphereVisible:H=>{A=H},panoramaLoadAbort:()=>v,setPanoramaLoadAbort:H=>{v=H},setFrozen:H=>{y=H},restorePanoramaLayer:B,reducedMotion:te,resolvedSeatViewPose:Ae,showSectionSeatLabels:X,setNearFieldDetailEnabled:V,setSeatViewLocked:jt,setNavigationMode:St,showArriveChip:Fe,removeArriveChip:Qe,inSeatView:()=>Mt!==null,setSeatStepping:H=>{ko=H},seatViewArrival:(H,Y)=>n.arriveAtSeatEye?ps(H,Y):null,enterSeatView:H=>Q?.enter(H)});z=!0;let On=be.overviewChip,hs=be.layoutOverviewChip,bs=be.applyFloorFocus,ys=be.focusOverview,Lo=be.cancelFlight,Fo=be.flyToSeat,Do=be.focusSectionCamera;fs.appendChild(On),me={container:e,model:o,opts:n,analytics:i,orbit:R,loop:W,seatsById:s,ensureSeatView:Pe,resolvedSeatViewPose:Ae,gpu:()=>l,gl:M.gl,isContextLost:()=>h,isDisposed:()=>b,flightGen:()=>be.flightGen(),setPanorama:H=>{g=H},getLoadAbort:()=>v,setLoadAbort:H=>{v=H},setPanoramaSphereVisible:H=>{A=H,H&&Q?.exit()},setFrozen:H=>{y=H},raisePanoramaLayer:T,restorePanoramaLayer:B,getOverviewChip:()=>On,labelOverlay:U,reducedMotion:te,removeArriveChip:Qe,showArriveChip:Fe};let ze=rs({glctx:M,orbit:R,model:o,seats:t.seats,opts:n,cinematic:O,analytics:i,seatIdByIndex:a,sectionIdBySeatId:u,tapSlop:Ud,tapMs:jd,gpu:()=>l,pick:()=>f,seatViewLocked:()=>ct.seatViewLocked(),focusedSectionId:()=>K,selection:()=>x,cancelFlight:Lo,focusSectionCamera:Do,setSelection:$,ensureSeatView:Pe});M.canvas.addEventListener("pointerdown",ze.onDown),M.canvas.addEventListener("pointermove",ze.onMove),M.canvas.addEventListener("pointerup",ze.onUp),M.canvas.addEventListener("pointercancel",ze.onUp),W.requestRender();let Vn={setAvailability(H){let Y=da(x,H),q=$n(o.seats,Y);q.length&&l&&l.uploadSeatStateRuns(q),p(),W.requestRender()},setSelection:$,setNavigationMode:St,zoomIn(){R.zoomBy(.82),W.requestRender()},zoomOut(){R.zoomBy(1.22),W.requestRender()},flyToSeat:Fo,focusOverview:ys,seatViewStop:()=>Mt,recentreSeatView:()=>Q?.recentre()??!1,resize(){let{width:H,height:Y}=M.resize();R.setAspect(H/Math.max(1,Y)),Ut(),ms(),hs(),W.requestRender()},stats(){return{...W.stats(),drawCalls:l?l.drawCalls:0,seatCount:o.seatCount}},getQualityEvidence(){let H=W.stats(),Y=M.canvas.clientWidth||1,q=M.canvas.clientHeight||1,ee=o.bounds.center,re=Ye(R.camera.projectionViewMatrix,[ee[0],o.bounds.box.min[1],ee[2]],Y,q),ie=Ye(R.camera.projectionViewMatrix,[ee[0],o.bounds.box.max[1],ee[2]],Y,q),se=o.bounds.box,de=[se.min[0],se.max[0]].flatMap(J=>[se.min[1],se.max[1]].flatMap(ye=>[se.min[2],se.max[2]].map(Re=>Ye(R.camera.projectionViewMatrix,[J,ye,Re],Y,q)))).filter(J=>Number.isFinite(J.x)&&Number.isFinite(J.y)&&Number.isFinite(J.depth)),Ze=de.length?(()=>{let J=Math.min(...de.map($e=>$e.x)),ye=Math.max(...de.map($e=>$e.x)),Re=Math.min(...de.map($e=>$e.y)),Yt=Math.max(...de.map($e=>$e.y)),wt=Math.max(0,J),Xt=Math.min(Y,ye),Ie=Math.max(0,Re),Pt=Math.min(q,Yt),Wt=Math.max(0,Xt-wt),Bn=Math.max(0,Pt-Ie);return{box:{x:wt,y:Ie,width:Wt,height:Bn},horizontalFillRatio:Wt/Y,verticalFillRatio:Bn/q,visibleAreaRatio:Wt*Bn/(Y*q),clippedEdges:[...Re<0?["top"]:[],...ye>Y?["right"]:[],...Yt>q?["bottom"]:[],...J<0?["left"]:[]]}})():void 0,He=String(M.gl.getParameter(M.gl.VERSION)??"");return{viewport:{width:Y,height:q},context:{webgl2:/webgl\s*2/i.test(He),lost:h},frame:{rendered:H.rendered,idle:H.idle},camera:{position:[R.camera.position.x,R.camera.position.y,R.camera.position.z],distance:R.currentDistance,verticalFovDeg:R.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:m,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:re.visible&&ie.visible?Math.abs(re.y-ie.y):0},labels:U.qualityEvidence(),framing:Ze,...Mt?{seatView:{fovDeg:R.camera.fov,stop:Mt}}:{}}},getQualityReport(){return xn(Vn.getQualityEvidence())},loseContextForTest(){M.simulateContextLossCycle()},floors(){return o.floors},focusFloor(H){if(H!==null&&!o.floors.some(q=>q.index===H))return!1;let Y=H??-1;if(V(H!==null),jt(!1),bs(Y),St("orbit"),H===null)O.cancel(),te()?R.frame(o.bounds,!1,w,n.portraitOverviewCrop===!0,L):R.frameSoft(o.bounds,w,n.portraitOverviewCrop===!0,L);else{let q=o.floors[H];if(q.seatCount>0){O.cancel();let ee=q.focalWorld[0]-q.center[0],re=q.focalWorld[2]-q.center[2],ie=Math.hypot(ee,re)>q.radius*.12?Math.atan2(ee,re):w;R.frame({center:q.center,radius:q.radius,box:q.box},!1,ie,!1,{polarDeg:58,margin:1.12})}}return W.requestRender(),!0},zones(){return o.zones},focusZone(H){let Y=o.zones.find(ie=>ie.id===H);if(!Y||Y.seatCount===0)return!1;V(!1),jt(!1),O.cancel(),St("orbit"),X(null),n.onSectionFocusChange?.(null);let q=Y.focalWorld[0]-Y.center[0],ee=Y.focalWorld[2]-Y.center[2],re=Math.hypot(q,ee)>Y.radius*.12?Math.atan2(q,ee):void 0;return R.frame({center:Y.center,radius:Y.radius*1.25},!1,re),W.requestRender(),!0},sections(){return o.sections},focusSection(H){return Do(H)},rows(H){return H?o.rows.filter(Y=>Y.sectionId===H):o.rows},seatsInRow(H){return t.seats.filter(Y=>Y.rowId===H).map(Y=>({id:Y.id,label:Y.displayLabel||Y.label}))},focusRow(H){let Y=o.rows.find(q=>q.id===H);return!Y||Y.seatCount===0?!1:(V(!0),jt(!1),O.cancel(),St("pan"),Y.sectionId&&(X(Y.sectionId),n.onSectionFocusChange?.(Y.sectionId)),R.frame({center:Y.center,radius:Math.max(2.5,Y.radius*.65)}),W.requestRender(),!0)},setReducedMotionForTest(H){C=H},dispose(){b=!0,Qe(),On.remove(),ds.remove(),Lo(),Q?.dispose(),W.stop(),U.dispose(),Z?.disconnect(),g&&(g.dispose(),g=null),B(),j(),M.canvas.removeEventListener("pointerdown",ze.onDown),M.canvas.removeEventListener("pointermove",ze.onMove),M.canvas.removeEventListener("pointerup",ze.onUp),M.canvas.removeEventListener("pointercancel",ze.onUp),R.dispose(),f&&f.dispose(),l&&l.dispose(),l=null,f=null,M.dispose()}};return i.opened(o.seatCount,m,t.prepared?.buildMs??performance.now()-r,t.prepared?.source??"inline"),Vn}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,buildSceneModel,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|
|
641
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:j},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let W=new ce.Mesh(e,{geometry:I,program:O});W.frustumCulled=!1,W.setParent(n),F.screenProgram=O,w=!0,F.drawCalls=3+(E?1:0)+1},X.src=K.contentImageUrl}return F}var _e=require("ogl");function Qu(e,t,n){let r=e+(t<<8)+(n<<16);return r===0?-1:r-1}function la(e,t,n,r,o,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let u=0;u<t;u++){let d=(c*t+u)*4,p=Qu(e[d],e[d+1],e[d+2]);if(p<0||p>=i)continue;let m=u-r,l=c-o,f=m*m+l*l;f<s&&(s=f,a=p)}return a}function ua(e,t,n,r,o,i){let a=e-n.left,s=t-n.top,c=Math.round(a*r),u=Math.round((n.height-s)*r);return{x:Math.max(0,Math.min(o-1,c)),y:Math.max(0,Math.min(i-1,u))}}var Zu=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Sn=class{constructor(t,n,r,o,i){this.seatScene=new _e.Transform;this.chairScene=new _e.Transform;this.solidScene=new _e.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=$i(this.gl),this.chairProg=Ji(this.gl),this.depthProg=ea(this.gl);let a=new _e.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new _e.Mesh(this.gl,{geometry:r,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new _e.Mesh(this.gl,{geometry:o,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of Zu)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}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 _e.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,r,o){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,u=Math.max(0,n-o),d=Math.max(0,r-o),p=Math.max(1,Math.min(s,n+o+1)-u),m=Math.max(1,Math.min(c,r+o+1)-d);i.enable(i.SCISSOR_TEST),i.scissor(u,d,p,m);let[l,f,h]=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(l,f,h,1),i.disable(i.SCISSOR_TEST);let y=new Uint8Array(p*m*4);return this.renderer.bindFramebuffer(a),i.readPixels(u,d,p,m,i.RGBA,i.UNSIGNED_BYTE,y),this.renderer.bindFramebuffer(),la(y,p,m,n-u,r-d,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function da(e,t){let n=[];for(let r of t)e.has(r.seatId)?e.set(r.seatId,Rt(r.state)):n.push(r);return n}function ma(e,t,n){let r=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&r.add(a);let o=new Map(e),i=[];for(let[a,s]of e)r.has(a)||(i.push({seatId:a,state:fe[s]??"available"}),o.delete(a));for(let a of r){if(o.has(a))continue;let s=n(a);s!==void 0&&(o.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:o}}var We=require("ogl");function $u(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function fa(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function Ju(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function pa(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 Po(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function Co(e,t){return Math.max(0,Math.min(1,e+t))}function ha(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let r=Math.max(0,Math.min(1,t)),o=n-1,i=Math.floor(r*o);i>=o&&(i=o-1);let a=r*o-i,s=e[Math.max(0,i-1)],c=e[i],u=e[i+1],d=e[Math.min(n-1,i+2)],p=a*a,m=p*a,l=[0,0,0];for(let f=0;f<3;f++)l[f]=.5*(2*c[f]+(-s[f]+u[f])*a+(2*s[f]-5*c[f]+4*u[f]-d[f])*p+(-s[f]+3*c[f]-3*u[f]+d[f])*m);return l}function Ao(e,t,n,r,o){let i=pa($u(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=fa(fa(t,Ju(i,2.5)),[0,1.5,0]),s=[t[0]-r[0],0,t[2]-r[2]],c=pa(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let u=Math.max(1,o),d=[r[0]+c[0]*u*1.3,r[1]+u*.75,r[2]+c[2]*u*1.3];return{waypoints:[e,d,a],finalPos:a}}function Ro(e,t,n=35,r=28){let o=Po(t),i=ha(e,o),a=Po(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(r-n)*a,eased:o}}function xa(e,t,n){let r=e.position.clone(),o=new We.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new We.Vec3(n[0],n[1],n[2]));let i=new We.Quat().copy(e.quaternion);return e.position.copy(r),e.quaternion.copy(o),i}var Mn=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new We.Quat;this.endQuat=new We.Quat;this.outQuat=new We.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,r,o=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(r),this.duration=o,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:r,fov:o,eased:i}=Ro(this.waypoints,n,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,Co(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=o,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 va=Zn,ed=.12,td=.25,nd=1.5;function Sa(e,t,n=0,r,o){let i=[t.x*G,n+nd,t.y*G],a=o?[o[0],o[1],o[2]]:i,s=e[1],c=Number.isFinite(s)?s+va:Number.isFinite(r)?n+r:n+va,u=i[0]-e[0],d=i[2]-e[2],p=Math.hypot(u,d),m=p>.001?Math.min(ed,p*td):0,l=p>.001?u/p:0,f=p>.001?d/p:0;return{eye:[e[0]+l*m,c,e[2]+f*m],focal:a}}var st=Math.PI/180,od=45,Ma=80,wn=70,rd=1,id=.99;function ad(e,t){if(!(e<rd))return Ma;if(!(Number.isFinite(t)&&t>0))return wn;let n=2*Math.atan(t/(2*Pn*id)/Math.max(.05,e))/st;return Math.max(wn,Math.min(Ma,n))}var sd=.25,Pn=1,cd=.25,ld=12*st,ud=.2,dd=1.5,wa=.8,Pa=6,Ia=1.9,md=2/3,fd=.12,pd=.9,hd=1.2,bd=2,Ea=.05,yd=6;function Ta(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+wa,t[1]),t[2]+6]};let r=1/0,o=-1/0,i=1/0,a=-1/0,s=n;for(let f of e)r=Math.min(r,f.cx-f.halfX),o=Math.max(o,f.cx+f.halfX),i=Math.min(i,f.cz-f.halfZ),a=Math.max(a,f.cz+f.halfZ),s=Math.max(s,f.y);let c=o-r,u=a-i,d=Math.max(c,Math.min(u,Pa))/2,p=Math.max(u,Math.min(c,Pa))/2,m=(r+o)/2,l=(i+a)/2;return{min:[m-d,n,l-p],max:[m+d,Math.max(n+wa,s),l+p]}}function gd(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+Ia,e.max[2]]}}function Io(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+dd,t+ud,t+Ia*md),(e.min[2]+e.max[2])/2]}function _a(e,t){let n=e[0]-t[0],r=e[2]-t[2],o=Math.hypot(n,r);return o<.001?{x:0,z:1}:{x:n/o,z:r/o}}function Ca(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(r,o,i)||1;r/=a,o/=a,i/=a;let s=-i,c=r,u=Math.hypot(s,c);if(u<1e-6)return 1/0;s/=u,c/=u;let d=1/0,p=-1/0;for(let m=0;m<8;m++){let l=(m&1?n.max[0]:n.min[0])-e[0],f=(m&2?n.max[1]:n.min[1])-e[1],h=(m&4?n.max[2]:n.min[2])-e[2],y=Math.max(Ea,l*r+f*o+h*i),b=(l*s+h*c)/y;b<d&&(d=b),b>p&&(p=b)}return p-d}function Aa(e,t,n){let r=t[0]-e[0],o=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(r,o,i)||1;r/=a,o/=a,i/=a;let s=-i,c=r,u=Math.hypot(s,c);if(u<1e-6)return 1/0;s/=u,c/=u;let d=-c*o,p=c*r-s*i,m=s*o,l=1/0,f=-1/0;for(let h=0;h<8;h++){let y=(h&1?n.max[0]:n.min[0])-e[0],b=(h&2?n.max[1]:n.min[1])-e[1],x=(h&4?n.max[2]:n.min[2])-e[2],g=Math.max(Ea,y*r+b*o+x*i),v=(y*d+b*p+x*m)/g;v<l&&(l=v),v>f&&(f=v)}return f-l}function Cn(e,t){return Math.tan(e*st/2)*Math.max(.05,t)}function Ra(e,t,n){let r=ad(n,e),o=c=>Math.max(od,Math.min(r,c)),i=c=>2*Math.atan(c)/st,a=Number.isFinite(e)&&e>0?o(i(e/(2*sd)/Math.max(.05,n))):r;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,o(i(t/(2*fd))));return e/(2*Cn(s,n))>Pn?a:s}function ka(e,t,n){let r=Io(t),o=[e[0],e[1],e[2]],i=0,a=0,s=l=>{if(!(l>0))return;let f=_a(o,r);o[0]+=f.x*l,o[2]+=f.z*l,a+=l},c=t.max[1]+cd-o[1];c>0&&(o[1]+=c,i=c,s(c/Math.tan(ld)));let u=gd(t),d=Ca(o,r,t),p=Ra(d,Aa(o,r,u),n),m=d/(2*Cn(p,n));for(let l=0;l<yd&&m>Pn;l++){let f=Math.max(1,Math.hypot(o[0]-r[0],o[2]-r[2])),h=Number.isFinite(m)?m/Pn:2;s(Math.min(60,f*(Math.min(4,h)-1)+.5)),d=Ca(o,r,t),p=Ra(d,Aa(o,r,u),n),m=d/(2*Cn(p,n))}return{eye:o,focal:r,fov:p,raisedM:i,pulledBackM:a,stageFrameWidth:m}}function xd(e,t,n){let r=Math.tan(t*st/2),o=Cn(t,n);return Math.max(1,e/Math.max(.05,Math.min(r,o)))}function La(e,t){let{aspect:n,venue:r}=t,o=e.focal,i=_a(e.eye,o),a=m=>(m[0]-o[0])*i.x+(m[2]-o[2])*i.z,s=[{name:"seat",eye:e.eye,focal:o,fov:e.fov}],c=bd*(t.rowDepthM??pd);s.push({name:"row",eye:[e.eye[0]+i.x*c,e.eye[1]+hd,e.eye[2]+i.z*c],focal:o,fov:e.fov});let u=(m,l,f,h)=>{let y=xd(f,e.fov,n)*1.08,b=y*Math.sin(h*st),x=y*Math.cos(h*st);return{name:m,eye:[l[0]+i.x*x,l[1]+b,l[2]+i.z*x],focal:l,fov:e.fov}};t.section&&t.section.radius>0&&s.push(u("section",t.section.center,t.section.radius,14)),s.push(u("venue",r.center,Math.max(1,r.radius),26));let d=[],p=-1/0;for(let m of s){let l=a(m.eye);d.length&&l<=p+.5||(d.push(m),p=l)}return d}var Ba=require("ogl"),zt=Math.PI/180,Fa=320,Da=70*zt,vd=32*zt,Sd=24*zt,Oa=.0026,Md=.22,wd=.006,Pd=180,Cd=4,Se=(e,t,n)=>Math.max(t,Math.min(n,e)),Va=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function Na(e){let{canvas:t,camera:n}=e,r=[],o=!1,i=0,a=0,s=0,c=0,u=0,d=0,p=!1,m=[0,0],l=0,f=!1,h=null,y=null,b=new Map,x=!1,g=0,v=0,P=0,S=0,C=()=>o&&r.length?r[Se(Math.round(i),0,r.length-1)].name:null,T=()=>{let w=C();w!==h&&(h=w,e.onStopChange?.(w))},B=()=>{if(!o||!r.length)return;let w=r[Se(Math.floor(i),0,r.length-1)],L=r[Se(Math.ceil(i),0,r.length-1)],I=Se(i-Math.floor(i),0,1),O=(Le,Pe)=>Le+(Pe-Le)*I,j=[O(w.eye[0],L.eye[0]),O(w.eye[1],L.eye[1]),O(w.eye[2],L.eye[2])],U=[O(w.focal[0],L.focal[0]),O(w.focal[1],L.focal[1]),O(w.focal[2],L.focal[2])],N=U[0]-j[0],F=U[1]-j[1],K=U[2]-j[2],X=Math.hypot(N,F,K)||1,Q=Math.atan2(N,K),W=Math.asin(Se(F/X,-1,1)),Z=Q+a,$=Se(W+s,-80*zt,80*zt),te=Math.cos($)*X;N=Math.sin(Z)*te,F=Math.sin($)*X,K=Math.cos(Z)*te,n.position.set(j[0],j[1],j[2]),n.fov=O(w.fov,L.fov),n.updateProjectionMatrix(),n.lookAt(new Ba.Vec3(j[0]+N,j[1]+F,j[2]+K)),e.onApplied?.()},z=()=>{if(!o||!r.length)return;let w=Se(Math.round(i),0,r.length-1);if(e.reducedMotion()){p=!1,i=w,B(),T(),e.requestRender();return}if(Math.abs(w-i)<.001){p=!1,T();return}c=i,u=w,d=performance.now(),p=!0,e.requestRender()},D=w=>{!o||r.length<2||(p=!1,i=Se(i+w,0,r.length-1),B(),T(),e.requestRender())},k=(w,L)=>{o&&(p=!1,f=!1,a=Se(a-w*Oa,-Da,Da),s=Se(s-L*Oa,-Sd,vd),B(),e.requestRender())},A=w=>{o&&(b.set(w.pointerId,{x:w.clientX,y:w.clientY}),b.size===1?(x=!0,S=0,g=w.clientX,v=w.clientY):b.size===2&&(x=!1,P=_()))},_=()=>{let w=[...b.values()];return w.length<2?0:Math.hypot(w[0].x-w[1].x,w[0].y-w[1].y)},V=w=>{if(!o||!b.has(w.pointerId))return;if(b.set(w.pointerId,{x:w.clientX,y:w.clientY}),b.size>=2){let O=_();P>0&&D((P-O)*wd),P=O;return}if(!x)return;let L=w.clientX-g,I=w.clientY-v;g=w.clientX,v=w.clientY,S+=Math.abs(L)+Math.abs(I),!(S<=Cd)&&k(L,I)},M=w=>{b.delete(w.pointerId)&&(b.size<2&&(P=0),b.size===0&&(x=!1,z()))},R=w=>{if(!o)return;w.preventDefault();let L=w.deltaMode===1?16:w.deltaMode===2?100:1,I=Se(w.deltaY*L/100,-2,2);D(I*Md),y&&clearTimeout(y),y=setTimeout(()=>{y=null,z()},Pd)},E=()=>{o&&(o=!1,p=!1,f=!1,r=[],b.clear(),x=!1,y&&(clearTimeout(y),y=null),h!==null&&(h=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",A),t.addEventListener("pointermove",V),t.addEventListener("pointerup",M),t.addEventListener("pointercancel",M),t.addEventListener("wheel",R,{passive:!1}),{get active(){return o},enter(w){if(w.length<2){E();return}r=w,o=!0,i=0,a=0,s=0,p=!1,f=!1,h=null,B(),T(),e.requestRender()},exit:E,recentre(){return o?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(f=!1,a=0,s=0,B(),e.requestRender(),!0):(m=[a,s],l=performance.now(),f=!0,e.requestRender(),!0):!1},update(w){if(!o)return!1;let L=!1;if(f){let I=Se((w-l)/Fa,0,1),O=1-Va(I);a=m[0]*O,s=m[1]*O,I>=1?(f=!1,a=0,s=0):L=!0}if(p){let I=Se((w-d)/Fa,0,1);i=c+(u-c)*Va(I),I>=1?(p=!1,i=u,T()):L=!0}return B(),L},currentStop:C,dispose(){E(),t.removeEventListener("pointerdown",A),t.removeEventListener("pointermove",V),t.removeEventListener("pointerup",M),t.removeEventListener("pointercancel",M),t.removeEventListener("wheel",R)}}}function Ga(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var ko=null;function Ja(){return ko??=Promise.resolve().then(()=>($a(),Za)).catch(e=>{throw ko=null,e}),ko}var es=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),kn=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,r,o){this.emit("3d_opened",{seats:t,hasHeights:n,...r===void 0?{}:{buildMs:Math.round(r)},...o===void 0?{}:{prepSource:o}})}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=es(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(es()-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 ts(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function ns(e){let{container:t,model:n,opts:r,expandedSeatById:o,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let p=a();Object.assign(s.style,p?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},u=()=>{s?.remove(),s=null};return{show:(p,m,l=!1)=>{if(u(),e.isDisposed())return null;let f=document.createElement("div");f.setAttribute("role","group"),Object.assign(f.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let h=r.chrome?.caption!==!1,y=r.chrome?.seatStepper!==!1;if(!h&&!y)return null;let b=o.get(p),x=b?.sectionId?n.sections.find(z=>z.id===b.sectionId):void 0,g=b?.label??p;f.setAttribute("aria-label",`Explore views near ${x?.label?`${x.label}, `:""}seat ${g}`);let v=document.createElement("span");v.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",x?.label,g].filter(Boolean).join(" \xB7 "),Object.assign(v.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)"}),h&&f.appendChild(v);let P=document.createElement("div");Object.assign(P.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),f.appendChild(P);let S=b?.rowId?i.get(b.rowId):void 0,C=S?.indexOf(p)??-1,T=C>=0?[S?.[C-1],S?.[C+1]]:[void 0,void 0],B=(z,D,k,A=!1)=>{let _=document.createElement("button");_.type="button",_.textContent=z,_.setAttribute("aria-label",D),Object.assign(_.style,{minHeight:"44px",padding:A?"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"}),A||(_.style.minWidth="44px"),A&&(_.dataset.panoramaTrigger=""),_.addEventListener("click",k),P.appendChild(_)};if(y&&T[0]){let z=o.get(T[0])?.label??T[0];B("\u2039",`View previous seat ${z}`,()=>{e.flyToSeat(T[0])})}if(y&&r.getSeatView){let z=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";B(l?`\u21BB Retry ${z}`:`\u25C9 ${z}`,`${l?"Retry":z} from seat ${g}`,()=>{if(e.isDisposed()||m!==e.flightGen()){u();return}u(),e.openPanorama(p,400,m)},!0)}if(y&&T[1]){let z=o.get(T[1])?.label??T[1];B("\u203A",`View next seat ${z}`,()=>{e.flyToSeat(T[1])})}return!P.childElementCount&&!h?null:(t.appendChild(f),s=f,c(),f)},remove:u,layout:c}}function os(e){let{container:t,orbit:n,isNarrow:r}=e,o=document.createElement("div"),i=!1;o.className="sl-3d-navigation-controls",Object.assign(o.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let a=document.createElement("div");a.setAttribute("role","group"),a.setAttribute("aria-label","3D drag mode"),Object.assign(a.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let s=document.createElement("div");s.setAttribute("role","group"),s.setAttribute("aria-label","3D view controls"),Object.assign(s.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let c=document.createElement("button");c.type="button",c.textContent="\u21BB",c.setAttribute("aria-label","Drag to rotate the 3D venue"),c.dataset.tooltip="Rotate venue";let u=document.createElement("button");u.type="button",u.textContent="\u2725",u.setAttribute("aria-label","Drag to move the 3D venue left, right, up or down"),u.dataset.tooltip="Move venue";let d=document.createElement("button");d.type="button",d.textContent="\u2212",d.setAttribute("aria-label","Zoom out of the 3D venue"),d.dataset.tooltip="Zoom out";let p=document.createElement("button");p.type="button",p.textContent="+",p.setAttribute("aria-label","Zoom into the 3D venue"),p.dataset.tooltip="Zoom in";for(let y of[c,u,d,p])y.className="sl-3d-icon-control",Object.assign(y.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"});a.append(c,u),s.append(p,d);let m=y=>{n.setPrimaryDragMode(y);let b=y==="orbit";c.setAttribute("aria-pressed",String(b)),u.setAttribute("aria-pressed",String(!b)),c.style.background=b?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",u.style.background=b?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",o.title=b?"Drag to rotate \xB7 Shift-drag to move":"Drag to move \xB7 Shift-drag to rotate"};c.addEventListener("click",()=>m("orbit")),u.addEventListener("click",()=>m("pan")),d.addEventListener("click",()=>n.zoomBy(1.22)),p.addEventListener("click",()=>n.zoomBy(.82)),o.append(a,s),m("orbit"),t.appendChild(o);let l=e.enabled!==!1,f=()=>{let y=r();o.style.display=i||!l?"none":"flex",o.style.right=y?"12px":"14px",o.style.bottom=y?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",a.style.display=y?"none":"flex",p.style.display=y?"none":"",d.style.display=y?"none":""};return f(),{element:o,utilityControls:s,setNavigationMode:m,setSeatViewLocked:y=>{i=y,n.setInteractionEnabled(!y),f()},seatViewLocked:()=>i,layout:f}}function rs(e){let{glctx:t,orbit:n,model:r,seats:o,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:u,tapSlop:d,tapMs:p,cancelFlight:m,focusSectionCamera:l,setSelection:f,ensureSeatView:h}=e,y=0,b=0,x=0,g=-1,v=!1,P=!1,S=D=>{e.seatViewLocked()||g===-1&&(g=D.pointerId,y=D.clientX,b=D.clientY,x=performance.now(),v=!1,P=a.active,a.active&&(s.cinematicCancelled(),m(),i.onViewTargetChange?.(null)))},C=D=>{D.pointerId===g&&Math.hypot(D.clientX-y,D.clientY-b)>d&&(v=!0)},T=(D,k,A,_,V)=>{let M=t.canvas.getBoundingClientRect(),R=t.canvas.clientWidth||M.width||1,E=t.canvas.clientHeight||M.height||1,w=D-M.left,L=k-M.top,I=_*_,O=-1,j=I,U=1/0;for(let N of o){if(A&&N.sectionId!==A)continue;let F=r.seats.idToIndex.get(N.id);if(F===void 0)continue;if(V){let $=Math.round(r.seats.iState[F]??0);if($!==0&&$!==3)continue}let K=F*3,X=Ye(n.camera.projectionViewMatrix,[r.seats.iPosition[K],r.seats.iPosition[K+1]+.55,r.seats.iPosition[K+2]],R,E);if(!X.visible)continue;let Q=X.x-w,W=X.y-L,Z=Q*Q+W*W;(Z<j||Math.abs(Z-j)<1&&X.depth<U)&&(O=F,j=Z,U=X.depth)}return O},B=(D,k)=>{let A=e.gpu(),_=e.pick();if(!A||!_)return-1;_.syncFromSeatProgram(A.seatProgram);let V=t.canvas.getBoundingClientRect(),M=t.renderer.dpr,{x:R,y:E}=ua(D,k,V,M,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),w=Math.max(2,Math.round(8*M));return _.pick(n.camera,R,E,w)};return{onDown:S,onMove:C,onUp:D=>{if(D.pointerId!==g)return;let k=!v&&performance.now()-x<p;if(g=-1,P){P=!1;return}let A=e.gpu(),_=e.pick();if(!k||!A||!_)return;let V=B(D.clientX,D.clientY);if(e.focusedSectionId()&&V>=0){let E=c[V],w=E?u.get(E):void 0;if(w&&w!==e.focusedSectionId()&&l(w))return}if(e.focusedSectionId()&&V<0&&(V=T(D.clientX,D.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&V<0){let E=T(D.clientX,D.clientY,null,72,!1),w=E>=0?c[E]:void 0,L=w?u.get(w):void 0;if(L&&L!==e.focusedSectionId()&&l(L))return}if(!e.focusedSectionId()){V<0&&(V=T(D.clientX,D.clientY,null,42,!1));let E=V>=0?c[V]:void 0,w=E?u.get(E):void 0;if(w&&l(w))return}if(V<0||V>=c.length){e.selection().size&&(f([]),i.onViewTargetChange?.(null));return}let M=c[V],R=fe[Math.round(r.seats.iState[V]??0)]??"available";if(R!=="available"&&R!=="selected"){i.onSeatInspect?.(M,R);return}if(e.selection().has(M)&&e.selection().size===1){f([]),i.onViewTargetChange?.(null),i.onSeatPick?.(M);return}f([M]),h(M),s.seatPicked(M,u.get(M)),i.onSeatPick?.(M)}}}var Ln=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,r=1/0,o=-1/0,i=-1/0;for(let l=0;l<this.count;l++){let f=t[l*3],h=t[l*3+2];f<n&&(n=f),f>o&&(o=f),h<r&&(r=h),h>i&&(i=h)}let a=Math.max(o-n,.001),s=Math.max(i-r,.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=r;let c=this.cols*this.rows,u=new Int32Array(c+1),d=l=>{let f=Math.min(this.cols-1,Math.max(0,Math.floor((t[l*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[l*3+2]-r)/this.cell)))*this.cols+f};for(let l=0;l<this.count;l++)u[d(l)+1]++;for(let l=0;l<c;l++)u[l+1]+=u[l];let p=new Int32Array(this.count),m=u.slice(0,c);for(let l=0;l<this.count;l++)p[m[d(l)]++]=l;this.cellStart=u,this.cellItems=p}gather(t,n,r,o){this.ensureGrid();let i=this.cellStart,a=this.cellItems;if(!i||!a)return 0;let s=o.length,c=r*r,u=Math.floor((t-this.minX)/this.cell),d=Math.floor((n-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,m=this.iPosition,l=0;for(let f=0;f<=p&&l<s;f++){let h=d-f,y=d+f,b=u-f,x=u+f;for(let g=h;g<=y&&l<s;g++){if(g<0||g>=this.rows)continue;let v=g===h||g===y;for(let P=b;P<=x&&l<s;P++){if(!v&&P!==b&&P!==x){P=x-1;continue}if(P<0||P>=this.cols)continue;let S=g*this.cols+P;for(let C=i[S],T=i[S+1];C<T&&l<s;C++){let B=a[C],z=m[B*3]-t,D=m[B*3+2]-n;z*z+D*D<=c&&(o[l++]=B)}}}}return l}};var Fn=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array($t);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new Ln(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,r=this.ctx.gpu();if(!r)return;if(!t){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let o=this.ctx.orbit().camera.position;if(Math.hypot(o.x-this.lastGatherX,o.z-this.lastGatherZ)<jn)return;if(this.lastGatherX=o.x,this.lastGatherZ=o.z,Math.hypot(o.x-n.bounds.center[0],o.z-n.bounds.center[2])-n.bounds.radius>Un){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(o.x,o.z,Un,this.nearBuf);s===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,s)}ease(t,n,r){let o=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?o:i),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?o:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};var Dn=require("ogl");function is(){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 as(e){let{container:t,model:n,opts:r,orbit:o,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:u,overviewFraming:d}=e,p=0,m=-1,l=(P,S,C=28)=>{o.camera.position.set(P[0],P[1],P[2]),o.camera.lookAt(new Dn.Vec3(S[0],S[1],S[2])),o.camera.fov=C,o.camera.updateProjectionMatrix()},f=document.createElement("button");f.className="sl-3d-overview-control sl-3d-icon-control",f.type="button",f.replaceChildren(is()),f.setAttribute("aria-label","Fit the active level or whole venue in view"),f.dataset.tooltip="Fit view",Object.assign(f.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 h=()=>{f.firstElementChild||f.replaceChildren(is())};h();let y=P=>{m=P;let S=e.gpu();S&&(S.seatProgram.uniforms.uFocusFloor.value=P,S.solidProgram.uniforms.uFocusFloor.value=P,S.chairProgram.uniforms.uFocusFloor.value=P),e.showSectionSeatLabels(null)},b=()=>{if(e.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),f.style.display="",c.setVisible(!0),e.setFrozen(!1);let P=m>=0?n.floors[m]:null;if(e.setNearFieldDetailEnabled(!!P),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("orbit"),P){let S=P.focalWorld[0]-P.center[0],C=P.focalWorld[2]-P.center[2],T=Math.hypot(S,C)>P.radius*.12?Math.atan2(S,C):u,B={center:P.center,radius:P.radius,box:P.box},z={polarDeg:58,margin:1.12};e.reducedMotion()?o.frame(B,!1,T,!1,z):o.frameSoft(B,T,!1,z)}else e.reducedMotion()?o.frame(n.bounds,!1,u,r.portraitOverviewCrop===!0,d):o.frameSoft(n.bounds,u,r.portraitOverviewCrop===!0,d);e.showSectionSeatLabels(null),s.requestRender()},x=()=>{p++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),o.resumeAfterFlight(n.focalWorld))},g=P=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let S=n.seats.idToIndex.get(P);if(S===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(P),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),f.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let C=e.inSeatView()&&r.arriveAtSeatEye===!0;e.setSeatStepping(C),e.setSeatViewLocked(!1);let T=++p;C?e.showArriveChip(P,T):e.removeArriveChip();let{eye:B,focal:z}=e.resolvedSeatViewPose(P,S),D=r.arriveAtSeatEye?e.seatViewArrival(P,S):null,k=D?D.focal:z,A=[o.camera.position.x,o.camera.position.y,o.camera.position.z],_=Ao(A,D?.eye??B,k,n.bounds.center,n.bounds.radius),V=D?D.eye:r.arriveAtSeatEye?B:_.finalPos,M=D?D.fov:r.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?wn:65:28,R=[_.waypoints[0],_.waypoints[1],V];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),l(V,k,M),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||o.syncFromCamera(),e.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&e.enterSeatView(D.stops),e.showArriveChip(P,T),Promise.resolve();let E=new Dn.Quat().copy(o.camera.quaternion),w=xa(o.camera,V,k);s.requestRender();let L=C?700:2500;return i.start(R,E,w,L,M).then(()=>{e.isDisposed()||T!==p||(e.setSeatStepping(!1),a.cinematicPlayed(L),o.resumeAfterFlight(k),e.setSeatViewLocked(r.arriveAtSeatEye===!0),D&&e.enterSeatView(D.stops),s.requestRender(),e.showArriveChip(P,T))})},v=P=>{let S=n.sections.find(z=>z.id===P);if(!S||S.seatCount===0)return!1;e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&m!==S.floorIndex&&y(S.floorIndex),e.setNavigationMode("pan"),e.showSectionSeatLabels(P);let C=S.focalWorld[0]-S.center[0],T=S.focalWorld[2]-S.center[2],B=Math.hypot(C,T)>S.radius*.12?Math.atan2(C,T):void 0;return o.frame({center:S.center,radius:Math.max(5,S.radius*.5)},!1,B),r.onSectionFocusChange?.(P),s.requestRender(),!0};return f.addEventListener("click",b),{overviewChip:f,layoutOverviewChip:h,flightGen:()=>p,focusedFloor:()=>m,applyFloorFocus:y,placeCameraFinal:l,cancelFlight:x,focusOverview:b,flyToSeat:g,focusSectionCamera:v}}var zd={};function ss(e){let t=performance.now();return{model:gt(e),buildMs:performance.now()-t,source:"main"}}function Gd(e){let t=Hr(e.doc);return{...ss({...e,seats:t}),seats:t}}function cs(e,t,n){if(typeof Worker>"u")return Promise.resolve(t());let r;try{r=new Worker(new URL("./scene/scene.worker.js",zd.url),{type:"module"})}catch{return Promise.resolve(t())}return new Promise(o=>{let i=!1,a=u=>{i||(i=!0,clearTimeout(c),r.terminate(),o(u))},s=()=>a(t()),c=window.setTimeout(s,15e3);r.onerror=s,r.onmessage=u=>{let d=n(u.data);d?a(d):s()},r.postMessage(e)})}function ls(e){return cs(e,()=>ss(e),({model:t,buildMs:n})=>({model:t,buildMs:n,source:"worker"}))}function us(e){return cs(e,()=>Gd(e),({model:t,buildMs:n,seats:r})=>r?{model:t,buildMs:n,seats:r,source:"worker"}:null)}var Hd=Math.PI/180,Ud=6,jd=500;function Yd(e,t,n={}){let r=performance.now(),o=t.prepared?.model??gt(t),i=new kn(n.onAnalytics),a=new Array(o.seats.count);for(let[H,Y]of o.seats.idToIndex)a[Y]=H;let s=new Map(t.seats.map(H=>[H.id,H])),c=new Map;for(let H of t.seats){if(!H.rowId)continue;let Y=c.get(H.rowId);Y?Y.push(H.id):c.set(H.rowId,[H.id])}let u=new Map;for(let H of t.seats)u.set(H.id,H.sectionId);let d=new Map;for(let[H,Y]of o.seats.idToIndex){let q=u.get(H);if(!q)continue;let ee=d.get(q);ee?ee.push(Y):d.set(q,[Y])}let p=()=>{if(!l||!o.sectionSolidRanges.length)return;let{lit:H,anyUnlit:Y}=ia(o.sectionSolidRanges,d,o.seats.iState);l.setSectionShellLit(Y?H:null)},m=t.doc.floors?.some(Y=>(Y.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(Y=>Y.objects)??t.doc.objects).some(Y=>Y.type==="section"&&((Y.height??0)>0||(Y.rake??0)>0)),l=null,f=null,h=!1,y=!1,b=!1,x=new Map,g=null,v=null,P=null,S=new Map,C=null,T=()=>{P===null&&(P=e.style.zIndex,e.style.zIndex="20")},B=()=>{P!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=P),P=null)},z=!1,D=()=>z?be.focusedFloor():-1,k=()=>{l=ca(M.gl,o),p(),f=new Sn(M.renderer,l.seatGeometry,l.chairGeometry,l.solidGeometry,o.seats.count),M.setClearColor(o.theme.background.top),f.setRestoreClear(o.theme.background.top),l.seatProgram.uniforms.uSeatRadius.value=De*o.theme.seatScale,l.seatProgram.uniforms.uFocusFloor.value=D(),l.solidProgram.uniforms.uFocusFloor.value=D(),l.chairProgram.uniforms.uFocusFloor.value=D(),l.screenProgram&&(l.screenProgram.uniforms.uFocusFloor.value=D()),_.forceRegather()},A=!1,_=new Fn({model:o,orbit:()=>R,gpu:()=>l}),V=H=>_.setDetailEnabled(H),M=new qt(e,{onContextLost:()=>{b||i.contextLost(),h=!0,W.stop(),l=null,f=null},onContextRestored:()=>{k(),h=!1,b||i.contextRestored(),W.requestRender()}}),R=new Qt(M.gl,M.canvas,()=>W.requestRender(),()=>i.orbitEngaged());R.setAspect(M.aspect);let E=(t.doc.floors?.flatMap(H=>H.objects)??t.doc.objects).some(H=>H.type==="section"&&H.physical3dProvenance?.surfaceKind?.status==="inferred"),w=(()=>{if(E&&o.stages.length===0)return;let H=o.focalWorld[0]-o.bounds.center[0],Y=o.focalWorld[2]-o.bounds.center[2];return Math.hypot(H,Y)>o.bounds.radius*.12?Math.atan2(H,Y):void 0})(),L=o.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},I=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;R.frame(o.bounds,!I&&n.skipInitialOverviewAnimation!==!0,w,n.portraitOverviewCrop===!0,L);let O=new Mn(R.camera),j=ts(e),U=new gn(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:o.theme.background.top}),N=o.labels,F=()=>Ai(N,o.floors.length,D());U.setLabels(F());let K=null,X=H=>{if(K=H,U.setForcedDense(!!H),!H){U.setLabels(F());return}let Y=t.seats.filter(J=>J.sectionId===H),q=new Set(Y.map(J=>J.id)),ee=new Set(Y.map(J=>J.rowId)),re=new Set(x.keys()),ie=new Set(Y.filter(J=>re.has(J.id)).map(J=>J.id)),se=F().filter(J=>J.kind!=="row"&&J.kind!=="seat"||(J.kind==="row"?ee.has(J.id.slice(4)):q.has(J.id.slice(5))&&(ie.size===0||ie.has(J.id.slice(5)))));if(o.seatCount<=6e3&&ie.size===0){U.setLabels(se);return}let de=ie.size?Y.filter(J=>ie.has(J.id)):Y,Ze=new Set(de.map(J=>`seat:${J.id}`)),He=de.flatMap(J=>{let ye=o.seats.idToIndex.get(J.id);if(ye===void 0)return[];let Re=ye*3;return[{id:`seat:${J.id}`,kind:"seat",text:J.displayLabel||J.label,anchor:[o.seats.iPosition[Re],o.seats.iPosition[Re+1]+(re.has(J.id)?1.05:.55),o.seats.iPosition[Re+2]]}]});U.setLabels([...se.filter(J=>!Ze.has(J.id)),...He])};k();let Q=null,W=new Zt(H=>{if(h||!l||y)return!1;let Y=Ga({flying:O.active,panoramaMounted:g!==null,seatViewActive:Q?.active===!0}),q=Y==="cinematic"?O.update(performance.now()):Y==="seatView"?Q.update(performance.now()):Y==="orbit"?R.update():!1,ee=D()>=0?o.floors[D()]:null,re=ee?.radius??o.bounds.radius,ie=Qo(R.currentDistance,re),se=A?{center:[R.camera.position.x,R.camera.position.y,R.camera.position.z],radius:520}:o.renderBounds;R.updateClipping(se);let de=ee?.center??o.renderBounds.center,Ze=ee?.radius??o.renderBounds.radius,He=(Ie,Pt)=>Math.hypot(R.camera.position.x-Ie[0],R.camera.position.y-Ie[1],R.camera.position.z-Ie[2])<=Pt*(_.detailVisible?1.8:1.55),J=He(de,Ze);if(!J&&K){let Ie=o.sections.find(Pt=>Pt.id===K);Ie&&(J=He(Ie.center,Math.max(12,Ie.radius*2)))}_.detailVisible=J;let ye=l.seatProgram.uniforms;ye.uSeatScale.value=ie.scale,ye.uSeatFade.value=ie.fade;let Re=!!ee&&Zo(ee.seatCount,M.canvas.clientWidth||1,M.canvas.clientHeight||1),Yt=$o(o.seats.count,re,R.currentDistance,R.camera.fov,M.canvas.clientHeight||1),wt=_.detailVisible||Re||Yt?1:0,Xt=_.detailVisible||D()>=0||o.floors.length>1?1:0;return _.ease(H,wt,Xt),ye.uSeatDetail.value=_.seatDetailMix,l.solidProgram.uniforms.uStructureDetail.value=_.structureDetailMix,ye.uMinPixels.value=ie.minPixels,ye.uPixelToWorld.value=2*Math.tan(R.camera.fov*Hd/2)/Math.max(1,M.pixelHeight),_.update(_.detailVisible),M.renderer.render({scene:l.background,clear:!0}),M.renderer.render({scene:l.main,camera:R.camera,clear:!1}),U.update(R.camera.projectionViewMatrix,M.canvas.clientWidth||1,M.canvas.clientHeight||1,R.currentDistance,re,[R.camera.position.x,R.camera.position.y,R.camera.position.z]),q||_.seatDetailMix!==wt||_.structureDetailMix!==Xt}),Z=typeof ResizeObserver<"u"?new ResizeObserver(()=>Vn.resize()):null;Z?.observe(e);let $=H=>{let Y=re=>{let ie=o.seats.idToIndex.get(re);return ie===void 0?void 0:o.seats.iState[ie]},{updates:q,next:ee}=ma(x,H,Y);if(x=ee,U.setSelectedSeatIds(x.keys()),K&&X(K),q.length){let re=$n(o.seats,q);l&&l.uploadSeatStateRuns(re),p(),W.requestRender()}},te=()=>C!==null?C:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Le=8,Pe=H=>{if(!n.getSeatView)return null;let Y=S.get(H);if(!Y)for(Y=Promise.resolve(n.getSeatView(H)),S.set(H,Y),Y.catch(()=>{S.get(H)===Y&&S.delete(H)});S.size>Le;){let q=S.keys().next().value;if(q===void 0)break;S.delete(q)}return Y},Be=Ta(o.stages,o.focalWorld,o.bounds.groundY??0),Ne=Io(Be),Ae=(H,Y)=>{let q=s.get(H),ee=Math.max(0,Math.round(o.seats.iFloor[Y]??0)),re=t.doc.floors?.[ee],ie=o.floors[ee],se=re?.focalPoint??t.doc.focalPoint,de=ie?{x:ie.focalWorld[0]/G,y:ie.focalWorld[2]/G}:se,Ze=q?.focalPoint?{x:q.focalPoint.x+de.x-se.x,y:q.focalPoint.y+de.y-se.y}:de,He=[o.seats.iPosition[Y*3],o.seats.iPosition[Y*3+1],o.seats.iPosition[Y*3+2]];return Sa(He,Ze,re?.baseHeightM??0,q?.eyeHeightM,Ne)},Ce=()=>(e.clientWidth||M.canvas.clientWidth)<=520,me=null,qe=null,vt=async(H,Y,q)=>{if(!n.getSeatView||b||q!==be.flightGen())return;let ee;try{ee=await Ja()}catch{if(i.panoramaFailed(H,"mount"),!b&&q===be.flightGen()){let re=Fe(H,q,!0);requestAnimationFrame(()=>re?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(b||q!==be.flightGen()||!me))return qe??=ee.createOpenPanorama(me),qe(H,Y,q)},Ge=ns({container:e,model:o,opts:n,expandedSeatById:s,seatIdsByRow:c,isNarrow:Ce,isDisposed:()=>b,flightGen:()=>be.flightGen(),flyToSeat:H=>Do(H),openPanorama:(H,Y,q)=>vt(H,Y,q)}),Fe=Ge.show,Qe=Ge.remove,Ut=Ge.layout,ct=os({container:e,orbit:R,isNarrow:Ce,enabled:n.chrome?.controlDock!==!1}),ds=ct.element,St=ct.setNavigationMode,ms=ct.layout,fs=ct.utilityControls,Mt=null,Lo=!1,jt=H=>{ct.setSeatViewLocked(H),H||Q?.exit()};Q=Na({canvas:M.canvas,camera:R.camera,requestRender:()=>W.requestRender(),reducedMotion:te,onStopChange:H=>{let Y=H??(Lo?"seat":null);Mt=Y;try{n.onSeatViewStopChange?.(Y)}catch{}},onApplied:()=>{b||R.syncFromCamera()}});let ps=(H,Y)=>{let{eye:q}=Ae(H,Y),ee=(e.clientWidth||M.canvas.clientWidth||1)/Math.max(1,e.clientHeight||M.canvas.clientHeight||1),re=ka(q,Be,ee);if(n.seatViewStops===!1)return{...re,stops:[]};let ie=u.get(H),se=ie?o.sections.find(de=>de.id===ie):void 0;return{...re,stops:La(re,{aspect:ee,section:se&&se.seatCount>0?{center:se.center,radius:se.radius}:null,venue:{center:o.bounds.center,radius:o.bounds.radius}})}},be=as({container:e,model:o,opts:n,orbit:R,cinematic:O,analytics:i,loop:W,labelOverlay:U,stageAzimuth:w,overviewFraming:L,gpu:()=>l,isDisposed:()=>b,panorama:()=>g,setPanorama:H=>{g=H},setPanoramaSphereVisible:H=>{A=H},panoramaLoadAbort:()=>v,setPanoramaLoadAbort:H=>{v=H},setFrozen:H=>{y=H},restorePanoramaLayer:B,reducedMotion:te,resolvedSeatViewPose:Ae,showSectionSeatLabels:X,setNearFieldDetailEnabled:V,setSeatViewLocked:jt,setNavigationMode:St,showArriveChip:Fe,removeArriveChip:Qe,inSeatView:()=>Mt!==null,setSeatStepping:H=>{Lo=H},seatViewArrival:(H,Y)=>n.arriveAtSeatEye?ps(H,Y):null,enterSeatView:H=>Q?.enter(H)});z=!0;let On=be.overviewChip,hs=be.layoutOverviewChip,bs=be.applyFloorFocus,ys=be.focusOverview,Fo=be.cancelFlight,Do=be.flyToSeat,Oo=be.focusSectionCamera;fs.appendChild(On),me={container:e,model:o,opts:n,analytics:i,orbit:R,loop:W,seatsById:s,ensureSeatView:Pe,resolvedSeatViewPose:Ae,gpu:()=>l,gl:M.gl,isContextLost:()=>h,isDisposed:()=>b,flightGen:()=>be.flightGen(),setPanorama:H=>{g=H},getLoadAbort:()=>v,setLoadAbort:H=>{v=H},setPanoramaSphereVisible:H=>{A=H,H&&Q?.exit()},setFrozen:H=>{y=H},raisePanoramaLayer:T,restorePanoramaLayer:B,getOverviewChip:()=>On,labelOverlay:U,reducedMotion:te,removeArriveChip:Qe,showArriveChip:Fe};let ze=rs({glctx:M,orbit:R,model:o,seats:t.seats,opts:n,cinematic:O,analytics:i,seatIdByIndex:a,sectionIdBySeatId:u,tapSlop:Ud,tapMs:jd,gpu:()=>l,pick:()=>f,seatViewLocked:()=>ct.seatViewLocked(),focusedSectionId:()=>K,selection:()=>x,cancelFlight:Fo,focusSectionCamera:Oo,setSelection:$,ensureSeatView:Pe});M.canvas.addEventListener("pointerdown",ze.onDown),M.canvas.addEventListener("pointermove",ze.onMove),M.canvas.addEventListener("pointerup",ze.onUp),M.canvas.addEventListener("pointercancel",ze.onUp),W.requestRender();let Vn={setAvailability(H){let Y=da(x,H),q=$n(o.seats,Y);q.length&&l&&l.uploadSeatStateRuns(q),p(),W.requestRender()},setSelection:$,setNavigationMode:St,zoomIn(){R.zoomBy(.82),W.requestRender()},zoomOut(){R.zoomBy(1.22),W.requestRender()},flyToSeat:Do,focusOverview:ys,seatViewStop:()=>Mt,recentreSeatView:()=>Q?.recentre()??!1,resize(){let{width:H,height:Y}=M.resize();R.setAspect(H/Math.max(1,Y)),Ut(),ms(),hs(),W.requestRender()},stats(){return{...W.stats(),drawCalls:l?l.drawCalls:0,seatCount:o.seatCount}},getQualityEvidence(){let H=W.stats(),Y=M.canvas.clientWidth||1,q=M.canvas.clientHeight||1,ee=o.bounds.center,re=Ye(R.camera.projectionViewMatrix,[ee[0],o.bounds.box.min[1],ee[2]],Y,q),ie=Ye(R.camera.projectionViewMatrix,[ee[0],o.bounds.box.max[1],ee[2]],Y,q),se=o.bounds.box,de=[se.min[0],se.max[0]].flatMap(J=>[se.min[1],se.max[1]].flatMap(ye=>[se.min[2],se.max[2]].map(Re=>Ye(R.camera.projectionViewMatrix,[J,ye,Re],Y,q)))).filter(J=>Number.isFinite(J.x)&&Number.isFinite(J.y)&&Number.isFinite(J.depth)),Ze=de.length?(()=>{let J=Math.min(...de.map($e=>$e.x)),ye=Math.max(...de.map($e=>$e.x)),Re=Math.min(...de.map($e=>$e.y)),Yt=Math.max(...de.map($e=>$e.y)),wt=Math.max(0,J),Xt=Math.min(Y,ye),Ie=Math.max(0,Re),Pt=Math.min(q,Yt),Wt=Math.max(0,Xt-wt),Bn=Math.max(0,Pt-Ie);return{box:{x:wt,y:Ie,width:Wt,height:Bn},horizontalFillRatio:Wt/Y,verticalFillRatio:Bn/q,visibleAreaRatio:Wt*Bn/(Y*q),clippedEdges:[...Re<0?["top"]:[],...ye>Y?["right"]:[],...Yt>q?["bottom"]:[],...J<0?["left"]:[]]}})():void 0,He=String(M.gl.getParameter(M.gl.VERSION)??"");return{viewport:{width:Y,height:q},context:{webgl2:/webgl\s*2/i.test(He),lost:h},frame:{rendered:H.rendered,idle:H.idle},camera:{position:[R.camera.position.x,R.camera.position.y,R.camera.position.z],distance:R.currentDistance,verticalFovDeg:R.fovY},scene:{seatCount:o.seatCount,floorCount:o.floors.length,zoneCount:o.zones.length,sectionCount:o.sections.length,authoredRelief:m,renderedVerticalSpanM:Math.max(0,o.bounds.box.max[1]-o.bounds.box.min[1]),projectedReliefPx:re.visible&&ie.visible?Math.abs(re.y-ie.y):0},labels:U.qualityEvidence(),framing:Ze,...Mt?{seatView:{fovDeg:R.camera.fov,stop:Mt}}:{}}},getQualityReport(){return xn(Vn.getQualityEvidence())},loseContextForTest(){M.simulateContextLossCycle()},floors(){return o.floors},focusFloor(H){if(H!==null&&!o.floors.some(q=>q.index===H))return!1;let Y=H??-1;if(V(H!==null),jt(!1),bs(Y),St("orbit"),H===null)O.cancel(),te()?R.frame(o.bounds,!1,w,n.portraitOverviewCrop===!0,L):R.frameSoft(o.bounds,w,n.portraitOverviewCrop===!0,L);else{let q=o.floors[H];if(q.seatCount>0){O.cancel();let ee=q.focalWorld[0]-q.center[0],re=q.focalWorld[2]-q.center[2],ie=Math.hypot(ee,re)>q.radius*.12?Math.atan2(ee,re):w;R.frame({center:q.center,radius:q.radius,box:q.box},!1,ie,!1,{polarDeg:58,margin:1.12})}}return W.requestRender(),!0},zones(){return o.zones},focusZone(H){let Y=o.zones.find(ie=>ie.id===H);if(!Y||Y.seatCount===0)return!1;V(!1),jt(!1),O.cancel(),St("orbit"),X(null),n.onSectionFocusChange?.(null);let q=Y.focalWorld[0]-Y.center[0],ee=Y.focalWorld[2]-Y.center[2],re=Math.hypot(q,ee)>Y.radius*.12?Math.atan2(q,ee):void 0;return R.frame({center:Y.center,radius:Y.radius*1.25},!1,re),W.requestRender(),!0},sections(){return o.sections},focusSection(H){return Oo(H)},rows(H){return H?o.rows.filter(Y=>Y.sectionId===H):o.rows},seatsInRow(H){return t.seats.filter(Y=>Y.rowId===H).map(Y=>({id:Y.id,label:Y.displayLabel||Y.label}))},focusRow(H){let Y=o.rows.find(q=>q.id===H);return!Y||Y.seatCount===0?!1:(V(!0),jt(!1),O.cancel(),St("pan"),Y.sectionId&&(X(Y.sectionId),n.onSectionFocusChange?.(Y.sectionId)),R.frame({center:Y.center,radius:Math.max(2.5,Y.radius*.65)}),W.requestRender(),!0)},setReducedMotionForTest(H){C=H},dispose(){b=!0,Qe(),On.remove(),ds.remove(),Fo(),Q?.dispose(),W.stop(),U.dispose(),Z?.disconnect(),g&&(g.dispose(),g=null),B(),j(),M.canvas.removeEventListener("pointerdown",ze.onDown),M.canvas.removeEventListener("pointermove",ze.onMove),M.canvas.removeEventListener("pointerup",ze.onUp),M.canvas.removeEventListener("pointercancel",ze.onUp),R.dispose(),f&&f.dispose(),l&&l.dispose(),l=null,f=null,M.dispose()}};return i.opened(o.seatCount,m,t.prepared?.buildMs??performance.now()-r,t.prepared?.source??"inline"),Vn}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,buildSceneModel,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|