@seatlayer/core 0.110.0 → 0.111.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/ar-IOQUWTKM.js +1 -0
- package/dist/be-XLR5WTXS.js +1 -0
- package/dist/bg-AVCWLASZ.js +1 -0
- package/dist/ca-TKG35ICB.js +1 -0
- package/dist/{categoryInventory-BfvwE3nC.d.cts → categoryInventory-BE1AThTx.d.cts} +1 -1
- package/dist/{categoryInventory-ClZ-68jI.d.ts → categoryInventory-DxciZQK_.d.ts} +1 -1
- package/dist/{chunk-ZYQXT5JP.js → chunk-5FIX35HN.js} +1 -1
- package/dist/{chunk-2JFCDE27.js → chunk-5GHPGPWE.js} +1 -1
- package/dist/{chunk-MRLWH6RC.js → chunk-AZWAP4OE.js} +1 -1
- package/dist/chunk-BXQQKDIX.js +1 -0
- package/dist/{chunk-OJSGMXJS.js → chunk-FZ74MVKY.js} +1 -1
- package/dist/chunk-JQBJZMLG.js +1 -0
- package/dist/{chunk-UUIZHJYL.js → chunk-MN4M5QZ4.js} +1 -1
- package/dist/chunk-N6K5NQYG.js +1 -0
- package/dist/{chunk-6VOUTNRV.js → chunk-NQLQNJV2.js} +1 -1
- package/dist/{chunk-BNLANXXZ.js → chunk-NXS6JFBI.js} +1 -1
- package/dist/{chunk-WUNZCUE6.js → chunk-XWTAFHYQ.js} +1 -1
- package/dist/{chunk-FBXZWNND.js → chunk-Z6YGWTT3.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 +3 -3
- package/dist/core/quality/index.d.ts +3 -3
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +2 -2
- package/dist/core/render-assets/index.d.ts +2 -2
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/seatConfidence.d.cts +1 -1
- package/dist/core/seatConfidence.d.ts +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/cs-JRLKXXM5.js +1 -0
- package/dist/cy-W3CYXTOV.js +1 -0
- package/dist/da-HG4PFYWH.js +1 -0
- package/dist/de-KOM2AXXJ.js +1 -0
- package/dist/el-NBRQ66EQ.js +1 -0
- package/dist/es-AVEG4ZNM.js +1 -0
- package/dist/et-33PIOTI4.js +1 -0
- package/dist/{eventConfigurations-DsW5Mj2e.d.ts → eventConfigurations-Cdt-e0uD.d.ts} +1 -1
- package/dist/{eventConfigurations-dmn9FClw.d.cts → eventConfigurations-D0us5j0K.d.cts} +1 -1
- package/dist/fa-CDV2VTXV.js +1 -0
- package/dist/fi-TKATIOE6.js +1 -0
- package/dist/fr-TMDNSR5N.js +1 -0
- package/dist/he-4G7OVLJX.js +1 -0
- package/dist/hi-XKXNYPYF.js +1 -0
- package/dist/hr-BX444QNM.js +1 -0
- package/dist/hu-FM46JMDP.js +1 -0
- package/dist/id-CBVTYGFP.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +46 -38
- package/dist/index.d.ts +46 -38
- package/dist/index.js +1 -1
- package/dist/it-ZOFOAG6E.js +1 -0
- package/dist/ja-NKEBMXTO.js +1 -0
- package/dist/ko-RUCELYV7.js +1 -0
- package/dist/ku-KKYBDVSA.js +1 -0
- package/dist/{labeling-Bn41ByDd.d.ts → labeling-DXgkxMoi.d.ts} +1 -1
- package/dist/{labeling-BmEjVxFt.d.cts → labeling-eYKVPLMb.d.cts} +1 -1
- package/dist/localeLoaders-YQXZZVNH.js +1 -0
- package/dist/lt-3CJ37W7A.js +1 -0
- package/dist/lv-H37RDMRX.js +1 -0
- package/dist/ms-E5RVBRE6.js +1 -0
- package/dist/nl-QHEOTQ7U.js +1 -0
- package/dist/no-43HJQ5MK.js +1 -0
- package/dist/pl-4LKJHMFJ.js +1 -0
- package/dist/pt-LSSE5QHE.js +1 -0
- package/dist/{renderedQuality-MDkNe8GA.d.ts → renderedQuality-Dzo2_8f4.d.ts} +1 -1
- package/dist/{renderedQuality-Bt2d0uq1.d.cts → renderedQuality-Frgw6jdx.d.cts} +1 -1
- package/dist/{renderer-DH0yI32q.d.cts → renderer-DM2sv1un.d.cts} +1 -1
- package/dist/{renderer-BJrpMV6U.d.ts → renderer-DuieD7jP.d.ts} +1 -1
- package/dist/ro-U2QASPIY.js +1 -0
- package/dist/ru-PTMWREXY.js +1 -0
- package/dist/{seatTypeIcons-CG_Uzpaw.d.ts → seatTypeIcons-Bz0OJtEi.d.ts} +1 -1
- package/dist/{seatTypeIcons-Ck7oEFei.d.cts → seatTypeIcons-Cm8tjLYl.d.cts} +1 -1
- package/dist/{sections-C-UAqr1x.d.ts → sections-Bf_DV0oG.d.ts} +1 -1
- package/dist/{sections-C8HApYxd.d.cts → sections-PbQiqN0i.d.cts} +1 -1
- package/dist/{segmentedRowModel-DR1w9M13.d.ts → segmentedRowModel-CO7DD803.d.ts} +1 -1
- package/dist/{segmentedRowModel-CeoMsBnt.d.cts → segmentedRowModel-Co9LqS4i.d.cts} +1 -1
- package/dist/sk-AY2N2ORA.js +1 -0
- package/dist/sl-5MQJVNB7.js +1 -0
- package/dist/sr-25FTJPUA.js +1 -0
- package/dist/{stage-CKb7aNoH.d.cts → stage-BtqKu5aX.d.cts} +1 -1
- package/dist/{stage-CKb7aNoH.d.ts → stage-BtqKu5aX.d.ts} +1 -1
- package/dist/sv-7VQX4BFH.js +1 -0
- package/dist/{tableSizing-RRmpxOXl.d.ts → tableSizing-BDePQyPD.d.ts} +3 -3
- package/dist/{tableSizing-Bz-hxLza.d.cts → tableSizing-C6EjKNnk.d.cts} +3 -3
- package/dist/th-E53HQMDC.js +1 -0
- package/dist/{ticketRestrictions-lq4dH4k6.d.cts → ticketRestrictions-CgYwHQOf.d.cts} +2 -2
- package/dist/{ticketRestrictions-C7KUrulv.d.ts → ticketRestrictions-D5wgOq4P.d.ts} +2 -2
- package/dist/tr-IIR6E7OD.js +1 -0
- package/dist/{types-DM-OneoD.d.ts → types-CGOr0BpE.d.cts} +40 -16
- package/dist/{types-DM-OneoD.d.cts → types-CGOr0BpE.d.ts} +40 -16
- package/dist/uk-HBINQ4XE.js +1 -0
- package/dist/vi-TX6I5RWN.js +1 -0
- package/dist/view3d/crossfade/panorama.d.cts +1 -1
- package/dist/view3d/crossfade/panorama.d.ts +1 -1
- package/dist/view3d/index.cjs +531 -172
- package/dist/view3d/index.d.cts +350 -73
- package/dist/view3d/index.d.ts +350 -73
- package/dist/view3d/index.js +529 -170
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-7QNBTEYC.js +1 -0
- package/dist/zh-Hant-6KK3D42X.js +1 -0
- package/package.json +1 -1
- package/dist/ar-O3RHQRH3.js +0 -1
- package/dist/be-SXFCG3F5.js +0 -1
- package/dist/bg-W7YBNYB2.js +0 -1
- package/dist/ca-FA7WHACR.js +0 -1
- package/dist/chunk-4N5CHKHD.js +0 -1
- package/dist/chunk-4QQG5EEP.js +0 -1
- package/dist/chunk-YE4NP3XB.js +0 -1
- package/dist/cs-RR3VIKRC.js +0 -1
- package/dist/cy-U4JJ5C47.js +0 -1
- package/dist/da-ATULGB2M.js +0 -1
- package/dist/de-VB543CPC.js +0 -1
- package/dist/el-7Y2KXU6N.js +0 -1
- package/dist/es-GUV5XIYC.js +0 -1
- package/dist/et-SZ6I4Z44.js +0 -1
- package/dist/fa-FM6ELEN7.js +0 -1
- package/dist/fi-6QQ2M5JI.js +0 -1
- package/dist/fr-2SEQSVLR.js +0 -1
- package/dist/he-V3EVB7IW.js +0 -1
- package/dist/hi-I4QIBK5Q.js +0 -1
- package/dist/hr-I5DNEVUU.js +0 -1
- package/dist/hu-KTFWBQMF.js +0 -1
- package/dist/id-RZWUH426.js +0 -1
- package/dist/it-CNQP36V4.js +0 -1
- package/dist/ja-JQZOYIHI.js +0 -1
- package/dist/ko-6YCWWHFQ.js +0 -1
- package/dist/ku-33PM4OWG.js +0 -1
- package/dist/localeLoaders-VFQOZMUH.js +0 -1
- package/dist/lt-24JO2B7V.js +0 -1
- package/dist/lv-HTSDEEAB.js +0 -1
- package/dist/ms-PUEZJJ3R.js +0 -1
- package/dist/nl-NQPDRSCW.js +0 -1
- package/dist/no-3N3MUMSA.js +0 -1
- package/dist/pl-YHBEO6ZF.js +0 -1
- package/dist/pt-5RPESNZB.js +0 -1
- package/dist/ro-XDFXIMHX.js +0 -1
- package/dist/ru-BIIALOM5.js +0 -1
- package/dist/sk-LHSFRUFT.js +0 -1
- package/dist/sl-MPE5TPI3.js +0 -1
- package/dist/sr-T3N67KTP.js +0 -1
- package/dist/sv-LJWWYUIY.js +0 -1
- package/dist/th-E5POGG37.js +0 -1
- package/dist/tr-2DCWQ2CY.js +0 -1
- package/dist/uk-C3VJP6EA.js +0 -1
- package/dist/vi-XVMTKCOL.js +0 -1
- package/dist/zh-Hans-RG4CQGBY.js +0 -1
- package/dist/zh-Hant-YHNTYPFS.js +0 -1
package/dist/view3d/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var nd=Object.create;var Co=Object.defineProperty;var od=Object.getOwnPropertyDescriptor;var rd=Object.getOwnPropertyNames;var id=Object.getPrototypeOf,ad=Object.prototype.hasOwnProperty;var Un=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var qa=(e,t)=>{for(var n in t)Co(e,n,{get:t[n],enumerable:!0})},Qa=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of rd(t))!ad.call(e,r)&&r!==n&&Co(e,r,{get:()=>t[r],enumerable:!(o=od(t,r))||o.enumerable});return e};var ft=(e,t,n)=>(n=e!=null?nd(id(e)):{},Qa(t||!e||!e.__esModule?Co(n,"default",{value:e,enumerable:!0}):n,e)),sd=e=>Qa(Co({},"__esModule",{value:!0}),e);function Dx(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Nx(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function Tr(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Nx(t?.deviceMemory)}}function Lr(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Dx(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function yf(){return new DOMException("Panorama image load aborted","AbortError")}function Po(e,t){return new Promise((n,o)=>{if(t?.aborted){o(yf());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(yf())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function kr(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var Ca=Un(()=>{"use strict"});function xf(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function _a(e){return Math.max(Bx,Math.min(Vx,e))}function Gx(e,t,n){let o=(.5+e/360)*n;return t/2-o}function Hx(e,t=Fr){return e*(180/t)}function gf(e,t,n){return(e-t)/2+Or(n,t)}function Or(e,t){let n=vt/180*t;return Math.max(-n,Math.min(n,e))}function zx(){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 Ta(e){return e||(zx()?"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 Mf(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=Lr(t,Tr()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let G=document.createElement("div");G.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(G.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),c.appendChild(G)}let f=document.createElement("div");f.textContent=Ta(n.lookAroundHint),Object.assign(f.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),c.appendChild(f),e.appendChild(c),m.focus({preventScroll:!0});let d=0,h=0,p=0,b=0,y=Fr,M=()=>{let G=c.clientHeight||1,U=c.clientWidth||1,q=x.naturalWidth||U*2,$=x.naturalHeight||G,te=d>0?(U/2-p)/d:0,Q=h>0?b/h:0;h=Hx(G,y),d=h*(q/$),u.style.backgroundSize=`${d}px ${h}px`,S?p=U/2-te*d:(p=Gx(r,U,d),b=Or((t.initialPitchDeg??0)/180*h,h),S=!0),b=Or(Q*h,h),u.style.backgroundPosition=`${p}px ${gf(G,h,b)}px`},S=!1,A=()=>{let G=c.clientHeight||1;b=Or(b,h),u.style.backgroundPosition=`${p}px ${gf(G,h,b)}px`},x=new Image;x.onload=M,x.src=i.initialUrl;let g=()=>{};i.upgradeUrl&&(g=kr(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(U=>!U||a.signal.aborted?null:Po(U,a.signal).then(q=>({full:q,url:U}))).then(U=>{U&&(H||a.signal.aborted||(x=U.full,u.style.backgroundImage=`url("${U.url}")`,M()))}).catch(()=>{})})),requestAnimationFrame(M);let w=!1,v=0,P=0,R=0,k=new Map,F=()=>{let[G,U]=[...k.values()];return G&&U?Math.hypot(G.x-U.x,G.y-U.y):0},E=G=>{let U=_a(G);U!==y&&(y=U,M())},I=G=>{k.set(G.pointerId,{x:G.clientX,y:G.clientY}),w=k.size===1,v=G.clientX,P=G.clientY,k.size===2&&(R=F()),u.style.cursor="grabbing";try{u.setPointerCapture?.(G.pointerId)}catch{}},C=G=>{if(k.has(G.pointerId)){if(k.set(G.pointerId,{x:G.clientX,y:G.clientY}),k.size>=2){let U=F();R>0&&U>0&&E(y*(R/U)),R=U,w=!1;return}w&&(p+=G.clientX-v,b+=G.clientY-P,v=G.clientX,P=G.clientY,A())}},L=G=>{k.delete(G.pointerId),R=k.size===2?F():0;let U=k.values().next().value;w=k.size===1,U?(v=U.x,P=U.y):u.style.cursor="grab";try{u.releasePointerCapture?.(G.pointerId)}catch{}},N=G=>{G.preventDefault(),E(y+G.deltaY*.04)};u.addEventListener("pointerdown",I),u.addEventListener("pointermove",C),u.addEventListener("pointerup",L),u.addEventListener("pointercancel",L),u.addEventListener("wheel",N,{passive:!1});let O=!1,H=!1,j=0,V=()=>{u.removeEventListener("pointerdown",I),u.removeEventListener("pointermove",C),u.removeEventListener("pointerup",L),u.removeEventListener("pointercancel",L),u.removeEventListener("wheel",N),window.removeEventListener("keydown",D)},T=()=>{g(),a.abort(),n.signal?.removeEventListener("abort",s),j&&(window.clearTimeout(j),j=0),V(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},B=()=>{if(O)return;O=!0,c.style.opacity="0";let G=()=>{j=0,!H&&(T(),n.onClose?.())};j=window.setTimeout(G,o)},D=G=>{if(G.key==="Tab"){G.preventDefault(),m.focus({preventScroll:!0});return}if(G.key==="Escape"){G.stopPropagation(),B();return}if(G.key==="ArrowLeft"||G.key==="ArrowRight")p+=G.key==="ArrowLeft"?-32:32;else if(G.key==="ArrowUp"||G.key==="ArrowDown")b+=(G.key==="ArrowUp"?4:-4)*(h/180);else if(G.key==="+"||G.key==="="){E(y-5),G.preventDefault();return}else if(G.key==="-"){E(y+5),G.preventDefault();return}else return;G.preventDefault(),A()};return window.addEventListener("keydown",D),m.addEventListener("click",B),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:B,dispose(){O=!0,H=!0,T()}}}var Fr,Bx,Vx,vt,Dr=Un(()=>{"use strict";Ca();Fr=70,Bx=35,Vx=90;vt=35});function Xx(e=Ux,t=jx,n=Wx){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,f=m*Math.PI,d=Math.sin(f),h=Math.cos(f);for(let p=0;p<o;p++){let b=p/e,y=(b-.5)*Math.PI*2,M=u*o+p;a[M*3]=n*d*Math.sin(y),a[M*3+1]=n*h,a[M*3+2]=-n*d*Math.cos(y),s[M*2]=b,s[M*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let f=u*o+m,d=f+o;c[l++]=f,c[l++]=d,c[l++]=f+1,c[l++]=f+1,c[l++]=d,c[l++]=d+1}return{position:a,uv:s,index:c}}function vf(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function Sf(e,t){let{position:n,uv:o,index:r}=Xx(),i=new Gt.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new Gt.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new Gt.Program(e,{vertex:Yx,fragment:Kx,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new Gt.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var Gt,Ux,jx,Wx,Yx,Kx,wf=Un(()=>{"use strict";Gt=require("ogl"),Ux=64,jx=32,Wx=500;Yx=`#version 300 es
|
|
1
|
+
"use strict";var y0=Object.create;var zr=Object.defineProperty;var x0=Object.getOwnPropertyDescriptor;var M0=Object.getOwnPropertyNames;var v0=Object.getPrototypeOf,S0=Object.prototype.hasOwnProperty;var Xo=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Xc=(e,t)=>{for(var n in t)zr(e,n,{get:t[n],enumerable:!0})},Kc=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of M0(t))!S0.call(e,r)&&r!==n&&zr(e,r,{get:()=>t[r],enumerable:!(o=x0(t,r))||o.enumerable});return e};var jt=(e,t,n)=>(n=e!=null?y0(v0(e)):{},Kc(t||!e||!e.__esModule?zr(n,"default",{value:e,enumerable:!0}):n,e)),w0=e=>Kc(zr({},"__esModule",{value:!0}),e);function Gw(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?0:Math.ceil(e*t*4*(4/3))}function Vw(e){return(e!==void 0&&e<=2?32:e!==void 0&&e>=8?192:96)*1024*1024}function ca(e){let t=typeof navigator>"u"?void 0:navigator;return{saveData:t?.connection?.saveData===!0,maxTextureSize:e,maxDecodedBytes:Vw(t?.deviceMemory)}}function la(e,t={}){let n=e.previewUrl?.trim();if(!n||n===e.url)return{initialUrl:e.url,initialWidth:e.sourceWidth,initialHeight:e.sourceHeight,reason:"full-only"};let o={initialUrl:n,initialWidth:e.previewWidth,initialHeight:e.previewHeight};if(t.saveData)return{...o,reason:"save-data"};let r=[...e.variants??[],...e.sourceWidth!==void 0&&e.sourceHeight!==void 0?[{url:e.url,width:e.sourceWidth,height:e.sourceHeight}]:[]].filter(c=>c.url.trim()&&c.url!==n&&Number.isFinite(c.width)&&c.width>0&&Number.isFinite(c.height)&&c.height>0).sort((c,l)=>c.width*c.height-l.width*l.height);if(!r.length)return{...o,upgradeUrl:e.url,reason:"progressive"};let i=r.filter(c=>t.maxTextureSize===void 0||Math.max(c.width,c.height)<=t.maxTextureSize);if(!i.length)return{...o,reason:"texture-limit"};let a=i.filter(c=>t.maxDecodedBytes===void 0||Gw(c.width,c.height)<=t.maxDecodedBytes);if(!a.length)return{...o,reason:"memory-limit"};let s=a[a.length-1];return{...o,upgradeUrl:s.url,reason:"progressive"}}function _p(){return new DOMException("Panorama image load aborted","AbortError")}function Nr(e,t){return new Promise((n,o)=>{if(t?.aborted){o(_p());return}let r=new Image;r.crossOrigin="anonymous";let i=!1,a=()=>{r.onload=null,r.onerror=null,t?.removeEventListener("abort",c)},s=l=>{i||(i=!0,a(),l?o(l):n(r))},c=()=>{r.src="",s(_p())};r.onload=()=>{(typeof r.decode=="function"?r.decode():Promise.resolve()).then(()=>s(),()=>s())},r.onerror=()=>s(new Error("panorama_image_failed")),t?.addEventListener("abort",c,{once:!0}),r.src=e})}function ua(e){let t=globalThis;if(t.requestIdleCallback){let o=t.requestIdleCallback(e,{timeout:1200});return()=>t.cancelIdleCallback?.(o)}let n=globalThis.setTimeout(e,32);return()=>globalThis.clearTimeout(n)}var Tc=Xo(()=>{"use strict"});function Tp(e){if(e.generated||e.mediaKind==="model")return"built from the chart";let t=e.mediaKind==="demo-render",n=t?e.coverage==="exact-seat"?"AI-generated exact-seat demo":e.coverage==="row-representative"?"AI-generated representative row demo":e.coverage==="section-representative"?"AI-generated representative section demo":e.coverage==="floor-representative"?"AI-generated representative floor demo":"AI-generated illustrative venue demo":e.coverage==="exact-seat"?"Exact seat photo":e.coverage==="row-representative"?"Representative row view":e.coverage==="section-representative"?"Representative section view":e.coverage==="floor-representative"?"Representative floor view":e.coverage==="venue-representative"?"Representative venue view":"Venue photo",o=e.capturedAt&&/^\d{4}/.test(e.capturedAt)?e.capturedAt.slice(0,4):"";return[n,o?`${t?"created":"captured"} ${o}`:"",e.sourceLabel??""].filter(Boolean).join(" \xB7 ")}function kc(e){return Math.max(zw,Math.min(Uw,e))}function Ww(e,t,n){let o=(.5+e/360)*n;return t/2-o}function jw(e,t=ha){return e*(180/t)}function Cp(e,t,n){return(e-t)/2+ma(n,t)}function ma(e,t){let n=rn/180*t;return Math.max(-n,Math.min(n,e))}function Xw(){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 Lc(e){return e||(Xw()?"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 kp(e,t,n={}){let o=n.fadeMs??400,r=t.initialBearingDeg??0,i=la(t,ca()),a=new AbortController,s=()=>a.abort();n.signal?.addEventListener("abort",s,{once:!0});let c=document.createElement("div"),l=document.activeElement instanceof HTMLElement?document.activeElement:null;c.setAttribute("role","dialog"),c.setAttribute("aria-modal","true"),c.setAttribute("aria-label",n.seatLabel?`View from ${n.seatLabel}`:"View from seat"),c.tabIndex=-1,Object.assign(c.style,{position:"absolute",inset:"0",zIndex:"10",opacity:"0",transition:`opacity ${o}ms ease`,background:"#05070c",overflow:"hidden",touchAction:"none"});let u=document.createElement("div");Object.assign(u.style,{position:"absolute",inset:"0",backgroundImage:`url("${i.initialUrl}")`,backgroundRepeat:"repeat-x",cursor:"grab"}),c.appendChild(u);let m=document.createElement("button");if(m.type="button",m.setAttribute("aria-label","Close"),m.textContent="\u2715",Object.assign(m.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),c.appendChild(m),n.disclosure){let D=document.createElement("div");D.textContent=`${n.disclosurePrefix??"360\xB0 panorama"} \xB7 ${n.disclosure}`,Object.assign(D.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(D)}let h=document.createElement("div");h.textContent=Lc(n.lookAroundHint),Object.assign(h.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(h),e.appendChild(c),m.focus({preventScroll:!0});let f=0,d=0,p=0,b=0,y=ha,g=()=>{let D=c.clientHeight||1,U=c.clientWidth||1,$=w.naturalWidth||U*2,Z=w.naturalHeight||D,te=f>0?(U/2-p)/f:0,X=d>0?b/d:0;d=jw(D,y),f=d*($/Z),u.style.backgroundSize=`${f}px ${d}px`,v?p=U/2-te*f:(p=Ww(r,U,f),b=ma((t.initialPitchDeg??0)/180*d,d),v=!0),b=ma(X*d,d),u.style.backgroundPosition=`${p}px ${Cp(D,d,b)}px`},v=!1,P=()=>{let D=c.clientHeight||1;b=ma(b,d),u.style.backgroundPosition=`${p}px ${Cp(D,d,b)}px`},w=new Image;w.onload=g,w.src=i.initialUrl;let x=()=>{};i.upgradeUrl&&(x=ua(()=>{(t.resolveUrl?t.resolveUrl(i.upgradeUrl):Promise.resolve(i.upgradeUrl)).then(U=>!U||a.signal.aborted?null:Nr(U,a.signal).then($=>({full:$,url:U}))).then(U=>{U&&(N||a.signal.aborted||(w=U.full,u.style.backgroundImage=`url("${U.url}")`,g()))}).catch(()=>{})})),requestAnimationFrame(g);let S=!1,A=0,M=0,E=0,T=new Map,k=()=>{let[D,U]=[...T.values()];return D&&U?Math.hypot(D.x-U.x,D.y-U.y):0},_=D=>{let U=kc(D);U!==y&&(y=U,g())},R=D=>{T.set(D.pointerId,{x:D.clientX,y:D.clientY}),S=T.size===1,A=D.clientX,M=D.clientY,T.size===2&&(E=k()),u.style.cursor="grabbing";try{u.setPointerCapture?.(D.pointerId)}catch{}},C=D=>{if(T.has(D.pointerId)){if(T.set(D.pointerId,{x:D.clientX,y:D.clientY}),T.size>=2){let U=k();E>0&&U>0&&_(y*(E/U)),E=U,S=!1;return}S&&(p+=D.clientX-A,b+=D.clientY-M,A=D.clientX,M=D.clientY,P())}},O=D=>{T.delete(D.pointerId),E=T.size===2?k():0;let U=T.values().next().value;S=T.size===1,U?(A=U.x,M=U.y):u.style.cursor="grab";try{u.releasePointerCapture?.(D.pointerId)}catch{}},B=D=>{D.preventDefault(),_(y+D.deltaY*.04)};u.addEventListener("pointerdown",R),u.addEventListener("pointermove",C),u.addEventListener("pointerup",O),u.addEventListener("pointercancel",O),u.addEventListener("wheel",B,{passive:!1});let F=!1,N=!1,V=0,H=()=>{u.removeEventListener("pointerdown",R),u.removeEventListener("pointermove",C),u.removeEventListener("pointerup",O),u.removeEventListener("pointercancel",O),u.removeEventListener("wheel",B),window.removeEventListener("keydown",j)},L=()=>{x(),a.abort(),n.signal?.removeEventListener("abort",s),V&&(window.clearTimeout(V),V=0),H(),c.parentNode&&c.parentNode.removeChild(c),l?.isConnected&&l.focus({preventScroll:!0})},G=()=>{if(F)return;F=!0,c.style.opacity="0";let D=()=>{V=0,!N&&(L(),n.onClose?.())};V=window.setTimeout(D,o)},j=D=>{if(D.key==="Tab"){D.preventDefault(),m.focus({preventScroll:!0});return}if(D.key==="Escape"){D.stopPropagation(),G();return}if(D.key==="ArrowLeft"||D.key==="ArrowRight")p+=D.key==="ArrowLeft"?-32:32;else if(D.key==="ArrowUp"||D.key==="ArrowDown")b+=(D.key==="ArrowUp"?4:-4)*(d/180);else if(D.key==="+"||D.key==="="){_(y-5),D.preventDefault();return}else if(D.key==="-"){_(y+5),D.preventDefault();return}else return;D.preventDefault(),P()};return window.addEventListener("keydown",j),m.addEventListener("click",G),requestAnimationFrame(()=>{c.style.opacity="1"}),{close:G,dispose(){F=!0,N=!0,L()}}}var ha,zw,Uw,rn,fa=Xo(()=>{"use strict";Tc();ha=70,zw=35,Uw=90;rn=35});function Zw(e=Kw,t=Yw,n=$w){let o=e+1,r=t+1,i=o*r,a=new Float32Array(i*3),s=new Float32Array(i*2);for(let u=0;u<r;u++){let m=u/t,h=m*Math.PI,f=Math.sin(h),d=Math.cos(h);for(let p=0;p<o;p++){let b=p/e,y=(b-.5)*Math.PI*2,g=u*o+p;a[g*3]=n*f*Math.sin(y),a[g*3+1]=n*d,a[g*3+2]=-n*f*Math.cos(y),s[g*2]=b,s[g*2+1]=m}}let c=new Uint16Array(e*t*6),l=0;for(let u=0;u<t;u++)for(let m=0;m<e;m++){let h=u*o+m,f=h+o;c[l++]=h,c[l++]=f,c[l++]=h+1,c[l++]=h+1,c[l++]=f,c[l++]=f+1}return{position:a,uv:s,index:c}}function Lp(e,t){let n=e*Math.PI/180,o=t*Math.PI/180,r=Math.cos(o);return[r*Math.sin(n),Math.sin(o),-r*Math.cos(n)]}function Op(e,t){let{position:n,uv:o,index:r}=Zw(),i=new In.Geometry(e,{position:{size:3,data:n},uv:{size:2,data:o},index:{data:r}}),a=new In.Texture(e,{image:t,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,generateMipmaps:!0,flipY:!1}),s=new In.Program(e,{vertex:qw,fragment:Qw,uniforms:{uPano:{value:a},uOpacity:{value:0}},transparent:!0,depthTest:!1,depthWrite:!1}),c=new In.Mesh(e,{geometry:i,program:s});return{mesh:c,setOpacity(l){s.uniforms.uOpacity.value=Math.max(0,Math.min(1,l))},setImage(l){a.image=l,a.needsUpdate=!0},dispose(){c.setParent(null),i.remove(),a.texture&&e.deleteTexture(a.texture),s.remove()}}}var In,Kw,Yw,$w,qw,Qw,Fp=Xo(()=>{"use strict";In=require("ogl"),Kw=64,Yw=32,$w=500;qw=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec3 position;
|
|
4
4
|
in vec2 uv;
|
|
@@ -8,7 +8,7 @@ out vec2 vUv;
|
|
|
8
8
|
void main() {
|
|
9
9
|
vUv = uv;
|
|
10
10
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
11
|
-
}`,
|
|
11
|
+
}`,Qw=`#version 300 es
|
|
12
12
|
precision highp float;
|
|
13
13
|
in vec2 vUv;
|
|
14
14
|
uniform sampler2D uPano;
|
|
@@ -17,7 +17,21 @@ out vec4 fragColor;
|
|
|
17
17
|
void main() {
|
|
18
18
|
vec3 rgb = texture(uPano, vUv).rgb;
|
|
19
19
|
fragColor = vec4(rgb, uOpacity);
|
|
20
|
-
}`});async function Af(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-vt,Math.min(vt,t?.initialPitchDeg??0)),s=Fr,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},f=[n.camera.position.x,n.camera.position.y,n.camera.position.z];if(!t&&n.cameraOriginWorld&&n.camera.position.set(n.cameraOriginWorld[0],n.cameraOriginWorld[1],n.cameraOriginWorld[2]),!t&&n.focalWorld){let V=n.camera.position,T=n.focalWorld[0]-V.x,B=n.focalWorld[1]-V.y,D=n.focalWorld[2]-V.z,G=Math.hypot(T,D);G>.001&&(i=Math.atan2(T,-D)*180/Math.PI,a=Math.max(-vt,Math.min(vt,Math.atan2(B,G)*180/Math.PI)))}let d=null;if(t){let V=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),T=Lr(t,Tr(V)),B;try{let D=t.resolveUrl?await t.resolveUrl(T.initialUrl):T.initialUrl;if(!D)throw new Error("panorama_asset_unavailable");B=await Po(D,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{d=Sf(n.gl,B)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}d.mesh.renderOrder=999,d.mesh.setParent(n.scene),T.upgradeUrl&&(m=kr(()=>{(t.resolveUrl?t.resolveUrl(T.upgradeUrl):Promise.resolve(T.upgradeUrl)).then(G=>!G||l.signal.aborted?null:Po(G,l.signal)).then(G=>{G&&(c||l.signal.aborted||(d?.setImage(G),n.requestRender()))}).catch(()=>{})}))}let h=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let V=n.camera.position;d?.mesh.position.set(V.x,V.y,V.z);let[T,B,D]=vf(i,a);n.camera.lookAt([V.x+T,V.y+B,V.z+D]),n.requestRender()};b();let y=document.createElement("div"),M=document.activeElement instanceof HTMLElement?document.activeElement:null;y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),y.tabIndex=-1,Object.assign(y.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let S=document.createElement("button");if(S.type="button",S.setAttribute("aria-label","Close"),S.textContent="\u2715",Object.assign(S.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),y.appendChild(S),o.disclosure){let V=document.createElement("div");V.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(V.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),y.appendChild(V)}let A=document.createElement("div");A.textContent=Ta(o.lookAroundHint),Object.assign(A.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),y.appendChild(A),e.appendChild(y),S.focus({preventScroll:!0});let x=!1,g=0,w=0,v=0,P=new Map,R=()=>{let[V,T]=[...P.values()];return V&&T?Math.hypot(V.x-T.x,V.y-T.y):0},k=V=>{let T=_a(V);T!==s&&(s=T,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},F=V=>{V.target!==S&&(P.set(V.pointerId,{x:V.clientX,y:V.clientY}),x=P.size===1,g=V.clientX,w=V.clientY,P.size===2&&(v=R()),y.setPointerCapture?.(V.pointerId),y.style.cursor="grabbing")},E=V=>{if(P.has(V.pointerId)){if(P.set(V.pointerId,{x:V.clientX,y:V.clientY}),P.size>=2){let T=R();v>0&&T>0&&k(s*(v/T)),v=T,x=!1;return}x&&(i+=(V.clientX-g)*Pf,a=Math.max(-vt,Math.min(vt,a+(V.clientY-w)*Pf)),g=V.clientX,w=V.clientY,b())}},I=V=>{P.delete(V.pointerId),v=P.size===2?R():0;let T=P.values().next().value;x=P.size===1,T?(g=T.x,w=T.y):y.style.cursor="grab";try{y.releasePointerCapture?.(V.pointerId)}catch{}},C=V=>{V.preventDefault(),k(s+V.deltaY*.04)};y.addEventListener("pointerdown",F),y.addEventListener("pointermove",E),y.addEventListener("pointerup",I),y.addEventListener("pointercancel",I),y.addEventListener("wheel",C,{passive:!1});let L=V=>{if(!c){if(V.key==="Tab"){V.preventDefault(),S.focus({preventScroll:!0});return}if(V.key==="Escape"){V.stopPropagation(),j.close();return}if(V.key==="ArrowLeft"||V.key==="ArrowRight")i+=V.key==="ArrowLeft"?-4:4;else if(V.key==="ArrowUp"||V.key==="ArrowDown")a=Math.max(-vt,Math.min(vt,a+(V.key==="ArrowUp"?4:-4)));else if(V.key==="+"||V.key==="="){k(s-5),V.preventDefault();return}else if(V.key==="-"){k(s+5),V.preventDefault();return}else return;V.preventDefault(),b()}};window.addEventListener("keydown",L);let N=0,O=(V,T)=>{if(!d){T?.();return}let B=V===1?0:1,D=performance.now(),G=()=>{if(c)return;let U=r<=0?1:Math.min(1,(performance.now()-D)/r);d?.setOpacity(B+(V-B)*U),n.requestRender(),U<1?N=requestAnimationFrame(G):T?.()};N=requestAnimationFrame(G)};O(1);let H=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(N),y.removeEventListener("pointerdown",F),y.removeEventListener("pointermove",E),y.removeEventListener("pointerup",I),y.removeEventListener("pointercancel",I),y.removeEventListener("wheel",C),window.removeEventListener("keydown",L),y.remove(),M?.isConnected&&M.focus({preventScroll:!0}),d?.dispose(),n.camera.position.set(f[0],f[1],f[2]),n.camera.perspective({fov:h,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},j={close(){if(c)return;let V=()=>{H(),o.onClose?.()};cancelAnimationFrame(N),O(0,V)},dispose:H};return S.addEventListener("click",()=>j.close()),j}var Pf,If=Un(()=>{"use strict";wf();Dr();Dr();Ca();Pf=.15});var Rf={};qa(Rf,{createOpenPanorama:()=>$x});function $x(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:f,isDisposed:d,flightGen:h,setPanorama:p,getLoadAbort:b,setLoadAbort:y,setPanoramaSphereVisible:M,setFrozen:S,raisePanoramaLayer:A,restorePanoramaLayer:x,getOverviewChip:g,labelOverlay:w,reducedMotion:v,removeArriveChip:P,showArriveChip:R}=e;return async(k,F,E)=>{b()?.abort();let I=new AbortController;y(I);let C=n.seats.idToIndex.get(k);if(C===void 0){i.syncFromCamera();return}let L=s.get(k)?.label??k,N=l(k,C),O=c(k);if(!O){I.abort(),b()===I&&y(null),i.syncFromCamera();return}S(!0),a.stop();let H;try{H=await O}catch{if(b()===I&&y(null),r.panoramaFailed(k,"source"),!d()&&E===h()){S(!1),i.resumeAfterFlight(N.focal),a.requestRender();let q=R(k,E,!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())}return}if(d()||E!==h()){I.abort(),b()===I&&y(null);return}P();let j=g(),V=()=>{I.abort(),b()===I&&y(null),p(null),M(!1),x(),j.style.display="",w.setVisible(!o.arriveAtSeatEye),S(!1),r.panoramaClosed(),i.resumeAfterFlight(N.focal),a.requestRender();let q=R(k,h());requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())},T=H.generated===!0,B=xf(H);A(),M(!T),j.style.display="none";let D=v()?0:F,G=u(),U=G&&!f()?await Af(t,T?null:H,{gl:m,scene:G.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:T?N.eye:void 0,focalWorld:N.focal},{fadeMs:D,seatLabel:L,disclosure:B,disclosurePrefix:T?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:V,signal:I.signal}):null;if(d()||E!==h()){I.abort(),M(!1),b()===I&&y(null),U?.dispose(),j.style.display="",x();return}if(U)i.syncFromCamera(),w.setVisible(!1),S(!1),a.requestRender(),p(U);else if(T){x(),j.style.display="",S(!1),i.resumeAfterFlight(N.focal),a.requestRender(),p(null),M(!1),r.panoramaFailed(k,"mount");let q=R(k,h(),!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus()),b()===I&&y(null);return}else M(!1),r.panoramaFallback(k),p(Mf(t,H,{fadeMs:D,seatLabel:L,disclosure:B,onClose:V,signal:I.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var Ef=Un(()=>{"use strict";Dr();If()});var fM={};qa(fM,{VENUE3D_QUALITY_REPORT_VERSION:()=>ym,autoVenue3d:()=>xr,buildSceneModel:()=>Ln,estimateVenue3D:()=>Ao,inspectVenue3DQualityEvidence:()=>Pr,mountVenue3D:()=>mM,prepareVenue3D:()=>jf,prepareVenue3DFromChart:()=>Wf});module.exports=sd(fM);function Ja(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let f=0;f<o;f+=c)l+=t[f*3],u+=t[f*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var Xf=require("ogl");function es(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let x=0;x<r;x++){let g=o[x*3],w=o[x*3+2];g<i&&(i=g),g>a&&(a=g),w<s&&(s=w),w>c&&(c=w)}for(let x of t.stages)i=Math.min(i,x.cx-x.halfX),a=Math.max(a,x.cx+x.halfX),s=Math.min(s,x.cz-x.halfZ),c=Math.max(c,x.cz+x.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,f=x=>u+(x-i)*l,d=x=>m+(x-s)*l,h=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*h),p.height=Math.round(104*h),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let y=document.createElement("canvas");y.width=p.width,y.height=p.height;let M=y.getContext("2d");if(M){M.scale(h,h),M.fillStyle="rgba(214,222,234,.28)";let x=Math.max(1,Math.ceil(r/6e3));for(let g=0;g<r;g+=x)M.fillRect(f(o[g*3])-.6,d(o[g*3+2])-.6,1.2,1.2);M.fillStyle="rgba(236,240,246,.16)",M.strokeStyle="rgba(236,240,246,.55)",M.lineWidth=1;for(let g of t.stages){let w=f(g.cx-g.halfX),v=d(g.cz-g.halfZ),P=g.halfX*2*l,R=g.halfZ*2*l;M.fillRect(w,v,P,R),M.strokeRect(w+.5,v+.5,Math.max(0,P-1),Math.max(0,R-1))}}let S=p.getContext("2d"),A="";return{el:p,update(x,g){if(!x||!S||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),A="";return}let w=f(x[0]),v=d(x[2]),P=g?Math.atan2(g[2],g[0]):0,R=`${w.toFixed(1)},${v.toFixed(1)},${P.toFixed(2)}`;if(R!==A){if(A=R,b.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,p.width,p.height),S.drawImage(y,0,0),S.setTransform(h,0,0,h,0,0),g){let k=S.createRadialGradient(w,v,0,w,v,26);k.addColorStop(0,"rgba(255,255,255,.55)"),k.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=k,S.beginPath(),S.moveTo(w,v),S.arc(w,v,26,P-.5,P+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(w,v,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){p.remove()}}}var Pe={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,body:10,head:11},cd=.44,ld=.15,ts=.3,ud=.24;function ns(e){return e===void 0||!Number.isFinite(e)||e<=0?ud:Math.min(ts,Math.max(ld,e*cd))}var Wn=.21,md=.05,Qr=.45,Et=Qr+md,Xn=.92,jn=.66,Jr=1.205,os=-.23,rs=.38,fd=[{part:Pe.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:Pe.pad,min:[-1,.36,-.95],max:[1,Qr,1]},{part:Pe.back,min:[-1,Et,-1],max:[1,Xn,-.72]},{part:Pe.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:Pe.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:Pe.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:Pe.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:Pe.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:Pe.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:Pe.leg,min:[.62,0,.48],max:[.82,.37,.7]}],dd=[{part:Pe.body,min:[-.52,.39,-.08],max:[-.08,.55,.82]},{part:Pe.body,min:[.08,.39,-.08],max:[.52,.55,.82]},{part:Pe.body,min:[-.47,.05,.58],max:[-.13,.43,.82]},{part:Pe.body,min:[.13,.05,.58],max:[.47,.43,.82]},{part:Pe.head,min:[-.16,1.04,-.33],max:[.16,1.1,-.13]}],hd=[{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 is(){let e=[],t=[],n=[],o=[],r=(T,B,D)=>{let G=n.length,[U,q,$]=T,te=[q[0]-U[0],q[1]-U[1],q[2]-U[2]],Q=[$[0]-U[0],$[1]-U[1],$[2]-U[2]],X=te[1]*Q[2]-te[2]*Q[1],Y=te[2]*Q[0]-te[0]*Q[2],K=te[0]*Q[1]-te[1]*Q[0],J=Math.hypot(X,Y,K);J>1e-9?(X/=J,Y/=J,K/=J):[X,Y,K]=B,X*B[0]+Y*B[1]+K*B[2]<0&&(X=-X,Y=-Y,K=-K);for(let ce of T)e.push(...ce),t.push(X,Y,K),n.push(D);o.push(G,G+1,G+2,G,G+2,G+3)},i=T=>{for(let B of hd){let D=B.c.map(G=>G.map((U,q)=>U?T.max[q]:T.min[q]));r(D,B.n,T.part)}},a=(T,B)=>{let[D,G,U]=B?[0,1,2]:[0,2,1],q=T.min[D],$=T.max[D],te=T.min[G],Q=T.max[G],X=($-q)*.1,Y=(Q-te)*.1,K=B?[[q+X,te],[$-X,te],[$,te+Y],[$*.94,Q-(Q-te)*.23],[$*jn,Q],[q*jn,Q],[q*.94,Q-(Q-te)*.23],[q,te+Y]]:[[q+X,te],[$-X,te],[$,te+Y],[$,Q-Y],[$-X,Q],[q+X,Q],[q,Q-Y],[q,te+Y]],J=(oe,ee,ne)=>{let he=[0,0,0];return he[D]=oe,he[G]=ee,he[U]=ne,he},ce=[T.min[U],T.max[U]].map(oe=>K.map(([ee,ne])=>J(ee,ne,oe)));for(let oe=0;oe<K.length;oe++){let ee=(oe+1)%K.length,ne=[0,0,0];ne[D]=(K[oe][0]+K[ee][0])/2-(q+$)/2,ne[G]=(K[oe][1]+K[ee][1])/2-(te+Q)/2,r([ce[0][oe],ce[0][ee],ce[1][ee],ce[1][oe]],ne,T.part)}for(let oe=0;oe<2;oe++){let ee=[0,0,0];ee[U]=oe?1:-1;let ne=ce[oe];for(let he=1;he<ne.length-1;he++){let re=n.length;for(let ve of[ne[0],ne[he],ne[he+1]])e.push(...ve),t.push(...ee),n.push(T.part);o.push(re,re+1,re+2)}}};for(let T of fd)T.part===Pe.pad||T.part===Pe.back?a(T,T.part===Pe.back):i(T);for(let T of dd)i(T);let s=Qr,c=1.08,l=.47,u=.69,m=-.55,f=.08,d=-.48,h=.01,p=[-l,s,m],b=[l,s,m],y=[-l,s,f],M=[l,s,f],S=[-u,c,d],A=[u,c,d],x=[-u,c,h],g=[u,c,h];r([b,A,g,M],[1,0,0],Pe.body),r([y,x,S,p],[-1,0,0],Pe.body),r([p,b,M,y],[0,-1,0],Pe.body);let w=c+.07,v=.24,P=[-v,w,d],R=[v,w,d],k=[-v,w,h],F=[v,w,h];r([x,k,P,S],[-.5,1,0],Pe.body),r([k,F,R,P],[0,1,0],Pe.body),r([F,g,A,R],[.5,1,0],Pe.body),r([M,g,x,y],[0,0,1],Pe.body),r([g,F,k,x],[0,0,1],Pe.body),r([p,S,A,b],[0,0,-1],Pe.body),r([S,P,R,A],[0,0,-1],Pe.body);let E=10,I=8,C=[0,Jr,os],L=[.32,.115,rs],N=n.length;for(let T=0;T<=I;T++){let B=Math.PI*T/I,D=Math.cos(B),G=Math.sin(B);for(let U=0;U<=E;U++){let q=Math.PI*2*U/E,$=G*Math.cos(q),te=G*Math.sin(q);e.push(C[0]+L[0]*$,C[1]+L[1]*D,C[2]+L[2]*te);let Q=$/L[0],X=D/L[1],Y=te/L[2],K=Math.hypot(Q,X,Y)||1;Q/=K,X/=K,Y/=K,t.push(Q,X,Y),n.push(Pe.head)}}for(let T=0;T<I;T++)for(let B=0;B<E;B++){let D=N+T*(E+1)+B,G=D+E+1;o.push(D,G,D+1,D+1,G,G+1)}let O=new Float32Array(e),H=new Float32Array(t),j=new Float32Array(n),V=new Uint16Array(o);return{position:O,normal:H,part:j,index:V,vertexCount:n.length,indexCount:o.length}}function as(e,t,n,o){let r=new Float32Array(t),i=l=>e[l*3],a=l=>e[l*3+2],s=0,c=(l,u)=>{let m=u-l;for(let f=l;f<u;f++){let[d,h]=o(f),p=d-i(f),b=h-a(f);if(m>=2){let y=Math.max(l,f-1),M=Math.min(u-1,f+1),S=i(M)-i(y),A=a(M)-a(y),x=Math.hypot(S,A);if(x>1e-6){let g=-A/x,w=S/x;g*p+w*b<0&&(g=-g,w=-w),p=g,b=w}}r[f]=p===0&&b===0?0:Math.atan2(p,b)}};for(let l=1;l<=t;l++)(l===t||n(l)!==n(s))&&(c(s,l),s=l);return r}var ei=78,ss=18;function cs(){let e=[],t=[],n=[],o=[],r=[],i=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,Et,-1],max:[1,Xn,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-jn)/(Xn-Et):0),m=Math.hypot(c.n[0],u,c.n[2]),f=[c.n[0]/m,u/m,c.n[2]/m];for(let[d,h]of c.c.entries()){let p=h.map((b,y)=>s.min[y]+b*(s.max[y]-s.min[y]));s.part===2&&(p[0]*=1-h[1]*(1-jn)),e.push(...p),t.push(...f),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][d])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var bs=require("ogl");var pd=/^#?([\da-f]{3}|[\da-f]{6})$/i;function ls(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function bd(e){let t=pd.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function ye(e){let t=bd(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function ti(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function yd(e){return .2126*ti(e[0])+.7152*ti(e[1])+.0722*ti(e[2])}function us(e){return yd([e[0]*255,e[1]*255,e[2]*255])}function gd(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 dt(e,t){let n=gd(e);return ge(e,[n,n,n],t)}function ms({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var ni=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,oi=e=>e<=.0031308?12.92*e:1.055*Math.max(0,e)**.4166666666666667-.055,ri=e=>Math.min(1,Math.max(0,e));function To(e){let t=ni(e[0]),n=ni(e[1]),o=ni(e[2]),r=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*o),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*o),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*o);return[.2104542553*r+.793617785*i-.0040720468*a,1.9779984951*r-2.428592205*i+.4505937099*a,.0259040371*r+.7827717662*i-.808675766*a]}function _o([e,t,n]){let o=(e+.3963377774*t+.2158037573*n)**3,r=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[ri(oi(4.0767416621*o-3.3077115913*r+.2309699292*i)),ri(oi(-1.2684380046*o+2.6097574011*r-.3413193965*i)),ri(oi(-.0041960863*o-.7034186147*r+1.707614701*i))]}var Lo=e=>To(e)[0];function Yn(e){let[,t,n]=To(e);return Math.hypot(t,n)}function Wt(e,t,n){let[,o,r]=To(e);if(n===void 0)return _o([t,o,r]);let i=Math.hypot(o,r),a=i===0?0:n/i;return _o([t,o*a,r*a])}function fs(e,t,n){let[o,r,i]=To(e);return o>=t&&o<=n?e:_o([Math.min(n,Math.max(t,o)),r,i])}function ko(e){return _o([e,-.004,-.008])}var ze=["available","held","sold","selected","dimmed"];function Kn(e){let t=ze.indexOf(e);return t<0?0:t}var hs={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function xd(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var ds={day:{ground:.9,deck:.84,fascia:.77,shell:.79,seatMin:.45,seatMax:.58,unavailable:.58,dimmed:.62,sectionDeck:.66,sectionDeckChromaShare:.8,sectionDeckChromaCap:.11,stageTop:.52,stageWall:.42},night:{ground:.26,deck:.34,fascia:.28,shell:.32,seatMin:.64,seatMax:.8,unavailable:.42,dimmed:.39,sectionDeck:.34,sectionDeckChromaShare:.45,sectionDeckChromaCap:.05,stageTop:0,stageWall:0}},Oo=.012;function an(e){return Lo(e.tierTop)>.6}function Xt(e){return e?ds.day:ds.night}function ps(e,t){let n=Xt(t);return fs(xd(e),n.seatMin,n.seatMax)}var ii={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]},Yt={top:[.05,.06,.08],bottom:[.1,.12,.15]};function le(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function Md(){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 Fo=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 bs.Renderer({canvas:this.canvas,dpr:Md(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Yt.top[0],Yt.top[1],Yt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),t.appendChild(this.canvas),this.lostHandler=o=>{o.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(t){this.clearRgb=[t[0],t[1],t[2]],this.gl.clearColor(t[0],t[1],t[2],1)}get clearColor(){return this.clearRgb}resize(){let t=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(t,n),{width:t,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let t=this.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let t=this.gl.getExtension("WEBGL_lose_context");t&&(t.loseContext(),setTimeout(()=>{t.restoreContext&&t.restoreContext()},300))}};var cn=require("ogl"),Be=Math.PI/180,ai=15*Be,si=80*Be,sn=.12,ys=35,ci=1.25,gs=.006,vd=4,ln=.82,$n=1/ln,Sd=.12,wd=2;function Pd(e,t){return{azimuth:0-e*gs,polar:-t*gs}}function xs(e,t,n){let o=Math.max(wd,Math.max(1,t)*Sd),r=n*vd;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var Ad=1.5;function Id(e,t,n){let o=Math.max(1,n)*Ad;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function Rd(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],f=[-m[2],0,m[0]],d=Math.hypot(f[0],f[2])||1;f=[f[0]/d,0,f[2]/d];let h=[f[1]*m[2]-f[2]*m[1],f[2]*m[0]-f[0]*m[2],f[0]*m[1]-f[1]*m[0]],p=Math.tan(r*Be/2),b=p*(i>0?i:1),y=[0,1,2].map(A=>m[A]+a*b*f[A]+s*p*h[A]);if(y[1]>=-1e-6)return null;let M=(e[1]-u[1])/y[1],S=Math.hypot(y[0],y[1],y[2]);return!(M>0)||M*S>o*Ed?null:[u[0]+y[0]*M,e[1],u[2]+y[2]*M]}var Ms=3,Ed=4,vs=.72,Cd=.6;function _d(e,t,n){return e!=="auto"?e:n!==null&&t<n*Cd?"pan":"orbit"}function Ss(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var Td=.4;function Ld(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=Ss(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.hypot(u,f),S=u/M,A=f/M,x=S*p+A*y,g=Td*Math.max(1,e.radius);for(let w=0;w<3;w++){let v=1/0,P=-1/0,R=1/0,k=-1/0;for(let N=0;N+2<c.length;N+=3){let O=c[N]-a[0],H=c[N+1]-a[1],j=c[N+2]-a[2],V=s+O*u+H*m+j*f;if(!(V>.001))continue;let T=(O*d+j*h)/(V*t),B=(O*p+H*b+j*y)/(V*n);T<v&&(v=T),T>P&&(P=T),B<R&&(R=B),B>k&&(k=B)}if(!Number.isFinite(v))break;let F=(v+P)/2*s*t,E=Math.abs(x)>.1?(R+k)/2*s*n/x:0,I=F*d+E*S,C=F*h+E*A;if(Math.hypot(a[0]+I-e.center[0],a[2]+C-e.center[2])>g){let N=a[0]-e.center[0],O=a[2]-e.center[2],H=N+I,j=O+C,V=g/Math.hypot(H,j);I=H*V-N,C=j*V-O}a=[a[0]+I,a[1],a[2]+C],s=i(a)}return{center:a,distance:s}}var Do=class{constructor(t,n,o,r){this.fovY=ys;this.target=new cn.Vec3;this.azimuth=-30*Be;this.polar=55*Be;this.distance=10;this.azT=-30*Be;this.polT=55*Be;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new cn.Vec3;this.panAnchor=new cn.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new cn.Camera(t,{fov:ys,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,this.onPointerDown=i=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(i.pointerId)}catch{}if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size===1){let a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size>=2){let l=this.currentPinchDistance(),u=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-l)*.005),u.x,u.y),this.fireGesture()),this.pinchDist=l;let m=this.currentPinchAngle(),f=m-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=m,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let a=i.clientX-this.lastX,s=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&(this.panBy(a,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(a!==0||s!==0)&&this.fireGesture();let c=Pd(a,s);this.azT+=c.azimuth,this.polT=Math.max(ai,Math.min(si,this.polT+c.polar)),this.requestRender()},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*Be;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(ai,Math.min(si,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(ln);else if(i.key==="-"||i.key==="_")this.dollyBy($n);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*Be/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,f=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*f)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){this.panBox=Id(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return _d(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(Ms,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(Ms,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?Rd([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*Be/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*Be,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*Be;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??ci)),this.envelope=xs(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*Be,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*Be/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*Be;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??ci)),this.envelope=xs(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*Be/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*Be;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??ci))}framedOn(t,n,o){return Ld(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=Ss(r,i);if(!l)return s;let{fx:u,fy:m,fz:f,rx:d,rz:h,ux:p,uy:b,uz:y}=l,M=Math.tan(o),S=Math.tan(n),A=1;for(let R=0;R<8;R++){let k=(R&1?c.max[0]:c.min[0])-t.center[0],F=(R&2?c.max[1]:c.min[1])-t.center[1],E=(R&4?c.max[2]:c.min[2])-t.center[2],I=k*u+F*m+E*f,C=Math.abs(k*d+E*h),L=Math.abs(k*p+F*b+E*y);A=Math.max(A,C/M-I,L/S-I)}let x=Math.min(s,Math.max(A,a*.35)),g=t.fitPoints;if(!g||g.length<9)return x;let w=0,v=1/(M*vs),P=1/(S*vs);for(let R=0;R+2<g.length;R+=3){let k=g[R]-t.center[0],F=g[R+1]-t.center[1],E=g[R+2]-t.center[2],I=k*u+F*m+E*f,C=Math.abs(k*d+E*h),L=Math.abs(k*p+F*b+E*y);w=Math.max(w,C*v-I,L*P-I)}return Math.min(x*1.5,Math.max(x*.55,w))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=Fd(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s;return this.azimuth+=t*sn,this.polar+=n*sn,this.distance+=o*sn,this.target.x+=r*sn,this.target.y+=i*sn,this.target.z+=a*sn,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(ai,Math.min(si,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},kd=.1,Od=.25;function Fd(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?Od:Math.max(.05,n*kd),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var No=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function ws(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function li(e,t,n){return Math.max(t,Math.min(n,e))}function Dd(e){return li(e,0,1)}function Ps(e){let t=Dd(e);return t*t*(3-2*t)}var un=2.5,Nd=1.15,Zn=12,mn=22,As=6,Is=9.5,Rs=.9,Es=2.2,ui=30,mi=4,Bo=8192;var TM=mn+mi;function Cs(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:un};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:un+r*(Nd-un)}}function _s(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var Bd=12;function Ts(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=Bd}var fi=[{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"}],kM=new Map(fi.map(e=>[e.key,e]));var Vd={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 Vo(e){let t=e?.[0];return t&&Vd[t]||"#3b82f6"}var Gd=[{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"}],OM=new Map(Gd.map(e=>[e.key,e]));var Hd=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],FM=new Set(Hd);var ks=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L9 12 L12 17 L15 12 L18 12 L14 19 L17 23 L14 23 L12 21 L10 23 L7 23 L10 19 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],Os=ks.map(e=>e.key),zd=new Map(ks.map(e=>[e.key,e]));function Ls(e){return typeof e=="string"&&zd.has(e)}function Fs(e,t){return Ls(e)?e:Ls(t?.seatGlyph)?t.seatGlyph:"circle"}var fe=.02291666666666667,et=1/fe,Ud=58,jd=Ud*fe;var Wd=3,Ds=0,di=120,Xd=0,Yd=45,Kd=7,ht=1.2;function hi(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function $d(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=Kd?e:Wd}function Ct(e,t={}){let n=hi(t.floorBaseHeightM,Ds,di,0),o=Math.min(di,n+$d(e.elevation)*jd),r=e.height===void 0?o:hi(e.height,Ds,di,o),i=hi(e.rake,Xd,Yd,0);return{height:r,rake:i}}var Bs=ft(require("earcut"),1),yi=ft(require("polygon-clipping"),1);var HM=Math.PI/180;function Ve(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function pi(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function bi(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function fn(e){return e.length?bi(e):null}function $e(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ze(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var _=fe,Zd=.002;function qd(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Zd}var Kt=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},zo=class{constructor(){this.pos=new Kt;this.nor=new Kt;this.col=new Kt;this.flr=new Kt;this.mat=new Kt;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i){qd(t,n,o)||(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}triN(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function Qd(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,f=Math.hypot(l,u,m)||1;return l/=f,u/=f,m/=f,[l,u,m]}function Jd(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,Bs.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function pt(e){return $e(e)<0?[...e].reverse():e}var eh=3;function th(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(d,h,p,b)=>Math.abs(o({x:(d.x+h.x)/2,y:(d.y+h.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),f=(d,h,p)=>{let b=Math.abs(o({x:(d+c)/2,y:(h+l)/2})-(p+u)/2);b>m&&(m=b)};return f((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),f((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),f((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function qn(e,t,n,o,r){if(r<=0)return th(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(qn(e,i,s,o,r-1),qn(i,t,a,o,r-1),qn(s,a,n,o,r-1),qn(i,a,s,o,r-1))}function Qn(e,t,n,o,r,i,a,s){if(a>0){let f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},d={x:(n.x+o.x)/2,y:(n.y+o.y)/2},h={x:(o.x+t.x)/2,y:(o.y+t.y)/2};Qn(e,t,f,h,r,i,a-1,s),Qn(e,f,n,d,r,i,a-1,s),Qn(e,h,d,o,r,i,a-1,s),Qn(e,f,d,h,r,i,a-1,s);return}let c=[t.x*_,r(t),t.y*_],l=[n.x*_,r(n),n.y*_],u=[o.x*_,r(o),o.y*_];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Qd(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var nh=8;function Ns(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),nh)}return o}function Go(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var Ho=.001*et*.1;function ue(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs($e(t))<1e-4))return;let u=Go(Ns(Go(pt(t),Ho),o,c),Ho),m=n?.map(g=>Go(Ns(Go(pt(g),Ho),o,c),Ho)).filter(g=>g.length>=3&&Math.abs($e(g))>=1e-4),{pts:f,tris:d}=Jd(u,m),h=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],M=0;if(Number.isFinite(c))for(;M<eh;M++){let g=0;for(let w=0;w<d.length;w+=3){let v=qn(f[d[w]],f[d[w+1]],f[d[w+2]],o,M);v>g&&(g=v)}if(g<=c)break}for(let g=0;g<d.length;g+=3){let w=f[d[g]],v=f[d[g+1]],P=f[d[g+2]];Qn(e,w,v,P,o,h,M,l);let R=[w.x*_,r,w.y*_],k=[v.x*_,r,v.y*_],F=[P.x*_,r,P.y*_];e.tri(R,F,k,[0,-1,0],p)}let S=g=>{if(M<=0)return g;let w=1<<M,v=[];for(let P=0;P<g.length;P++){let R=g[P],k=g[(P+1)%g.length];for(let F=0;F<w;F++){let E=F/w;v.push({x:R.x+(k.x-R.x)*E,y:R.y+(k.y-R.y)*E})}}return v},A=bi(u),x=[{ring:S(u),flip:!1}];if(m)for(let g of m)g.length>=3&&x.push({ring:S(g),flip:!0});for(let{ring:g,flip:w}of x)for(let v=0;v<g.length;v++){let P=g[v],R=g[(v+1)%g.length],k=(R.x-P.x)*_,E=(R.y-P.y)*_,I=-k,C=Math.hypot(E,I)||1;E/=C,I/=C;let L=(P.x+R.x)/2-A.x,N=(P.y+R.y)/2-A.y,O=E*L+I*N;w&&(O=-O),O<0&&(E=-E,I=-I);let H=[E,0,I],j=[P.x*_,o(P),P.y*_],V=[R.x*_,o(R),R.y*_],T=[P.x*_,r,P.y*_],B=[R.x*_,r,R.y*_];e.tri(j,V,B,H,b,b,y),e.tri(j,B,T,H,b,y,y)}}function Vs(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function at(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=pt(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,f=Math.hypot(u,m)||1;i.push({x:m/f,y:-u/f})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,f=l.y+u.y,d=Math.hypot(m,f),h=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(d<1e-9){h();continue}m/=d,f/=d;let p=m*l.x+f*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){h();continue}a.push([c.x+m*t*b,c.y+f*t*b])}if(a.length<3)return e;try{let s=yi.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let f=Math.abs($e(m[0].map(([d,h])=>({x:d,y:h}))));f>l&&(l=f,c=m[0])}if(!c)return e;let u=c.map(([m,f])=>({x:m,y:f}));if(u.length>1){let m=u[0],f=u[u.length-1];Math.abs(m.x-f.x)<1e-9&&Math.abs(m.y-f.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function _t(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=pt(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],f=u.x+m.x,d=u.y+m.y,h=Math.hypot(f,d),p=h<1e-9?1/0:1/Math.max(f/h*u.x+d/h*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}f/=h,d/=h,a.push({x:l.x+f*t*p,y:l.y+d*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let f=o[u],d=o[m];if((a[l].x-a[c].x)*(d.x-f.x)+(a[l].y-a[c].y)*(d.y-f.y)<=0)return[]}try{let c=yi.default.intersection([[...a.map(h=>[h.x,h.y]),[a[0].x,a[0].y]]],[[...o.map(h=>[h.x,h.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let h of c){let p=Math.abs($e(h[0].map(([b,y])=>({x:b,y}))));p>u&&(u=p,l=h[0])}if(!l)return[];let m=l.map(([h,p])=>({x:h,y:p})),f=m[0],d=m[m.length-1];return m.length>1&&Math.abs(f.x-d.x)<1e-9&&Math.abs(f.y-d.y)<1e-9&&m.pop(),m.length>=3?pt(m):[]}catch{return[]}}function Uo(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function Jn(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var St=.22;function Gs(e,t){let n=ze[e];if(n!=="sold"&&n!=="held")return-1;let o=(t+1)*2654435761;return o^=o>>>15,o=Math.imul(o,2246822519),o^=o>>>13,(o>>>0)%1e5/1e5}var oh=.42;function rh(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let h of e)h.x<o&&(o=h.x),h.y<r&&(r=h.y),h.x>i&&(i=h.x),h.y>a&&(a=h.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),f=new Map,d=(h,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((h-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let h=0;h<t;h++){let p=d(e[h].x,e[h].y),b=f.get(p);b?b.push(h):f.set(p,[h])}for(let h=0;h<t;h++){let p=e[h],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),y=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),M=1/0;for(let S=1;S<=4;S++){for(let A=y-S;A<=y+S;A++)if(!(A<0||A>=m))for(let x=b-S;x<=b+S;x++){if(x<0||x>=u||S>1&&Math.abs(A-y)<S&&Math.abs(x-b)<S)continue;let g=f.get(A*u+x);if(g)for(let w of g){if(w===h)continue;let v=Math.hypot(e[w].x-p.x,e[w].y-p.y);v<M&&(M=v)}}if(Number.isFinite(M)&&M<=S*l)break}n[h]=M}return n}function ih(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-ht):0}function Hs(e,t,n,o,r,i){let a=e.length,s=new Float32Array(a*3),c=new Float32Array(a),l=new Float32Array(a*3),u=new Float32Array(a),m=new Float32Array(a),f=new Float32Array(a),d=new Float32Array(a),h=new Float32Array(a*3),p=new Map,b=rh(e);for(let y=0;y<a;y++){let M=e[y],A=(n?.seatPitchU(y)??b[y])*_;u[y]=Number.isFinite(A)?Math.max(.06,Math.min(St,A*oh)):St,m[y]=ns(Number.isFinite(A)?A:void 0);let x=Fs(M.glyph,{seatGlyph:i?.get(M.categoryKey)});f[y]=Os.indexOf(x),d[y]=M.wheelchairSpaceType==="no-seat"?0:1,s[y*3]=M.x*_,s[y*3+1]=n?n.seatDeckY(y):ih(M),s[y*3+2]=M.y*_,c[y]=Kn(t?t(M):"available");let g=ye(r?.get(M.categoryKey)??"#6e7bff")??[.43,.48,1];if(l[y*3]=g[0],l[y*3+1]=g[1],l[y*3+2]=g[2],M.accessibility?.length){let w=ye(Vo(M.accessibility));w&&(h[y*3]=w[0],h[y*3+1]=w[1],h[y*3+2]=w[2])}p.set(M.id,y)}return{count:a,iPosition:s,iState:c,iCategory:l,iMaxRadius:u,iRing:h,idToIndex:p,iChairWidth:m,iGlyph:f,iPhysicalSeat:d,iFloor:o??new Float32Array(a),iSection:new Float32Array(a).fill(-1),iYaw:new Float32Array(a)}}var ah=64;function gi(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=Kn(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+ah){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var eo=3,$t=.38,to=.24;function sh(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*_,i=(n.y-t.y)*_,a=(o.x-t.x)*_,s=(o.y-t.y)*_,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*_,f=(r*u-a*l)/c+t.y*_,d=Math.hypot(t.x*_-m,t.y*_-f);return d<1||d>200||!Number.isFinite(d)||e.some(h=>Math.abs(Math.hypot(h.x*_-m,h.y*_-f)-d)>.03)?null:{x:m,z:f,radius:d}}function zs(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/eo)},${Math.floor(l/eo)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let f=m.x*_,d=m.y*_,h=o(f,d),p=n.get(h)??[];p.push({x:f,z:d,y:l.y,floor:c.floorIndex}),n.set(h,p)}if(l.patch||l.pts.length<2)continue;let u=sh(l.pts);for(let m of[0,l.pts.length-1]){let f=l.pts[m],d=l.pts[m===0?1:m-1],h=f.x-d.x,p=f.y-d.y,b=Math.hypot(h,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:f,x:f.x*_,z:f.y*_,dx:h/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/eo),m=Math.floor(l/eo);return[-1,0,1].flatMap(f=>[-1,0,1].map(d=>`${u+f},${m+d}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,f=!1;for(let d of i(c.x,c.z))for(let h of r.get(d)??[]){let p=t[h];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,y=p.z-c.z,M=Math.hypot(b,y);if(M<$t*2+.45||M>eo)continue;let S=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,A=Math.min((b*c.dx+y*c.dz)/M,(-b*p.dx-y*p.dz)/M);(S?A<.8:A<.98)||!S&&(Math.abs(b*c.dz-y*c.dx)>.15||Math.abs(b*p.dz-y*p.dx)>.15)||(M<m-.02?(u=h,m=M,f=!1):Math.abs(M-m)<=.02&&(f=!0))}u>=0&&!f&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],f=Math.hypot(m.x-u.x,m.z-u.z),d=(m.x-u.x)/f,h=(m.z-u.z)/f,p=!1;for(let y of i((u.x+m.x)/2,(u.z+m.z)/2))for(let M of n.get(y)??[]){if(M.floor!==u.floorIndex||Math.abs(M.y-u.row.y)>.75)continue;let S=(M.x-u.x)*d+(M.z-u.z)*h,A=Math.abs((M.x-u.x)*h-(M.z-u.z)*d);S>.01&&S<f-.01&&A<to+$t&&(p=!0)}if(p)continue;let b=(y,M)=>({x:(u.x+d*y-h*M)/_,y:(u.z+h*y+d*M)/_});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:f-2*$t,heightM:(u.row.y+m.row.y)/2,outline:[b($t,-to),b(f-$t,-to),b(f-$t,to),b($t,to)]})}return s}var ch=.15,lh=1.6;function Us(e){return li(e??1,ch,lh)}var uh=.15,mh=.9,fh=1.76;function js(e){return xi(e)?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function xi(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55}function dh(){return{background:{top:[...Yt.top],bottom:[...Yt.bottom]},sky:js(null),structure:ii,seatStates:{...hs},seatScale:1,materials:{seat:null,shell:null,roughness:.78}}}function hh(e){return xi(e)?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function Ws(e){let t=dh();e??={};let n=ye(e.background);if(n){t.background={top:le(n,mh),bottom:le(n,fh)},t.sky=js(n);let s={};for(let[l,u]of Object.entries(ii))s[l]=ge(u,n,uh);n[0]*.2126+n[1]*.7152+n[2]*.0722>.55&&(s.ground=le(n,.86)),t.structure=s}let o=ye(e.selectionColor)??ye(e.accent);o&&(t.seatStates={...t.seatStates,selected:o});let r=e.seatScale;typeof r=="number"&&Number.isFinite(r)&&(t.seatScale=Us(r));let i=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([,s])=>s!=null)),a={...hh(n),...i};if(a){let s=ye(a.deck),c=ye(a.fascia);s&&(t.structure={...t.structure,tierTop:s,gaTop:s}),c&&(t.structure={...t.structure,tierWall:c,gaWall:c}),t.materials.seat=ye(a.seat),t.materials.shell=ye(a.shell),typeof a.roughness=="number"&&Number.isFinite(a.roughness)&&(t.materials.roughness=Math.min(1,Math.max(0,a.roughness)))}return ph(t,xi(n)),t}function ph(e,t){let n=Xt(t);e.seatStates={...e.seatStates,held:ko(n.unavailable),sold:ko(n.unavailable),dimmed:ko(n.dimmed)};let o=(i,a)=>Wt(i,a,Math.min(Yn(i),Oo)),r=e.structure;e.structure={...r,ground:o(r.ground,n.ground),tierTop:o(r.tierTop,n.deck),tierWall:o(r.tierWall,n.fascia)},e.materials.shell&&(e.materials.shell=o(e.materials.shell,n.shell))}function Xs(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var bh=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing"]),yh=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Zt(e){return!!e&&bh.has(e)}function jo(e){return!!e&&yh.has(e)}var Mi=1.1;function $s(e){return Xo(e)?e==="ring-boxing"?Mi:.06:1}var gh={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8}},xh={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f"};var Mh=Math.PI*2;function vh(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function Ys(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var Ks=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var Wo="#f1f5f9";function Xo(e){return Zt(e)}function Tt(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*Mh;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function wt(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function Sh(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],f=gh[t],d=p=>f?p/f.width*r:0,h=p=>f?p/f.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:Tt(0,0,d(9.15),h(9.15)),closed:!0});for(let p of[-1,1])m.push({points:wt(p*(l-d(16.5)/2),0,d(16.5)/2,h(40.32)/2),closed:!0}),m.push({points:wt(p*(l-d(5.5)/2),0,d(5.5)/2,h(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*d(7.5),y:-u},{x:p*d(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-d(4)),y:-h(11)},{x:p*(l-d(4)),y:h(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:Tt(p*d(20.5),b*h(7),d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:Tt(0,0,d(4.5),h(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-h(1.22)*8;b>0&&m.push({points:Ys(l-d(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let y=1;y<8;y++){let M=h(1.22)*y,S=u-M;if(S<=0)break;m.push({points:Ys(l-d(1.22)*y,S),closed:!0})}break}case"oval-cricket":{m.push({points:Tt(0,0,d(27.4),h(27.4+20.12/2),40),closed:!0}),m.push({points:wt(0,0,d(3.05)/2,h(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:d(b),y:-u},{x:d(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let y=-35;y<35;y+=4)m.push({points:[{x:d(b*10),y:h(y)},{x:d(b*10),y:h(Math.min(35,y+2))}],closed:!1})}break}case"diamond-baseball":{let p=(L,N)=>({x:d(L),y:h(N)}),{home:b}=Ks,y=27.43,M=y/Math.SQRT2,S={x:b.x+M,y:b.y-M},A={x:b.x,y:b.y-2*M},x={x:b.x-M,y:b.y-M},g={x:b.x,y:b.y-18.44},w="#b98a59",v=xh["diamond-baseball"],P=38.94,R=[p(b.x,b.y)],k=Math.atan2(b.y-P/Math.SQRT2-g.y,P/Math.SQRT2),F=Math.PI-k;for(let L=0;L<=16;L++){let N=k-(k+Math.PI*2-F)%(Math.PI*2)*(L/16);R.push(p(g.x+29*Math.cos(N),g.y+29*Math.sin(N)))}m.push({points:R,closed:!0,fill:w,ink:w});let E={x:b.x,y:b.y-M},I=[{x:b.x,y:b.y},S,A,x].map(L=>p(E.x+(L.x-E.x)*.84,E.y+(L.y-E.y)*.84));m.push({points:I,closed:!0,fill:v,ink:v}),m.push({points:Tt(d(g.x),h(g.y),d(2.74),h(2.74),20),closed:!0,fill:w,ink:w}),m.push({points:Tt(d(b.x),h(b.y),d(3.96),h(3.96),20),closed:!0,fill:w,ink:w});let C=Ks.fence;m.push({points:[p(b.x,b.y),p(C[0].x,C[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(C[C.length-1].x,C[C.length-1].y)],closed:!1});for(let L of[S,A,x])m.push({points:wt(d(L.x),h(L.y),d(.3),h(.3)),closed:!0,fill:Wo});break}case"court-basketball":{m.push({points:wt(0,0,d(14),h(7.5)),closed:!0}),m.push({points:[{x:0,y:-h(7.5)},{x:0,y:h(7.5)}],closed:!1}),m.push({points:Tt(0,0,d(1.8),h(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,y=p*(14-5.8),M=p*(14-1.575);m.push({points:wt(d((b+y)/2),0,d(2.9),h(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:Tt(d(y),0,d(1.8),h(1.8),24),closed:!0});let S=Math.sqrt(6.75*6.75-6.6*6.6),A=[{x:d(b),y:-h(6.6)}],x=Math.atan2(-6.6,-p*S),g=2*Math.atan2(6.6,S);for(let w=0;w<=16;w++){let v=x-p*g*(w/16);A.push({x:d(M+6.75*Math.cos(v)),y:h(6.75*Math.sin(v))})}A.push({x:d(b),y:h(6.6)}),m.push({points:A,closed:!1})}break}case"court-tennis":{m.push({points:wt(0,0,d(11.885),h(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-d(11.885),y:p*h(4.115)},{x:d(11.885),y:p*h(4.115)}],closed:!1}),m.push({points:[{x:p*d(6.4),y:-h(4.115)},{x:p*d(6.4),y:h(4.115)}],closed:!1});m.push({points:[{x:-d(6.4),y:0},{x:d(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-h(6.4)},{x:0,y:h(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:wt(0,0,d(3.05),h(3.05)),closed:!0});let y=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[M,S,A]of y)m.push({points:wt(M*d(3.05),S*h(3.05),d(.3),h(.3)),closed:!0,fill:A,ink:A});break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>vh(b.x,b.y,s,c,n,o))}))}function Zs(e){if(e.role!=="stage"||!Xo(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?Sh({kind:e.stageKind,...t}):[]}function qs(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function Qs(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[qs(e,.5)];let o=Array.from({length:n+1},(c,l)=>qs(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],f=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*f,y:o[s-1].y+(o[s].y-o[s-1].y)*f})}return a}var dn=Math.PI*2;function hn(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function wh(e,t,n){let o=t-e;if(n){for(;o<0;)o+=dn;for(;o>=dn;)o-=dn}else{for(;o>0;)o-=dn;for(;o<=-dn;)o+=dn}return o}function tc(e){if(e.version!==1||e.closed!==!0||!hn(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!hn(n.end))return!1;if(n.kind==="line"){if(Ve(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!hn(n.control1)||!hn(n.control2)||Ve(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!hn(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(Ve(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(Ve(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Ve(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return Ve(t,e.start)<=1e-4}function Ph(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function nc(e,t=2){if(!tc(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=wh(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=Ve(r,i.control1)+Ve(i.control1,i.control2)+Ve(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(Ph(r,i,c/s))}r=i.end}return Ve(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var Ah=45,vi=150,Ih=60;function Rh(e){let t=Ah/100;if(e<=t)return vi;let n=Math.min(1,(e-t)/(1-t));return vi-n*(vi-Ih)}var Js=.5523;function ec(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function Eh(e){let t=[],n=[];for(e.forEach((o,r)=>{hn(o)&&(t.length&&ec(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&ec(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var Ch=.5,_h=4/3;function Th(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*_h;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function oc(e,t){let{points:n,sourceIndex:o}=Eh(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let A=0;A<r;A+=1){let x=a[o[A]];s[A]=Number.isFinite(x)?Math.min(100,Math.max(-100,x))/100:0}let c=s.some(A=>Math.abs(A)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??Rh(i),u=[];for(let A=0;A<r;A+=1)u[A]=Ve(n[A],n[(A+1)%r]);let m=new Array(r).fill(0);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],w=n[(A+1)%r],v={x:x.x-g.x,y:x.y-g.y},P={x:w.x-g.x,y:w.y-g.y},R=Math.hypot(v.x,v.y),k=Math.hypot(P.x,P.y);if(R<=1e-9||k<=1e-9)continue;let F=Math.min(1,Math.max(-1,(v.x*P.x+v.y*P.y)/(R*k))),E=Math.acos(F)*180/Math.PI;if(E<l)continue;let I=Ps((E-l)/(180-l));m[A]=i*I*.5*Math.min(R,k)}for(let A=0;A<r;A+=1){let x=(A+1)%r,g=m[A]+m[x];if(g>u[A]&&g>1e-9){let w=u[A]/g;m[A]*=w,m[x]*=w}}let f=new Array(r),d=new Array(r);for(let A=0;A<r;A+=1){let x=n[(A-1+r)%r],g=n[A],w=n[(A+1)%r];if(m[A]<=1e-6){f[A]={...g},d[A]={...g};continue}let v=Ve(g,x)||1,P=Ve(g,w)||1;f[A]={x:g.x+(x.x-g.x)/v*m[A],y:g.y+(x.y-g.y)/v*m[A]},d[A]={x:g.x+(w.x-g.x)/P*m[A],y:g.y+(w.y-g.y)/P*m[A]}}if(m.every(A=>A<=1e-6)&&!c)return null;let h=[],p={...d[0]},b=p,y=(A,x)=>{if(Ve(b,A)<=1e-9)return;let g=s[x];Math.abs(g)>1e-6?h.push(Th(b,A,g*Ch*u[x])):h.push({kind:"line",end:{...A}}),b=A};for(let A=1;A<=r;A+=1){let x=A%r,g=n[x];y(f[x],(A-1)%r),m[x]>1e-6&&Ve(f[x],d[x])>1e-9&&(h.push({kind:"bezier",control1:pi(f[x],g,Js),control2:pi(d[x],g,Js),end:{...d[x]}}),b=d[x])}if(!h.length)return null;let M=h[h.length-1];Ve(M.end,p)>1e-9&&(M.kind==="line"?M.end={...p}:h.push({kind:"line",end:{...p}}));let S={version:1,closed:!0,start:p,segments:h};return tc(S)?S:null}function Lh(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function kh(e){let t=Lh(e);return t.length?oc(e.points,{edgeCurvature:t}):null}function Yo(e,t=2){let n=kh(e);return n?nc(n,t):e.points??[]}function rc(e){return e.kind==="polygon"?no(e.holes):[]}function ac(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((f,d)=>f.segmentedRow.componentIndex-d.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((f,d)=>f.segmentedRow?.kind==="segmented-row-v1"&&f.segmentedRow.groupId===o&&f.segmentedRow.componentCount===a&&f.segmentedRow.componentIndex===d&&f.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(d===0?f.segmentedRow.boundaryBefore==="start":f.segmentedRow.boundaryBefore!=="start")&&f.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((f,d)=>f+d.seatCount,0),u=0,m=0;for(let f of i)f.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(f.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=f.seatCount,m+=f.seatCount}return t}var Oh="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var Fh="abcdefghijklmnopqrstuvwxyz";function Dh(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function oo(e,t=!1){let n=t?Fh:Oh;return Dh(Math.max(0,Math.floor(e)-1),n)}var Nh=[[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 sc(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of Nh)for(;t>=o;)n+=r,t-=o;return n}function Bh(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function wi(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let d=Math.ceil(c/2),h=i==="updown"?t<d?n+2*t:n-1+2*(c-t):t<d?n+2*(d-1-t):n+1+2*(t-d);return`${a}${h}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?Bh(c)[t]:o==="rtl"?c-1-t:t,f;switch(i){case"odd":{let d=u%2===1?u:u+1;f=String(d+m*2);break}case"even":{let d=u%2===0?u:u+1;f=String(d+m*2);break}case"roman":f=sc(u+m*r);break;case"letters-upper":f=oo(u+m*r,!1);break;case"letters-lower":f=oo(u+m*r,!0);break;default:f=String(u+m*r);break}return`${a}${f}`}function Vh(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function cc(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${wi(e,t)}`}function Gh(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:wi(e,t)};let r=Vh(n);return{row:n.displayLabel,seat:wi(r,n.displayOffset+t)}}function Pi(e,t,n,o){let r=Gh(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function lc(e,t){return`${e.label}-${t+1}`}function Hh(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function zh(e,t){let n=e.chairNumbering,o=n?.start??1,r=Hh(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?oo(Math.max(1,o)+r):String(o+r)}function uc(e,t){let n=zh(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function mc(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 pn(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),f=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(f)>=o)continue;let d=Math.hypot(m,f);d<o&&(o=d)}return o}function Uh(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function fc(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function Ai(e,t){let n=1/0;for(let o of mc(e)){let r=pn(t,o.x,o.y);r<n&&(n=r)}for(let o of mc(t)){let r=pn(e,o.x,o.y);r<n&&(n=r)}return n}function jh(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function Ii(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let M of e)n+=M.x,o+=M.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let M of e){let S=M.x-n,A=M.y-o;r+=S*S,a+=A*A,i+=S*A,s+=S*S*S,c+=A*A*A,l+=S*A*A,u+=A*S*S}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let f=(s+l)/2,d=(c+u)/2,h=(f*a-d*i)/m,p=(d*r-f*i)/m,b=h+n,y=p+o;return!Number.isFinite(b)||!Number.isFinite(y)?null:{cx:b,cy:y}}var Wh=.15,Xh=.001;function Yh(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let a=0;for(let s of e){let c=Math.abs((s.x-t.x)*r-(s.y-t.y)*o)/i;c>a&&(a=c)}return a/i}function Kh(e){if(e.length<2)return null;let t=e.map(x=>{let g=0,w=0;for(let v of x.pts)g+=v.x,w+=v.y;return{x:g/x.pts.length,y:w/x.pts.length}}),n=0,o=0;for(let x of t)n+=x.x,o+=x.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let x of t){let g=x.x-n,w=x.y-o;r+=g*g,i+=g*w,a+=w*w}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let f=Math.hypot(u,m);if(!(f>1e-12))return null;u/=f,m/=f;let d=0,h=0,p=0;for(let x of e){if(x.pts.length<2)continue;let g=x.pts[0],w=x.pts[x.pts.length-1],v=w.x-g.x,P=w.y-g.y,R=Math.hypot(v,P);if(!(R>1e-9))continue;let k=v/R,F=P/R;d+=(k*k-F*F)*R,h+=2*k*F*R,p+=R}if(p>0&&Math.hypot(d,h)>=Zh*p){let x=Math.atan2(h,d)/2;u=-Math.sin(x),m=Math.cos(x)}let b=1/0,y=-1/0,M=[];for(let x of e){let g=1/0,w=-1/0;for(let v of x.pts){let P=v.x*u+v.y*m;P<g&&(g=P),P>w&&(w=P),P<b&&(b=P),P>y&&(y=P)}M.push(w-g)}let S=y-b;return S>1e-9?(M.sort((x,g)=>x-g),M[Math.min(M.length-1,Math.floor(M.length*.9))]/S<=$h?{x:u,y:m}:null):null}var $h=.35,Zh=.8;function Ko(e,t,n,o){let r=new Map;for(let g of n){let w=t[g],v=w.rowId||`__seat-${g}`,P=r.get(v);P||(P={pts:[],idx:[]},r.set(v,P)),P.pts.push({x:w.x,y:w.y}),P.idx.push(g)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[g,w]of r){let v=jh(w.pts,w.idx),P=0;for(let R of v.pts)P+=Math.hypot(R.x-o.x,R.y-o.y);i.push({id:g,pts:v.pts,seatIndices:v.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:P/v.pts.length})}let a=i.map(g=>Uh(g.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((g,w)=>[g,w])):null,u=(g,w)=>(g>w&&([g,w]=[w,g]),g*(2*i.length-g-1)/2+(w-g-1)),m=(g,w)=>{if(!c)return Ai(i[g].pts,i[w].pts);let v=u(g,w),P=c[v];if(!Number.isNaN(P))return P;let R=Ai(i[g].pts,i[w].pts);return c[v]=R,R},f=(g,w)=>l?m(l.get(g),l.get(w)):Ai(g.pts,w.pts),d=[];for(let g=0;g<i.length;g++){let w=1/0;for(let v=0;v<i.length;v++){if(g===v||fc(a[g],a[v])>=w)continue;let P=m(g,v);P<w&&(w=P)}Number.isFinite(w)&&d.push(w)}d.sort((g,w)=>g-w);let h=d.length?d[Math.floor(d.length/2)]:1,p=Math.max(h*1.8,1e-6),b=i.map(()=>[]);for(let g=0;g<i.length;g++)for(let w=g+1;w<i.length;w++)fc(a[g],a[w])>p||m(g,w)<=p&&(b[g].push(w),b[w].push(g));let y=0;for(let g=0;g<i.length;g++){if(i[g].blockId!==-1)continue;let w=y++,v=[g];for(i[g].blockId=w;v.length;){let P=v.pop();for(let R of b[P])i[R].blockId===-1&&(i[R].blockId=w,v.push(R))}}let M=new Map;for(let g of i){let w=M.get(g.blockId)??[];w.push(g),M.set(g.blockId,w)}let S=[];for(let g of i){if(g.pts.length<4||Yh(g.pts)<Xh)continue;let w=Ii(g.pts);w&&(!Number.isFinite(w.cx)||!Number.isFinite(w.cy)||S.push({x:w.cx,y:w.cy}))}let A=S.length>=2?(()=>{let g=S.map(P=>P.x).sort((P,R)=>P-R),w=S.map(P=>P.y).sort((P,R)=>P-R),v=Math.floor(S.length/2);return{cx:g[v],cy:w[v]}})():null;if(A){let g=F=>Math.hypot(F.x-A.cx,F.y-A.cy),w=1/0,v=-1/0,P=[];for(let F of i){let E=1/0,I=-1/0;for(let C of F.pts){let L=g(C);L<E&&(E=L),L>I&&(I=L)}P.push(I-E),E<w&&(w=E),I>v&&(v=I)}let R=v-w;P.sort((F,E)=>F-E);let k=P[Math.min(P.length-1,Math.floor(P.length*.9))];if(R>1e-9&&k/R<=Wh){let F=i.map(T=>{let B=0;for(let D of T.pts)B+=g(D);return{row:T,radius:B/T.pts.length}}),E=0,I=0;for(let T of F)E+=T.radius,I+=T.row.focalDistance;E/=F.length,I/=F.length;let C=0;for(let T of F)C+=(T.radius-E)*(T.row.focalDistance-I);if(C<0)for(let T of F)T.radius=-T.radius;let N=1/0;for(let T of F)T.radius<N&&(N=T.radius);F.sort((T,B)=>T.radius-B.radius);let O=-1,H=-1/0,j=R/Math.max(1,F.length)*.5,V=[];for(let T of F)T.radius-H>j&&(O++,H=T.radius),T.row.ordinal=O,T.row.blockDepth=T.radius-N,V.push(T.row);return{sectionId:e,rows:V,blockCount:y}}}let x=[];for(let[,g]of M){let w=Kh(g);if(w){let v=F=>{let E=0;for(let I of F.pts)E+=I.x*w.x+I.y*w.y;return E/F.pts.length};g.sort((F,E)=>v(F)-v(E)),g.length>=2&&g[0].focalDistance>g[g.length-1].focalDistance&&g.reverse();let P=[],R=h*.5;for(let F of g){let E=P[P.length-1];E&&Math.abs(v(F)-v(E[0]))<R?E.push(F):P.push([F])}let k=0;for(let F=0;F<P.length;F++){if(F>0){let E=1/0;for(let I of P[F-1])for(let C of P[F])E=Math.min(E,f(I,C));E=Math.min(E,Math.abs(v(P[F][0])-v(P[F-1][0]))),k+=E}for(let E of P[F])E.ordinal=F,E.blockDepth=k,x.push(E)}}else{let v=1/0;for(let P of g)P.focalDistance<v&&(v=P.focalDistance);g.sort((P,R)=>P.focalDistance-R.focalDistance);for(let P=0;P<g.length;P++)g[P].ordinal=P,g[P].blockDepth=Math.max(0,g[P].focalDistance-v),x.push(g[P])}}return{sectionId:e,rows:x,blockCount:y}}var qh=/^\d{4}-\d{2}-\d{2}$/;function Qh(e){let t=Date.parse(e);return Number.isFinite(t)?qh.test(e)?t+864e5:t:null}function Jh(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Qh(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function ep(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function tp(e){return e.status!=="draft"&&e.status!=="retracted"}function np(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 dc(e,t={}){return!!e&&tp(e)&&ep(e,t.activeConfigurationId,t.activeConfigurationVersion)&&np(e,t.activeBasisSha256)&&Jh(e,t.now)}var op=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,rp=/[\s"'<>`\\]/;function ip(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return op.test(e);if(rp.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function hc(e){let t=e.trim();return ip(t)?t:null}var Ri="seatlayer.event-configuration/1";var bn=100,ap=120,sp=2e5,cp=1e4,lp=/^[a-f0-9]{64}$/,up=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function qt(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function mp(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function pc(e){return!Array.isArray(e)||e.length>sp||!e.every(t=>qt(t,bn))?null:[...new Set(e)].sort()}function fp(e){return!ro(e)||!qt(e.chartId,bn)||!qt(e.version,bn)||e.sha256!==void 0&&(typeof e.sha256!="string"||!lp.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function Ei(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function dp(e){return ro(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&Ei(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function hp(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>cp)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!ro(s)||!qt(s.id,bn)||!qt(s.objectId,bn)||!n.has(s.objectId)||!up.has(String(s.kind))||!Ei(s.heightM,.05,50)||s.baseElevationM!==void 0&&!Ei(s.baseElevationM,-10,100))return null;let c=dp(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?hc(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function pp(e){let t=[];if(!ro(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==Ri&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${Ri}`}),qt(e.id,bn)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),qt(e.label,ap)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),mp(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=fp(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=ro(e.overlay)?e.overlay:null,r=pc(o?.objectIds),i=pc(o?.productionKillSeatIds),a=r?hp(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:Ri,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function bc(e){let t=pp(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function bp(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?Yo(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function yp(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function yc(e){let t=bp(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>yp(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var gp=5,xp=3,Mp=.92,vp=1.9,Sp=2,wp=.6,Pp=1,Ap=.06;function Ip(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?Mi:Xo(e.stageKind)?Ap:Pp}function gc(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of vc(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=yc(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+Ip(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function Rp(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let d of e)Number.isFinite(d.eyeHeightM)&&(r=Math.min(r,d.x),a=Math.max(a,d.x),i=Math.min(i,d.y),s=Math.max(s,d.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),f=new Float64Array(u*m).fill(-1/0);for(let d of e){if(!Number.isFinite(d.eyeHeightM))continue;let h=d.eyeHeightM-ht,p=Math.min(u-1,Math.max(0,Math.floor((d.x*t-c)/n))),y=Math.min(m-1,Math.max(0,Math.floor((d.y*t-l)/n)))*u+p,M=h+o;M>f[y]&&(f[y]=M)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:f}}function Ep(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function xc(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??fe,i=n.cellM??wp,a=n.chairBackM??Mp,s=n.selfRowSkipM??Sp,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??gp),m=Math.max(1,n.rows??xp),f=Rp(e,r,i,a);if(!f)return o;let d=(t.maxX-t.minX)*r,h=(t.maxY-t.minY)*r,p=d>=h,b=(t.minX+t.maxX)/2*r,y=(t.minY+t.maxY)/2*r,M=[];for(let A=0;A<u;A++){let x=(A+.5)/u-.5,g=p?b+x*d:b,w=p?y:y+x*h;for(let v=0;v<m;v++){let P=t.deckTopM+(m===1?0:v/(m-1)*vp);M.push({x:g,y:w,z:P})}}let S=i/2;for(let A of e){if(!Number.isFinite(A.eyeHeightM))continue;let x=A.x*r,g=A.y*r,w=A.eyeHeightM,v=0,P=1/0;for(let k of M){let F=k.x-x,E=k.y-g,I=Math.hypot(F,E);if(!(I>s)){v++;continue}let C=F/I,L=E/I,N=0;for(let O=s;O<I;O+=S){let H=Ep(f,x+C*O,g+L*O);if(!(!Number.isFinite(H)||H>=w)&&H>w+(k.z-w)*O/I){N=O;break}}N?P=Math.min(P,N):v++}let R=v/M.length;R>=c||o.set(A.id,{seatId:A.id,mark:R<l?"obstructedView":"restrictedView",visibleFraction:R,totalRays:M.length,atDistanceM:Number.isFinite(P)?P:0})}return o}function Mc(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function Ci(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var Zo=Math.PI/180;var io=16;function _i(e,t,n,o){let r=n*Zo,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function Ti(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return Qs(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(_i(l*n,0,r,i));return a}let s=o/(t-1)*Zo,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),f=-c+c*Math.cos(u);a.push(_i(m,f,r,i))}return a}function Li(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function Cp(e,t){let n=Li(e);return Ti(e).map((o,r)=>{let i=n.get(r),a=Ci(i),s=cc(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:Pi(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function _p(e){let t=[];for(let n of Cp(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 Tp(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function Lp(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,f,d)=>{let h=o.get(u),p=Ci(h),b=h?.label??lc(e,u);return{index:u,label:b,displayLabel:h?.displayLabel??uc(e,u),x:m+(h?.dx??0),y:f+(h?.dy??0),categoryKey:h?.categoryKey??e.categoryKey,skipped:!!h?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:h?.wheelchairSpaceType,commercial:h?.commercial,glyph:h?.glyph,viewUrl:h?.viewFromSeatUrl,viewMeta:h?.viewFromSeatUrl?h.viewFromSeatMeta:void 0,labelStyle:h?.labelStyle,...d?{side:d}:{}}};if(e.shape==="round"){let u=(e.radius??40)+io,m=e.rotation*Zo,f=Math.max(0,Math.min(360,e.seatArc??360));if(f>=360||n===1){for(let b=0;b<n;b++){let y=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let d=f*Zo,h=(2*Math.PI-d)/2,p=m+h;for(let b=0;b<n;b++){let y=p+b/(n-1)*d;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let i=e.width??80,a=e.height??50,s=Tp(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let f=0;f<m;f++){let d,h;u==="top"?(d=-i/2+(f+.5)*i/m,h=-a/2-io):u==="bottom"?(d=-i/2+(f+.5)*i/m,h=a/2+io):u==="left"?(d=-i/2-io,h=-a/2+(f+.5)*a/m):(d=i/2+io,h=-a/2+(f+.5)*a/m);let p=_i(d,h,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function kp(e){return Lp(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 Op(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function Si(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function ic(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function no(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function Ge(e,t,n){return Si(e,t)&&!no(n).some(o=>Si(e,o)||ic(e,o))}function $o(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Ac(e){switch(e.type){case"row":{let t=Ti(e),n=Li(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return $o(e.points);case"section":return $o(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?$o(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 Sc(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function Fp(e,t){if(e.type!=="gaArea"||!Sc(e.points,t.outline))return!1;let n=no(e.holes),o=no(t.holes);return n.length===o.length&&n.every((r,i)=>Sc(r,o[i]))}function Dp(e,t,n=e.filter(r=>r.type==="section"),o=Ac(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(Fp(t,a)||Ge(o,a.outline,a.holes))):void 0)??n.find(a=>Ge(o,a.outline,a.holes))??(t.type==="row"&&Np(t)?Bp(t,n):void 0)}function Np(e){return(e.overrides??[]).some(t=>t.skip===!0)}function Bp(e,t){let n=Ti(e),o=Li(e),r,i=0;for(let a of t){let s=0;for(let c=0;c<n.length;c++){let l=o.get(c);if(l?.skip)continue;let u={x:n[c].x+(l?.dx??0),y:n[c].y+(l?.dy??0)};Ge(u,a.outline,a.holes)&&s++}s>i&&(r=a,i=s)}return r}function vc(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 wc(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=ac(e),f=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),d=p=>dc(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),h=(p,b)=>d(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=_p(p):p.type==="table"?b=kp(p):p.type==="booth"&&(b=Op(p)),!b.length)continue;for(let x of b)x.viewUrl&&!f(x.viewMeta)&&(x.viewUrl=void 0,x.viewMeta=void 0);if(p.type==="row"){let x=m.get(p.id);if(x){let g=new Map((p.overrides??[]).map(w=>[w.index,w]));for(let w of b){let v=Number(w.id.slice(w.id.lastIndexOf(":")+1));if(!Number.isInteger(v))continue;w.logicalRowId=x.groupId,w.logicalSeatIndex=x.adjacencyOffset+v,g.get(v)?.displayLabel||(w.displayLabel=Pi(p,v,x)),!w.viewUrl&&x.viewFromSeatUrl&&f(x.viewFromSeatMeta)&&(w.viewUrl=x.viewFromSeatUrl,w.viewMeta=x.viewFromSeatMeta);let P=g.get(v)?.confidenceEvidence;w.confidenceEvidence=h(P,"exact-seat")??h(p.confidenceEvidence,"row-representative")??h(x.confidenceEvidence,"row-representative")}}}let y=Dp(e,p,u,p.type==="row"?$o(b):Ac(p)),M=y?.viewFromSeatUrl,A=(y?.zone?t?.find(x=>x.id===y.zone):void 0)?.focalPoint??n;for(let x of b){if(!x.confidenceEvidence){let g=Number(x.id.slice(x.id.lastIndexOf(":")+1)),w=(p.type==="row"||p.type==="table")&&Number.isInteger(g)?p.overrides?.find(v=>v.index===g)?.confidenceEvidence:void 0;x.confidenceEvidence=h(w,"exact-seat")??(p.type==="row"?h(p.confidenceEvidence,"row-representative"):void 0)}x.confidenceEvidence??=h(y?.confidenceEvidence,"section-representative")??(a?h(a.evidence,a.coverage):void 0),!x.viewUrl&&M&&f(y?.viewFromSeatMeta)&&(x.viewUrl=M,x.viewMeta=y?.viewFromSeatMeta),!x.viewUrl&&i&&f(i.meta)&&(x.viewUrl=i.url,x.viewMeta=i.meta),y&&(x.sectionId=y.logicalSectionId??y.id),y?.zone&&(x.zoneId=y.zone),A&&(x.focalPoint={...A})}l.push(...b)}return l}function yn(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=wc(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Pc(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=wc(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&&Pc(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),Vp(e,n,t)}function Vp(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Mc(t,xc(t,gc(e))),t}function Pc(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+ht;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let f=o[m],h=(f.sectionId?s.get(f.sectionId)??r.find(b=>b.logicalSectionId===f.sectionId&&Ge({x:f.x,y:f.y},b.outline,b.holes)):void 0)??r.find(b=>Ge({x:f.x,y:f.y},b.outline,b.holes))??null;if(a[m]=h,!h)continue;c.has(h.id)||c.set(h.id,Ct(h,{floorBaseHeightM:n}));let p=l.get(h.id);p?p.push(m):l.set(h.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,f]of l){let d=c.get(m);if(!d)continue;let h=d.rake>0?Math.tan(d.rake*Math.PI/180):0,p=Ko(m,o,f,t);for(let b of p.rows){let y=b.blockDepth*fe*h,M=d.height+y;for(let S of b.seatIndices)u[S]=M}}for(let m=0;m<o.length;m++){let f=o[m],d=a[m];if(!d){f.eyeHeightM=n+ht;continue}let h=c.get(d.id);f.eyeHeightM=(u[m]??h.height)+ht}}function Ic(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function gn(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var Rc="#ffffff";var Gp={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},qv=Gp.wheelchair;var qo=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],Ec="#a4508b";var ki={facilities:Ec,"food-drink":qo[5],navigation:qo[2],accessibility:qo[4]},er=Rc,Oi={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var _e=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},Sn=e=>`${_e(e[0])} ${_e(e[1])}`,vn=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function Hc(e){let t=`M${Sn(e.from)}`;for(let n of e.segs)t+=n.arc?`A${_e(n.arc.r)} ${_e(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${Sn(n.to)}`:`L${Sn(n.to)}`;return`${t}Z`}function Te(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function Le(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function de(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?Fe([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function Fe(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function Re(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return Le(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function Oe(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(Re(e[i],e[(i+1)%e.length],t));return o}function st(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=vn(e,t,n+a,o);return{from:l,segs:[{to:vn(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:vn(e,t,n-a,r),arc:c},{to:vn(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var pe=(...e)=>e.flat().map(Hc).join(" "),We=(e,t,n)=>`M${_e(e-n)} ${_e(t)}a${_e(n)} ${_e(n)} 0 1 0 ${_e(2*n)} 0a${_e(n)} ${_e(n)} 0 1 0 ${_e(-2*n)} 0`,bt=(e,t,n,o,r)=>Hc(de(e,t,n,o,r)),Jo=e=>`M${e.map(Sn).join("L")}`,Qo=(e,t,n,o,r)=>`M${Sn(vn(e,t,n,o))}A${_e(n)} ${_e(n)} 0 ${r-o>180?1:0} 1 ${Sn(vn(e,t,n,r))}`;function xn(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function ao(e){return[We(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Jo),...(e.arcs??[]).map(([t,n,o,r,i])=>Qo(t,n,o,r,i))].join(" ")}function Mn(e,t=2.6){return[Le(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>Oe(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>st(n,o,r,i,a,t-.2))]}var Qt={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},Cc={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},_c={cx:12,hr:1.9,arm:5,leg:3,r:2},Tc={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},Lc={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},kc={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function Oc({cx:e,hr:t,arm:n,leg:o,r}){return[We(e,2+t,t),`M${_e(e-n+r)} 8.5H${_e(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${_e(e+o)}V22H${_e(e-o)}V15H${_e(e-n)}V${_e(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${_e(e)} 15V22`].join(" ")}function Fc({cx:e,hr:t,arm:n,leg:o,r}){return[Le(e,2+t,t+1),de(e-n-.5,7.8,2*n+1,7.7,r+.5),de(e-o-.5,13,o,9.5,1),de(e+.5,13,o,9.5,1)]}function Dc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[We(e,2+t,t),Jo([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${_e(e)} 16V22`].join(" ")}function Nc({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Le(e,2+t,t+1),Fe([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),de(e-r-.1,15,r-.4,7.5,.9),de(e+.5,15,r-.4,7.5,.9)]}var Hp=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],zp="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",Up="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",jp="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",Bc=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Wp={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},Xp={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function Vc(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var Gc={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Yp=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],Kp=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],Fi=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:Oc(_c),solid:pe(Fc(_c))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:Dc(Tc),solid:pe(Nc(Tc))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[bt(2.5,2.5,19,19,3.5),ao(xn(Qt,4.6,4.3,.66))].join(" "),solid:pe(Mn(Qt)),solidLarge:pe(de(1.5,1.5,21,21,4.5),Te(de(3.9,3.9,16.2,16.2,2.6)),Mn(xn(Qt,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Jo(Bc)+"Z",solid:pe(Fe(Bc.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:pe(st(12,6.2,2.2,180,450,2.3),Re([12,8.4],[12,10.5],2.3),Oe([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[bt(2,6,20,12,2),We(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:pe(de(1.5,5.5,21,13,2.4),Te(Le(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[We(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:pe(Le(12,4.9,2.4),de(10.3,9.2,3.4,12.3,1),de(8.2,9.2,4,3,1),de(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[We(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:pe(st(12,7.6,4.2,180,405,3.4),Oe([[14.97,10.57],[12,13],[12,15]],3.4),Le(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[Oc(Lc),Dc(kc)].join(" "),solid:pe(Fc(Lc),Nc(kc))},{key:"charging",label:"Charging point",group:"facilities",path:[bt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:pe(Fe(Hp))},{key:"smoking",label:"Smoking area",group:"facilities",path:[bt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:pe(de(1.5,14,4.2,5,1.2),de(6.8,14,10.4,5,1.2),Oe([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),Oe([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[We(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:pe(Le(12,12,10.6),Te(Le(12,12,8)),Re([6,6],[18,18],2.8),de(5,10.4,3,3.2,.6),de(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:pe(Oe([[4.9,2.6],[4.9,8]],2.2),Oe([[10.1,2.6],[10.1,8]],2.2),Oe([[7.5,2.6],[7.5,8]],2.2),st(7.5,8,2.6,0,180,2.2),Re([7.5,10],[7.5,21.4],3),Fe([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),Re([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:pe(Fe([[2.8,3],[21.2,3],[12,13.6]]),Re([12,12],[12,20.6],2.8),Re([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:pe({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},st(17.2,13.25,2.5,270,450,2.4),Re([7.8,2.6],[7.8,5.6],2.4),Re([12.2,2.6],[12.2,5.6],2.4),Re([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:Up,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:zp,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[bt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:pe(de(1.5,3,21,14.4,2.4),Te(Fe([[9.6,6.7],[16,10.2],[9.6,13.7]])),de(10.6,16.5,2.8,4,0),Re([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",We(6,14,2),We(12,8,2),We(18,15,2)].join(" "),solid:pe(Re([6,2.8],[6,21.2],1.8),Re([12,2.8],[12,21.2],1.8),Re([18,2.8],[18,21.2],1.8),de(3.2,11.6,5.6,4.8,1.4),de(9.2,5.6,5.6,4.8,1.4),de(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:pe(Oe([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),Re([2.8,12],[13.5,12],3.2),Fe([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:pe(Oe([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),Re([7.2,12],[17,12],3.2),Fe([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[ao(xn(Cc,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:pe(Mn(xn(Cc,-2,1.4,1.15),2.7),Re([15.6,13],[19.5,13],2.8),Fe([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:jp,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[bt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:pe(Fe([[12,1.6],[19.6,10.2],[4.4,10.2]]),Fe([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[bt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:ao(Qt),solid:pe(Mn(Qt))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:pe(st(10,9,6,180,380,3),Oe([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),st(8.2,17.2,3.3,0,150,3),st(10,9,2.2,180,400,2.4),st(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:pe(Wp,Te(de(14.1,7,1.8,2.2,.9)),Te(de(14.1,10.9,1.8,2.2,.9)),Te(de(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:pe(Fe([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),Le(11,4.3,2.3),Re([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:pe(Fe([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),Re([4.2,13.4],[13.2,8.6],2.6),Fe([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",bt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:pe(de(9,1.8,6,3.4,.8),Fe([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),de(2.8,10.6,18.4,7,2.2),Te(Le(6.8,14,1.3)),Te(Le(17.2,14,1.3)),de(4.8,16,3.6,5.2,1.2),de(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[bt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:pe(de(4,2,16,17,3.2),Te(de(6.2,5.8,11.6,5,1)),Te(Le(8,14.5,1.3)),Te(Le(16,14.5,1.3)),de(6,17,3.4,5,1.2),de(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[We(6,14.5,4),We(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:pe(Le(6,14.5,4.9),Te(Le(6,14.5,2.7)),Le(18,14.5,4.9),Te(Le(18,14.5,2.7)),Oe([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),Oe([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),Re([6,14.5],[11.5,14.5],2.2),Re([7.2,5.8],[10.6,5.8],2.2),Oe([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",We(10,9.6,1.5),We(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:pe(Oe([[9.4,2.4],[12,5],[14.6,2.4]],2.6),Oe([[9.4,21.6],[12,19],[14.6,21.6]],2.6),Oe([[2.4,9.4],[5,12],[2.4,14.6]],2.6),Oe([[21.6,9.4],[19,12],[21.6,14.6]],2.6),Le(9.7,9.3,2.2),Le(14.3,9.3,2.2),Vc(9.7,16,3),Vc(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:pe(Xp,Te(Fe([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[bt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:pe(de(3,2,8.4,20,1.4),Te(de(5,5,4.4,1.7,.8)),Te(de(8.6,10.8,1.5,3.8,.7)),de(12.6,2,8.4,20,1.4),Te(de(14.6,5,4.4,1.7,.8)),Te(de(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:pe(Fe([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),de(7.6,5.4,8.8,2.6,1),de(7.8,7.4,8.4,15,2.6),Te(de(7.8,11.8,3.4,1.5,0)),Te(de(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[ao(Gc),"M3 21.5h18"].join(" "),solid:pe(Mn(Gc),de(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:pe(Fe([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),Re([15.4,9.2],[20.8,14.8],2.8),Re([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[Qo(12,19,11.5,218,322),Qo(12,19,7.5,218,322),Qo(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:pe(st(12,19.2,11,218,322,2.8),st(12,19.2,6.9,218,322,2.8),Le(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:pe(de(6,4,12,8.5,2.2),de(2.4,9.6,4.6,9,2.2),de(17,9.6,4.6,9,2.2),de(6,13.2,12,5.4,.6),Re([5,18],[5,20.6],2.4),Re([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[ao(xn(Qt,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:pe(Mn(xn(Qt,.3,5,.62),2.2),Oe([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Jo(Yp)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:pe(Fe(Kp),Re([6.2,11],[3.2,7.2],2.4),Oe([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],n2=new Map(Fi.map(e=>[e.key,e]));var zc=Fi;var $p=new Map(zc.map(e=>[e.key,e]));function so(e){return e?$p.get(e):void 0}var a2=zc.map(e=>e.key);var Uc=e=>Math.round(e*1e6)/1e6+0;function wn(e){let t=e.map(r=>({x:Uc(r.x),y:Uc(r.y)})).sort((r,i)=>r.x-i.x||r.y-i.y).filter((r,i,a)=>i===0||r.x!==a[i-1].x||r.y!==a[i-1].y);if(t.length<3)return t;let n=(r,i,a)=>{let s=i.x-r.x,c=i.y-r.y,l=a.x-r.x,u=a.y-r.y;return s*u-c*l>1e-6*Math.hypot(s,c)*Math.hypot(l,u)},o=r=>{let i=[];for(let a of r){for(;i.length>=2&&!n(i[i.length-2],i[i.length-1],a);)i.pop();i.push(a)}return i.pop(),i};return[...o(t),...o([...t].reverse())]}function co(e){if(e.length<3)return e.map(n=>({...n}));let t=wn(e);return t.length>=3?t:[...e].sort((n,o)=>n.x-o.x||n.y-o.y).map(n=>({...n}))}var ll=ft(require("polygon-clipping"),1);var ae={top:1,wallBottom:.58,bottomCap:.4};function Jt(e,t){if(!e)return t;let n=le(dt(e,.4),.62);return ge(t,n,.22)}function jc(e,t){return e?ge(t,le(dt(e,.25),.74),.62):t}function Wc(e,t){let n=Xt(an({tierTop:t}));return e?Wt(e,n.sectionDeck,Math.min(n.sectionDeckChromaShare*Yn(e),n.sectionDeckChromaCap)):Wt(t,n.deck,Math.min(Yn(t),Oo))}function Xc(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,f]of a){let d=ye(n.get(m));d&&(s+=d[0]*f,c+=d[1]*f,l+=d[2]*f,u+=f)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Yc(e,t){return ye(e.color)??t.get(e.logicalSectionId??e.id)??null}var Vi=ft(require("polygon-clipping"),1);var Bi=ft(require("polygon-clipping"),1);var qc=ft(require("earcut"),1);var Zp=.58,Kc=.01,tt=St*1.5*et,qp=.5,Qp=.6;function Jp(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function eb(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var $c=Math.PI/12;function tb(e){if(e.length<3)return[...e];let t=wn(e);return t.length>=3?t:[...e]}function Qc(e,t){if(!e.length||!(t>0))return[];let n=tb(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let f=Math.max(1,Math.ceil(m/$c)),d=t/Math.cos(m/f/2);for(let h=0;h<=f;h++){let p=c+m*h/f;u.push({x:s.x+Math.cos(p)*d,y:s.y+Math.sin(p)*d})}};if(n.length<3){let s=0,c=0;for(let d of n)s+=d.x,c+=d.y;s/=n.length||1,c/=n.length||1;let l=0;for(let d of n)l=Math.max(l,Math.hypot(d.x-s,d.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/$c)),f=(l+t)/Math.cos(Math.PI/m);for(let d=0;d<m;d++){let h=d/m*Math.PI*2;u.push({x:s+Math.cos(h)*f,y:c+Math.sin(h)*f})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return ol(a)}function nb(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function tr(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let f=0;f<e.length;f++){if(f===r||Math.abs(e[f].y-e[r].y)<.001)continue;let d=t[f],h=Math.hypot(u.x-d.cx,u.y-d.cy)-d.rad;if(h>=m&&h>=s)continue;let p=nb(e[f].pts,u.x,u.y);p<m&&(m=p),e[f].depth<e[r].depth&&p<s&&(s=p,c=e[f].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function Jc(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,f=u.y-o.y,d=Math.hypot(m,f)||1;m/=d,f/=d;let h=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+f*h,y:u.y-m*h},{x:u.x-f*h,y:u.y+m*h}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=eb(i,Math.max(c*Qp,tt));return{pts:l,nrm:Jp(l,o),front:Math.max(n[t].pitch*Zp,tt),back:Math.max(n[t].pitch*qp,tt)}}var Pn=1.5,el=.3;function Di(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let f=e[m],d=a>1e-12?Math.abs((f.x-n.x)*i-(f.y-n.y)*r)/a:Math.hypot(f.x-n.x,f.y-n.y);d>s&&(s=d,c=m)}if(s<=t||c<0)return[n,o];let l=Di(e.slice(0,c+1),t),u=Di(e.slice(c),t);return[...l.slice(0,-1),...u]}function tl(e,t){if(e.length<4)return e;let n=Di([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function ob(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function nl(e,t,n){if(e.length<2)return[];let o=n??tr(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let M of a){let S=e[M].patch;S&&S.length>=3?i.push({outline:[...S],holes:[],topY:e[M].y}):s.push(M)}if(!s.length)continue;s.sort((M,S)=>e[M].depth-e[S].depth);let l=s.map(M=>Jc(e,M,o,t)).filter(M=>M!==null);if(!l.length)continue;let u=(M,S)=>({x:M.pts[S].x-M.nrm[S][0]*(M.front+Pn),y:M.pts[S].y-M.nrm[S][1]*(M.front+Pn)}),m=(M,S)=>({x:M.pts[S].x+M.nrm[S][0]*(M.back+Pn),y:M.pts[S].y+M.nrm[S][1]*(M.back+Pn)}),f=l[0],d=l[l.length-1],h=[];for(let M=0;M<f.pts.length;M++)h.push(u(f,M));for(let M of l)h.push(m(M,M.pts.length-1));for(let M=d.pts.length-1;M>=0;M--)h.push(m(d,M));for(let M=l.length-1;M>=0;M--)h.push(u(l[M],0));let p=ol(h),b=1/0;for(let M of s)e[M].y<b&&(b=e[M].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs($e(p))>1e-6&&l.every(M=>{let S=M.pts[Math.floor(M.pts.length/2)];return Ze(p,S.x,S.y)})&&!ob(p)){i.push({outline:tl(p,el),holes:[],topY:b});continue}for(let M of rb(l))i.push({outline:M,holes:[],topY:b})}return i}function rb(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+Pn,a=n.back+Pn;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=Bi.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(tl(i,el))}return o}catch{return[]}}function ol(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var Ni=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ze(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function Zc(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let f=o[m],d=o[m+1];e.tri([u.x*_,r,u.y*_],[f.x*_,r,f.y*_],[d.x*_,r,d.y*_],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=Bi.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],f=[];for(let h=0;h<u.length-1;h++)m.push(u[h][0],u[h][1]),f.push([u[h][0],u[h][1]]);if(f.length<3)continue;let d=(0,qc.default)(m,void 0,2);for(let h=0;h<d.length;h+=3){let p=f[d[h]],b=f[d[h+1]],y=f[d[h+2]];e.tri([p[0]*_,r,p[1]*_],[b[0]*_,r,b[1]*_],[y[0]*_,r,y[1]*_],c,i)}}}function rl(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??tr(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(d=>[d.x,d.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new Ni([[...i]]):null,m=d=>{e.setMaterial(2),d(),e.setMaterial(0)},f=d=>{e.setMaterial(3),d(),e.setMaterial(0)};for(let d=0;d<t.length;d++){let h=t[d];if(h.patch&&h.patch.length>=3){let x=[...h.patch],g=s[d].belowY??o;if(f(()=>{if(l&&u)Zc(e,l,u,x,h.y,r.tread);else{let w=x[0];for(let v=1;v+1<x.length;v++){let P=x[v],R=x[v+1];e.tri([w.x*_,h.y,w.y*_],[P.x*_,h.y,P.y*_],[R.x*_,h.y,R.y*_],c,r.tread)}}}),h.y>g+Kc){let w=0,v=0;for(let P of x)w+=P.x,v+=P.y;w/=x.length,v/=x.length,m(()=>{for(let P=0;P<x.length;P++){let R=x[P],k=x[(P+1)%x.length],F=k.x-R.x,E=k.y-R.y,I=Math.hypot(F,E);if(I<1e-6)continue;let C=E/I,L=-F/I;(R.x-w)*C+(R.y-v)*L<0&&(C=-C,L=-L);let N=[C,0,L],O=[R.x*_,h.y,R.y*_],H=[k.x*_,h.y,k.y*_],j=[R.x*_,g,R.y*_],V=[k.x*_,g,k.y*_];e.tri(O,H,V,N,r.riser),e.tri(O,V,j,N,r.riser)}})}continue}let p=Jc(t,d,s,n);if(!p)continue;let{pts:b,nrm:y,front:M,back:S}=p,A=s[d].belowY??o;for(let x=0;x+1<b.length;x++){let g=b[x],w=b[x+1],v=y[x],P=y[x+1];if(Math.hypot(w.x-g.x,w.y-g.y)<1e-6||v[0]===0&&v[1]===0||P[0]===0&&P[1]===0)continue;let R=[(g.x-v[0]*M)*_,h.y,(g.y-v[1]*M)*_],k=[(w.x-P[0]*M)*_,h.y,(w.y-P[1]*M)*_],F=[(g.x+v[0]*S)*_,h.y,(g.y+v[1]*S)*_],E=[(w.x+P[0]*S)*_,h.y,(w.y+P[1]*S)*_];if(f(()=>{l&&u?Zc(e,l,u,[{x:g.x-v[0]*M,y:g.y-v[1]*M},{x:w.x-P[0]*M,y:w.y-P[1]*M},{x:w.x+P[0]*S,y:w.y+P[1]*S},{x:g.x+v[0]*S,y:g.y+v[1]*S}],h.y,r.tread):(e.tri(R,k,E,c,r.tread),e.tri(R,E,F,c,r.tread))}),h.y>A+Kc){let I=[R[0],A,R[2]],C=[k[0],A,k[2]],L=[-v[0],0,-v[1]];m(()=>{e.tri(R,k,C,L,r.riser),e.tri(R,C,I,L,r.riser)})}}}}function ib(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function il(e,t){return e.filter(n=>n.type!=="shape"||ib(n,t))}function al(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:il(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:il(e.objects,t),focal:n,baseHeightM:0,index:0}]}var ab={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function Pt(e){return Ic(e)??ab}function sl(e,t){let n=at(e.outline,tt),o=Pt(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&gn(o,Pt(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=Vi.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function cl(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=Vi.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function sb(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var nr=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=Pt(t),i=this.rings.filter((c,l)=>gn(r,this.boxes[l])&&sb(n,this.levels[l])),a=[[o]];if(i.length)try{a=ll.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,f])=>[m,f])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function An(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let f of n)o=Math.min(o,f.x),r=Math.max(r,f.x),i=Math.min(i,f.y),a=Math.max(a,f.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(f=>{let d=f.x-s,h=f.y-c;return{x:s+d*u-h*m,y:c+d*m+h*u}})}function ul(e){let t=rc(e);return!t.length||!e.points?.length?[]:t.map(n=>An(n,e.rotation,e.points))}function xe(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return An(Yo(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=Jn(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=Uo(n,o,e.width/2,e.height/2)}return t?An(t,e.rotation):null}function ct(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:$s(e.stageKind)}:{stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var cb=.08,lb=30,ub=.015;function mb(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function ml(e,t){let n=xe(e)??(e.points?.length?An(e.points,e.rotation):null),o=ct(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs($e(n))*fe**2>=lb?ub:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let d of n)a=Math.min(a,d.x),s=Math.min(s,d.y),c=Math.max(c,d.x),l=Math.max(l,d.y);let u=i,m=0,f=1e-6*Math.max(1,c-a,l-s);for(let d of t)c>d.minX&&a<d.maxX&&l>d.minY&&s<d.maxY&&u<=d.topOffsetM+1e-6&&(u=d.topOffsetM+cb),a>=d.minX-f&&c<=d.maxX+f&&s>=d.minY-f&&l<=d.maxY+f&&(!d.poly||n.every(b=>mb(b,d.poly)||fb(b,d.poly,f)))&&(m=Math.max(m,d.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function fb(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function Lt(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function qe(e){if(e.length!==4)return e;let t=Math.hypot(e[1].x-e[0].x,e[1].y-e[0].y),n=Math.hypot(e[2].x-e[1].x,e[2].y-e[1].y);return t>=n?e:[e[1],e[2],e[3],e[0]]}function Ue(e,t,n){return[Lt(e[0],e[1],t),Lt(e[0],e[1],n),Lt(e[3],e[2],n),Lt(e[3],e[2],t)]}function lo(e,t,n){return[Lt(e[0],e[3],t),Lt(e[1],e[2],t),Lt(e[1],e[2],n),Lt(e[0],e[3],n)]}function be(e,t,n,o,r,i,a){ue(e,t,a?.length?a:void 0,()=>n,o,r,i,ae)}var db=.8,hb=.6,pb=2;function kt(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=xe(a)??[],c=fl(s)/2;!(c>0)||gb(s)/c*_>pb||(n.push(...s),o+=c)}if(n.length<3)return null;let r=co(n);if(r.length<3||o<fl(r)*hb)return null;let i=0;for(let a of t)xb(a,r)&&(i+=1);return i>=t.length*db?r:null}var or=6,bb=5,yb=8;function dl(e){return Math.max(yb,(Number.isFinite(e)?e:0)+bb)}function In(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function gb(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function fl(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function xb(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function Mb(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function vb(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let d of e)n+=d.x,o+=d.y,r+=Math.hypot(d.x-t.x,d.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let d of e){let h=Math.hypot(d.x-n,d.y-o);h>s&&(s=h,a=d)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((d,h)=>(d.x-n)*c+(d.y-o)*l-((h.x-n)*c+(h.y-o)*l)),f=0;for(let d of m){let h=Math.hypot(d.x-n,d.y-o);h>f&&(f=h)}return{pts:m,cx:n,cy:o,radius:f,depth:r}}function hl(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let f=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));f<r&&(r=f)}return r}var rr=8;function Sb(e,t,n){let o=new Array(rr).fill(1/0),r=new Array(rr).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],f=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let d=0;d<rr;d++)if(f<o[d]){for(let h=rr-1;h>d;h--)o[h]=o[h-1],r[h]=r[h-1];o[d]=f,r[d]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=hl(e[u],t,n);for(let f=0;f<3;f++)if(m<i[f]){for(let d=2;d>f;d--)i[d]=i[d-1],a[d]=a[d-1];i[f]=m,a[f]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let f=1/(i[u]*i[u]);c+=f*e[m].depth,l+=f}return l>0?c/l:e[a[0]].depth}function wb(e){let t=(o,r)=>Sb(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=hl(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function pl(e,t){let n=[];for(let o of e){let r=vb(o.points,t);r&&n.push(r)}return n.length<2?Mb(t):(n.sort((o,r)=>o.depth-r.depth),wb(n))}var Ot=.06,Pb=.05,yl=.05,bl=.15,Gi=25;function gl(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let f=0;f<e.length;f+=1){let d=e[f];for(let h of d.objects){if(h.type==="table"&&u.add(h.id),h.type!=="section"||!h.outline||h.outline.length<3)continue;let p=at(h.outline,tt);c.set(h.id,{section:h,unit:d,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:h.id,floorIndex:f,box:Pt(p),section:h,unit:d,outline:p})}}let m=new Map;for(let f of l){let d=m.get(f.floorIndex);d?d.push(f):m.set(f.floorIndex,[f])}for(let f=0;f<t.length;f++){let d=t[f],h=n?m.get(n[f])??[]:l,p=d.sectionId?h.find(y=>y.id===d.sectionId)??h.find(y=>y.section.logicalSectionId===d.sectionId&&Ge({x:d.x,y:d.y},y.outline,y.section.holes)):void 0,b=p?[p]:h;for(let y of b){if(n&&y.floorIndex!==n[f]||!p&&(d.x<y.box.minX||d.x>y.box.maxX||d.y<y.box.minY||d.y>y.box.maxY||!Ge({x:d.x,y:d.y},y.outline,y.section.holes)))continue;r[f]=y.id;let M=c.get(y.id);M.hasSeats=!0;let S=d.focalPoint??y.unit.focal,A=Math.hypot(d.x-S.x,d.y-S.y);A<M.frontU&&(M.frontU=A),M.seatIndices.push(f);let x=d.rowId||`__seat-${f}`,g=M.rows.get(x);g?g.push({x:d.x,y:d.y}):M.rows.set(x,[{x:d.x,y:d.y}]);break}}for(let[f,d]of c){let h=Ct(d.section,{floorBaseHeightM:d.unit.baseHeightM}),p=d.unit.baseHeightM,b=h.rake>0?Math.tan(h.rake*Math.PI/180):0,y=h.rake<=.01&&h.height<=p+.001,M=d.section.surfaceKind,S=M==="flat"?!0:M==="rakedRows"&&h.rake>.01?!1:y,A=d.hasSeats?Ko(f,t,d.seatIndices,d.unit.focal):{sectionId:f,rows:[],blockCount:0},g=A.rows.length<2?pl([...d.rows.values()].map(O=>({points:O})),d.unit.focal):null,w=1/0;if(g){if(d.hasSeats)for(let O of d.rows.values())for(let H of O){let j=g.depthAt(H.x,H.y);j<w&&(w=j)}if(!d.hasSeats||!Number.isFinite(w)){w=1/0;for(let O of d.section.outline){let H=g.depthAt(O.x,O.y);H<w&&(w=H)}}}let v=p+Pb,P=Math.max(v,h.height),R=O=>{let H=Math.max(0,O-w)*fe,j=Math.min(H*b,Gi);return Math.max(v,h.height+j)},k=O=>{let H=Math.max(0,O)*fe,j=Math.min(H*b,Gi);return Math.max(v,h.height+j)},F=S?[]:A.rows.map(O=>({pts:O.pts,y:k(O.blockDepth),depth:O.blockDepth,blockId:O.blockId,...u.has(O.id)?{patch:Qc(O.pts,tt)}:{}})),E=F.length?F[0].y:P,I=F.map(O=>{let H=O.patch&&O.patch.length>=3?O.patch:O.pts,j=0,V=0;for(let D of H)j+=D.x,V+=D.y;let T=H.length||1;j/=T,V/=T;let B=0;for(let D of H){let G=Math.hypot(D.x-j,D.y-V);G>B&&(B=G)}return{cx:j,cy:V,rad:B}}),C=S?()=>P:F.length>=2?(O,H)=>{let j=1/0,V=E;for(let T=0;T<F.length;T++){let B=I[T];if(Math.hypot(O-B.cx,H-B.cy)-B.rad>=j)continue;let D=F[T].patch,G=D&&D.length>=3?Ze(D,O,H)?0:pn(D,O,H):pn(F[T].pts,O,H);G<j&&(j=G,V=F[T].y)}return V}:(O,H)=>g?R(g.depthAt(O,H)):P,L=[0,1,0],N=F.length>=2||S?()=>L:(O,H)=>{if(!g)return L;let j=g.depthAt(O,H);if(j<=w)return L;let V=(j-w)*fe;if(V*b>=Gi||h.height+V*b<=v)return L;let[T,B]=g.gradientAt(O,H);if(T===0&&B===0)return L;let D=1/Math.hypot(b,1);return[-T*b*D,D,-B*b*D]};if(!S)for(let O of A.rows){let H=k(O.blockDepth);for(let j of O.seatIndices)a[j]=H}for(let O of A.rows){let H=[];for(let D=1;D<O.pts.length;D++){let G=Math.hypot(O.pts[D].x-O.pts[D-1].x,O.pts[D].y-O.pts[D-1].y);G>1e-6&&H.push(G)}H.sort((D,G)=>D-G);let j=H.length?H[Math.floor(H.length/2)]:1/0,V=1/0,T=O.pts[Math.floor(O.pts.length/2)];if(T)for(let D of A.rows){if(D===O||D.blockId!==O.blockId)continue;let G=pn(D.pts,T.x,T.y);G>1e-6&&G<V&&(V=G)}let B=Math.min(j,Math.max(V,j*.5));if(Number.isFinite(B)&&B>0)for(let D of O.seatIndices)s[D]=B}o.set(f,{sectionId:f,deckAt:C,normalAt:N,flat:S,bottomY:p,rowLevels:F,landingY:E})}for(let f=0;f<t.length;f++){let d=r[f],h=t[f];if(d){let y=a[f];i[f]=(y??o.get(d).deckAt(h.x,h.y))+bl;continue}let p=h.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-ht):0;i[f]=h.kind==="booth"?b+Ot+bl:b}return{bySection:o,seatOwner:r,seatDeckY:f=>i[f],seatPitchU:f=>s[f]}}function Rn(e,t,n){if(e.length!==4||n<=t)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*_,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*_;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:Ue(o,a,1-a),openingTop:n-s}}function Hi(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=qe(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*_;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=Ue(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:lo(s,.15,.85),bottom:t+i,top:n-i}}function xl(e,t,n,o){let r=Hi(e,t,n);if(!r)return;let{panel:i}=r,a=(M,S)=>({x:(M.x+S.x)/2,y:(M.y+S.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],f=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},d=Math.hypot(f.x,f.y);if(d<1e-6)return;-(m.y-u.y)*f.x+(m.x-u.x)*f.y<0&&([u,m]=[m,u]);let h=Math.min(.006,d*_*.05),p=f.x/d*h,b=f.y/d*h,y=(M,S)=>[M.x*_+p,S,M.y*_+b];return[y(u,r.bottom),y(m,r.bottom),y(u,r.top),y(m,r.top)]}var vl=ft(require("polygon-clipping"),1);var Ml=ft(require("polygon-clipping"),1);function At(e,t,n,o,r,i,a,s={}){let c=Pt(t),l=s.ao??ae,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=xe(p);if(!b||b.length!==4||!gn(c,Pt(b)))return[];let y=s.portalBase??n,M=Rn(b,y,y+ct(p).heightM);if(!M)return[];let S=Math.min(o,M.openingTop);return S<=n?[]:[{poly:M.opening,height:S}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),f=[m(t),...(s.holes??[]).map(m)],d=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),h=[];try{for(let p=1;p<d.length;p++){let b=d[p-1],y=d[p];if(y-b<1e-6)continue;let M=u.filter(A=>A.height>b+1e-6).map(A=>[m(A.poly)]),S=M.length?Ml.default.difference(f,...M):[f];h.push({low:b,high:y,polys:S})}}catch{return!1}for(let p of h)for(let b of p.polys){let[y,...M]=b.map(A=>A.map(([x,g])=>({x,y:g}))),S=A=>l.wallBottom+(l.top-l.wallBottom)*(A-n)/(o-n);ue(e,y,M,()=>p.high,p.low,i,a,{...l,top:S(p.high),wallBottom:S(p.low)})}return!0}var zi={depthM:1.6,thicknessM:.35,minWallM:6};function ir(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=zi.minWallM?Ab(t,s):null,m=u?o-zi.thicknessM:o,f=m-n,d=f<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m,1]]:[[n,n+Math.min(.9,f*.18),.82],[n+Math.min(.9,f*.18),m-.1,1],[m-.1,m,1.1]],h=p=>ae.wallBottom+(ae.top-ae.wallBottom)*(p-n)/l;for(let[p,b,y]of d){let M={...ae,top:h(b),wallBottom:h(p)},S=le(i,y),A=le(a,y);At(e,t,p,b,r,S,A,{portalBase:n,ao:M})||ue(e,t,void 0,()=>b,p,S,A,M)}for(let[p,...b]of u??[])ue(e,p,b.length?b:void 0,()=>o,m,le(i,1.12),le(a,.78),ae)}function Ab(e,t){let n=zi.depthM/_,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=vl.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,f])=>({x:m,y:f})))):null}catch{return null}}function Sl(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function wl(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function Pl(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,f=0;for(;f<l-1e-9;){let d=Math.min(i,l-f);r&&o.push([{x:s.x+u*f,y:s.y+m*f},{x:s.x+u*(f+d),y:s.y+m*(f+d)}]),f+=d,i-=d,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function uo(e,t,n){let o=ye(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?An(t.points??[],t.rotation):xe(t);if(!a||a.length<2)return;let s=r*.5,c=Sl(t)?Pl(a,...wl(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let f=-(u.y-l.y)/m*s,d=(u.x-l.x)/m*s,h=[(l.x+f)*_,n,(l.y+d)*_],p=[(u.x+f)*_,n,(u.y+d)*_],b=[(u.x-f)*_,n,(u.y-d)*_],y=[(l.x-f)*_,n,(l.y-d)*_];e.tri(h,p,b,[0,1,0],o),e.tri(h,b,y,[0,1,0],o)}}function Al(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var En=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function ar(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[En(r,s,n),En(i,a,n),En(i,a,o),En(r,s,o)]}function Il(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=v=>c?Math.min(v,r):v,u=qe(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*_;if(m<.4)return!1;let f=En(u[0],u[1],.5),d=En(u[3],u[2],.5),h=Math.hypot(f.x-s.x,f.y-s.y)<=Math.hypot(d.x-s.x,d.y-s.y),p=ge(a,[.92,.9,.86],.35),b=le(i,.72),y=r-o;if(t==="restroom"){let v=Math.min(.18,y*.08);return be(e,u,r-v,o,a,i),be(e,u,r,r-v,p,p),!0}let M=o+Math.min(1.1,y),S=t==="coat"?1:Math.min(.5,.75/m),A=ar(u,h,0,S);if(be(e,A,M-.05,o,b,i),be(e,A,M,M-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let v=ar(u,h,Math.max(S+.2,1-.45/m),1),P=l(o+Math.max(Math.min(2.2,y*2),M-o+.6));return be(e,v,P,o,a,b),!0}let x=ar(u,h,Math.max(S+.25,.55),1),g=l(o+Math.max(2.6,M-o+1.4));if(g-.14<=M)return!0;be(e,x,g-.14,o,a,i),be(e,u,g,g-.14,p,b);let w=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*_));for(let[v,P]of[[0,w],[1-w,1]])be(e,ar(Ue(u,v,P),h,0,Math.min(.08,.1/m)),g-.14,M,b,b);return!0}var Ib=[.12,.38,.16],Rb=[.72,.62,.45],Eb=[.88,.93,.96],Rl=[.95,.95,.94],Cb=[.66,.29,.22],Ui={length:20.12,width:3.05},_b=.14,Tb=9.76,It=[.93,.94,.95],sr=[.1,.11,.13],Lb=[.45,.85,1.25],kb=1.45,El=.012,Cl=.004,Ob=1.07,Fb=.15;function _n(e,t,n,o,r,i){e.setMaterial(i),ue(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,ae)}var _l=(e,t)=>_t(e,t/_);function Tl(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function Db(e,t,n,o){let r=t.map(i=>[i.x*_,n,i.y*_]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function cr(e,t,n,o,r,i){let a=n/_,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ue(e,s,void 0,()=>r,o,i,le(i,.85),ae)}function Cn(e,t,n,o,r,i,a){let s=Tl(t,n,o/_);s&&ue(e,s,void 0,()=>i,r,a,le(a,.85),ae)}function lr(e){let t=qe(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/_,y:n.y+(i.y*c+a.y*l)/_}),lengthM:o*_,widthM:r*_}}function Ll(e,t,n){let o=Zs(t);if(!o.length)return;let r=1/0,i=-1/0,a=1/0,s=-1/0;for(let S of t.points??[])r=Math.min(r,S.x),i=Math.max(i,S.x),a=Math.min(a,S.y),s=Math.max(s,S.y);let c=(t.rotation??0)*Math.PI/180,l=Math.cos(c),u=Math.sin(c),m=(r+i)/2,f=(a+s)/2,d=S=>c?{x:m+(S.x-m)*l-(S.y-f)*u,y:f+(S.x-m)*u+(S.y-f)*l}:S,h=Math.min(i-r,s-a)*_,p=Math.max(.04,Math.min(.3,h*.004))/_,b=0;e.setMaterial(0);for(let S of o){if(!S.fill)continue;let A=S.points.map(d);_n(e,A,null,n+El+b*Cl,ye(S.fill)??It,0),b++}let y=o.filter(S=>!(S.fill&&S.ink===S.fill)),M=[...new Set(y.map(S=>S.ink??Wo))];for(let S of M){let A=n+El+b++*Cl,x=ye(S)??It;for(let g of y){if((g.ink??Wo)!==S)continue;let w=g.points.map(d),v=g.closed?w.length:w.length-1;for(let P=0;P<v;P++){let R=Tl(w[P],w[(P+1)%w.length],p);R&&Db(e,R,A,x)}}}}function kl(e,t,n,o,r){if(t.length<3)return!1;let i=o+.006,a=r??Ib;if(n==="oval-cricket"){let s=t.reduce((x,g)=>x+g.x,0)/t.length,c=t.reduce((x,g)=>x+g.y,0)/t.length,l=x=>t.map(g=>({x:s+(g.x-s)*x,y:c+(g.y-c)*x})),u=8;for(let x=0;x<u;x++){let g=l(1-x/u),w=x===u-1?null:l(1-(x+1)/u);_n(e,g,w,i,le(a,x%2?1.04:.96),4)}let m=t[0];for(let x of t)Math.hypot(x.x-s,x.y-c)>Math.hypot(m.x-s,m.y-c)&&(m=x);let f=Math.hypot(m.x-s,m.y-c)||1,d=(m.x-s)/f,h=(m.y-c)/f,p=-h,b=d,y=Math.min(1,2*f*_*_b/Ui.length),M=Ui.length*y/2/_,S=Ui.width*y/2/_,A=[[-M,-S],[M,-S],[M,S],[-M,S]].map(([x,g])=>({x:s+d*x+p*g,y:c+h*x+b*g}));return _n(e,A,null,i+.004,Rb,0),e.setMaterial(0),!0}if(n==="rink-hockey"){let s=_l(t,Fb);return _n(e,s,null,i,Eb,0),e.setMaterial(0),ue(e,t,[s.slice().reverse()],()=>o+Ob,o,Rl,le(Rl,.9),ae),!0}if(n==="ring-boxing"&&t.length===4){let{at:s}=lr(t),c=[s(-3.05,-3.05),s(3.05,-3.05),s(3.05,3.05),s(-3.05,3.05)],l=[[.77,.19,.19],It,[.17,.42,.69],It];e.setMaterial(0),c.forEach((u,m)=>cr(e,u,.07,o,o+kb,l[m]));for(let u of Lb)for(let m=0;m<4;m++)Cn(e,c[m],c[(m+1)%4],.025,o+u-.025,o+u+.025,It);return!0}if(n==="court-tennis"&&t.length===4){let{at:s}=lr(t);e.setMaterial(0),Cn(e,s(0,-6.4),s(0,6.4),.015,o,o+.95,sr),Cn(e,s(0,-6.4),s(0,6.4),.03,o+.95,o+1,It);for(let c of[-1,1])cr(e,s(0,c*6.4),.05,o,o+1.07,sr);return!0}if(n==="court-basketball"&&t.length===4){let{at:s,lengthM:c}=lr(t),l=Math.min(14,c/2-.5);e.setMaterial(0);for(let u of[-1,1]){let m=s(u*(l+1.2),0),f=s(u*(l-1.2),0);cr(e,m,.12,o,o+3.4,sr),Cn(e,m,f,.06,o+3.25,o+3.4,sr),Cn(e,s(u*(l-1.2),-.9),s(u*(l-1.2),.9),.03,o+2.9,o+3.95,It)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:s,lengthM:c}=lr(t),l=c*(50/120);e.setMaterial(0);for(let u of[-1,1]){for(let m of[-2.8,2.8])cr(e,s(u*l,m),.07,o,o+12,It);Cn(e,s(u*l,-2.8),s(u*l,2.8),.06,o+2.94,o+3.06,It)}return!0}if(n==="track-athletics"){let s=_l(t,Tb);return s.length<3?!1:(_n(e,t,s,i,Cb,0),_n(e,s,null,i,a,4),e.setMaterial(0),!0)}return!1}var Ol=[.19,.4,.15],Nb=.012,dr=2.4,Bb=1,Vb=.75,Gb=.15;function lt(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function Hl(e,t,n,o,r,i,a=!1){let s=lt(t);if(s){if(a){let c=Jt(o,r.boothTop),l=pt([...s]);ue(e,at(l,Hb/_),[l.slice().reverse()],()=>n+.03,n,c,le(c,.8),ae);return}if(!(!t.points&&i&&Ub(e,s,n,o,i))){if(!t.points&&i&&s.length===4){zb(e,s,n,o,i);return}ue(e,s,void 0,()=>n+dr,n,Jt(o,r.boothTop),r.boothWall,ae)}}}var ji=1.1,Fl=[.9,.9,.88],Hb=.1,ur=[.87,.87,.85],Dl=.08;function zl(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let f=a(i[0],i[1],c),d=a(i[0],i[1],l),h=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(f,h,u),a(d,p,u),a(d,p,m),a(f,h,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*_,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*_}}function zb(e,t,n,o,r){let{q:i,part:a}=zl(t,r),s=o??[.35,.42,.55],c=ge(s,[.78,.78,.77],.62),l=ge(s,[.95,.95,.94],.45);be(e,i,n+Ot,n,c,le(c,.8)),be(e,a(.05,.95,.72,.98),n+ji-.05,n+Ot,l,le(l,.8)),be(e,a(.03,.97,.7,1),n+ji,n+ji-.05,Fl,le(Fl,.9))}function Ub(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=zl(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=ge(l,[.78,.78,.77],.62),m=n+dr,f=Dl/c,d=Dl/s;be(e,i,n+Ot,n,u,le(u,.8)),be(e,a(0,1,1-d,1),m,n+Ot,ur,le(ur,.9));for(let[b,y]of[[0,f],[1-f,1]])be(e,a(b,y,0,1-d),m,n+Ot,ur,le(ur,.9));be(e,a(f,1-f,0,Math.min(.5,.06/s)),m,m-.3,l,le(l,.85));let h=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return be(e,a(.5-h,.5+h,.72-p,.72+p),n+Bb,n+Ot,ge(l,[.95,.95,.94],.7),le(l,.75)),!0}function hr(e){if(e.shape==="round"){let u=e.radius;return u?Uo(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function Ul(e,t,n,o,r,i=!0){let a=hr(t);if(!a)return;let s=a.reduce((f,d)=>f+d.x,0)/a.length,c=a.reduce((f,d)=>f+d.y,0)/a.length,l=f=>a.map(d=>({x:s+(d.x-s)*f,y:c+(d.y-c)*f})),u=i&&o?Jt(o,r.tableTop):jb,m=n+Vb;ue(e,a,void 0,()=>m,n+Wb,u,le(u,.86),ae),ue(e,l(.12),void 0,()=>m+.12,m,Nl,le(Nl,.8),ae)}var jb=[.93,.92,.89],Nl=[.78,.66,.42],Wb=.25,mo={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function Xb(e,t,n){let o=e.reduce((y,M)=>y+M.x,0)/4,r=e.reduce((y,M)=>y+M.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=mo.armM/_,m=mo.widthM/_,f=s/2+mo.insideM/_,d=n?-1:1,h=o+i*(f+(n?0:u)),p=r+a*(f+(n?0:u)),b=(y,M)=>({x:h+i*y*d+c*M,y:p+a*y*d+l*M});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function Yb(e,t,n,o,r){let i=[.94,.95,.96];ue(e,Xb(t,o,r),void 0,()=>n+mo.high,n+mo.low,i,i,ae)}function fr(e,t){let n=ye(e);return n?{top:le(dt(n,.12),.95),wall:le(dt(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function jl(e,t,n,o,r,i,a,s,c=[]){let l=xe(t),u=ul(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){uo(e,t,n+o+Nb);return}let f=s?s.kind==="stage":t.role==="stage",d=s?s.kind==="screen":t.role==="screen",h=s?{kind:f?"stage":"solid",heightM:s.topY-s.baseY}:ct(t),p=s?.baseY??n,b=s?.topY??n+o;if(f&&a){let F=1/0,E=-1/0,I=1/0,C=-1/0;for(let L of l)L.x<F&&(F=L.x),L.x>E&&(E=L.x),L.y<I&&(I=L.y),L.y>C&&(C=L.y);a.push({cx:(F+E)/2*_,cz:(I+C)/2*_,y:b,halfX:Math.max((E-F)/2*_,.5),halfZ:Math.max((C-I)/2*_,.5)})}let y=ye(t.fill),M=t.role==="wall"||t.role==="entrance"||t.role==="exit",S=M?fr(t.fill,r).top:f&&y?ge(r.stageTop,le(dt(y,.18),.9),.9):!t.role&&y?y:Jt(y,f?r.stageTop:r.decorTop),A=d?y:null,x=M?fr(t.fill,r).wall:f?y?ge(r.stageWall,le(y,.58),.82):r.stageWall:d?A?ge(le(A,1.42),[.24,.46,.82],.08):[.24,.46,.82]:Jt(ye(t.fill),r.decorWall),g=f&&an(r)?Xt(!0):null,w=g?Gl(S,g.stageTop):S,v=g?Gl(x,g.stageWall):x;if(t.role==="wall"&&!s){ir(e,l,p,b,c,w,v,i),uo(e,t,b+.012);return}if(d&&l.length===4&&b-p>.2){let F=Hi(l,p,b);if(!F)return;let{quad:E,side:I,trim:C,inner:L,panel:N}=F,O=[.12,.15,.18];for(let[H,j]of[[0,I],[1-I,1]])be(e,Ue(E,H,j),b,p,O,O);be(e,L,p+C,p,O,O),be(e,L,b,b-C,O,O),be(e,N,b-C,p+C,v,v),uo(e,t,b+.012);return}let P=y?le(dt(y,.15),.82):v,R=y?le(dt(y,.1),1.02):w;if(Al(t.role)&&!s&&Il(e,t.role,l,p,b,P,R,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.min(.12,.09/Math.max(E,.001)),C=[.18,.21,.24],L=b-Math.min(.12,(b-p)*.15);for(let[N,O]of[[0,I],[1-I,1]])be(e,Ue(F,N,O),L,p,C,C);be(e,F,b,L,w,C);return}if(t.role==="rail"&&l.length===4&&b>p){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.max(1,Math.min(128,Math.ceil(E/1.4))),C=Math.min(.08,.055/Math.max(.055,E)),L=[.58,.64,.66];for(let N=0;N<=I;N++){let O=N/I,H=Math.min(1-C,Math.max(0,O-C/2));be(e,Ue(F,H,H+C),b,p,L,le(L,.8))}for(let N of[.52,1]){let O=p+(b-p)*N;be(e,F,O,Math.max(p,O-.055),L,le(L,.8))}return}if(t.role==="goal"&&l.length===4){let F=qe(l),E=Math.hypot(F[1].x-F[0].x,F[1].y-F[0].y)*_,I=Math.min(.12,.1/Math.max(.1,E)),C=[.9,.94,.94];for(let[L,N]of[[0,I],[1-I,1]])be(e,Ue(F,L,N),Math.max(p,b-.1),p,C,C);be(e,F,b,Math.max(p,b-.1),C,C);return}if(h.kind==="portal"&&l.length===4){let F=Rn(l,p,b);if(!F)return;let{quad:E,side:I,face:C,openingTop:L}=F;for(let[N,O,H]of[[0,C,1],[C,1-C,.67],[1-C,1,1]]){let j=lo(E,N,O),V=le(w,H),T=le(v,H);for(let[B,D]of[[0,I],[1-I,1]])be(e,Ue(j,B,D),L,p,V,T);be(e,j,b,L,V,T)}(t.role==="entrance"||t.role==="exit")&&Yb(e,E,p,i,t.role==="exit");return}if(h.kind==="suite"&&l.length===4){let F=l.map((C,L)=>{let N=l[(L+1)%4],O=(C.x+N.x)/2,H=(C.y+N.y)/2;return Math.hypot(O-i.x,H-i.y)}),E=F.indexOf(Math.min(...F)),I=[0,1,2,3].map(C=>l[(E+C)%4]);be(e,Ue(I,0,.08),b,p,w,v),be(e,Ue(I,.92,1),b,p,w,v),be(e,lo(I,.88,1),b,p,w,v),be(e,I,b,Math.max(p,b-.18),w,v);return}if(f&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let F=b-Math.min(.06,(b-p)*.15);be(e,l,F,p,w,v,u),be(e,l,b,F,w,ge(w,v,.2),u)}else be(e,l,b,p,w,v,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let F=qe(l),E=ge(y??Ol,Ol,y?.45:0);for(let I=0;I<12;I++){let C=Ue(F,I/12,(I+1)/12),L=le(E,I%2?1.09:.91),N=C.map(O=>[O.x*_,b+.006,O.y*_]);e.tri(N[0],N[1],N[2],[0,1,0],L),e.tri(N[0],N[2],N[3],[0,1,0],L)}}t.stageKind&&t.stageKind!=="pitch-football"&&kl(e,l,t.stageKind,b,y),f&&Zt(t.stageKind)&&Ll(e,t,b),e.setMaterial(d?1:0),uo(e,t,b+.012)}function pr(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([f,d])=>({x:i+f*c-d*l,y:a+f*l+d*c}))}function Kb(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return ye(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=ye(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>ge(s,c,1/(l+1)),a[0]):null}function Wl(e,t,n,o){if(t.layer==="foreground")return;let r=pr(t);if(!r)return;let i=n+Gb,a=Jt(Kb(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=ge(o.ground,a,s)),ue(e,r,void 0,()=>i,n,a,ge(a,o.decorWall,.5),ae)}function Xl(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=jc(o,r.gaTop);ue(e,t.points,t.holes,()=>n+Bl,n,i,r.gaWall,ae),qb(e,t.points,n+Bl)}var Bl=.15,mr=[.72,.74,.76],Wi=1.1,Vl=.12,Xi=.05,$b=.06,Zb=2.4;function qb(e,t,n){let o=pt([...t]),r=_t(o,Vl/_),i=_t(o,(Vl+Xi)/_);if(r.length<3||i.length<3)return;for(let s of[n+Wi,n+Wi*.5])ue(e,r,[i.slice().reverse()],()=>s,s-Xi,mr,le(mr,.85),ae);let a=$b/2/_;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*_,m=Math.max(1,Math.round(u/Zb));for(let f=0;f<m;f++){let d=f/m,h=c.x+(l.x-c.x)*d,p=c.y+(l.y-c.y)*d,b=[{x:h-a,y:p-a},{x:h+a,y:p-a},{x:h+a,y:p+a},{x:h-a,y:p+a}];ue(e,b,void 0,()=>n+Wi-Xi,n,mr,le(mr,.8),ae)}}}function Gl(e,t){return Lo(e)<t?Wt(e,t):e}var Yi=.6,Yl=3,Qb=.25;function Jb(e,t){if(Ze(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Kl(e,t){let n=e.map(a=>({booth:a,ring:lt(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(Yl+Yi)/_,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((d,h)=>d+h.x,0)/4,y:s.reduce((d,h)=>d+h.y,0)/4},u=[0,1,2,3].map(d=>{let h=s[d],p=s[(d+1)%4],b={x:(h.x+p.x)/2,y:(h.y+p.y)/2},y=b.x-l.x,M=b.y-l.y,S=Math.hypot(y,M)||1,A={x:b.x+y/S*Yi/_,y:b.y+M/S*Yi/_},x=Yl/_;return o.forEach((g,w)=>{w===c||A.x<g.minX-r||A.x>g.maxX+r||A.y<g.minY-r||A.y>g.maxY+r||(x=Math.min(x,Jb(A,n[w].ring)))}),{open:x*_,toward:{x:b.x+y/S*10/_,y:b.y+M/S*10/_},focal:Math.hypot(b.x-t.x,b.y-t.y)}}),m=Math.max(...u.map(d=>d.open)),f=u.filter(d=>d.open>=m-Qb).sort((d,h)=>d.focal-h.focal)[0];i.set(a.id,f.toward)}),i}var $l=ft(require("polygon-clipping"),1);var e0=.45,t0=1500,n0=200;function Zl(e,t){if(e.role!=="stage"||Zt(e.stageKind))return e;let n=xe(e);if(!n||n.length<3||Math.abs($e(n))*_*_>t0)return e;let o=t.filter(a=>Ze(n,a.x,a.y));if(!o.length||o.length>n0)return e;let r=e0/_,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=$l.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([f,d])=>({x:f,y:d})),m=Math.abs($e(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var o0=Math.PI/180,Ae=96,r0=6,i0=60,a0=150,ql=.2,s0=.35;function c0(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/o0;return n<0?n+360:n}function br(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function yr(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Ql(e,t){let n=e.filter(f=>f.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let f of n)for(let d of f.rows){for(let h of d.pts)r+=h.x,i+=h.y,a++;if(d.pts.length>=4){let h=Ii(d.pts);h&&Number.isFinite(h.cx)&&Number.isFinite(h.cy)&&o.push({x:h.cx,y:h.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let f=br(o.map(y=>y.x)),d=br(o.map(y=>y.y)),h=0;for(let y of n)for(let M of y.rows)for(let S of M.pts){let A=Math.hypot(S.x-s.x,S.y-s.y);A>h&&(h=A)}let p=0,b=h*.2;for(let y of n)for(let M of y.rows)for(let S of M.pts)Math.hypot(S.x-f,S.y-d)<b&&p++;Math.hypot(f-s.x,d-s.y)<=h&&p/a<.01&&(c={x:f,y:d})}let l=[];for(let f of n){let d={sectionId:f.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let h of f.rows)for(let p of h.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),y=Math.min(Ae-1,Math.floor(c0(c,p)/(360/Ae)));d.samples.push({r:b,bin:y,levelM:h.levelM}),b<d.rMin&&(d.rMin=b),b>d.rMax&&(d.rMax=b)}d.samples.length&&l.push(d)}if(!l.length)return null;l.sort((f,d)=>f.rMin+f.rMax-(d.rMin+d.rMax));let u=[];for(let f of l){let d=!1;for(let h of u){let p=Math.min(f.rMax,h.rMax)-Math.max(f.rMin,h.rMin),b=Math.min(f.rMax-f.rMin,h.rMax-h.rMin);if(b>1e-9&&p>=s0*b){h.members.push(f),h.rMin=Math.min(h.rMin,f.rMin),h.rMax=Math.max(h.rMax,f.rMax),d=!0;break}}d||u.push({members:[f],rMin:f.rMin,rMax:f.rMax})}let m=[];for(let f of u){let d=new Array(Ae).fill(null);for(let E of f.members)for(let I of E.samples){let C=d[I.bin];C||(C={samples:[]},d[I.bin]=C),C.samples.push({r:I.r,levelM:I.levelM})}let h=d.map(E=>!!E);if(!h.filter(Boolean).length)continue;let b=[],y=[];for(let E of d){if(!E)continue;let I=1/0,C=-1/0;for(let L of E.samples)L.r<I&&(I=L.r),L.r>C&&(C=L.r);b.push(I),y.push(C)}let M=br(b),S=br(y);if(!(M>=ql*S)||!(S>0))continue;let A=[...b].sort((E,I)=>E-I);if(!(A[Math.floor(A.length*.1)]>=ql*S))continue;let g=d.map(E=>{if(!E)return null;let I=[...E.samples].sort((T,B)=>T.r-B.r),C=I[0].r,L=I[I.length-1].r,N=I[0].levelM,O=-1/0;for(let T of I)T.levelM>O&&(O=T.levelM);let H=[];for(let T of I){let B={r:T.r,l:T.levelM};for(;H.length&&Math.abs(H[H.length-1].r-B.r)<1e-9;){if(H[H.length-1].l<=B.l){B.skip=!0;break}H.pop()}if(!B.skip){for(;H.length>=2;){let D=H[H.length-2],G=H[H.length-1];if((G.r-D.r)*(B.l-D.l)-(G.l-D.l)*(B.r-D.r)<=0)H.pop();else break}H.push(B)}}let j=H.map(T=>T.r),V=H.map(T=>T.l);return{inner:C,outer:L,front:N,top:O,profile:{rs:j,ls:V}}}),w=h.slice();for(let E=0;E<Ae;E++){if(w[E])continue;let I=-1,C=-1,L=0;for(let U=1;U<=Ae;U++){let q=(E-U+Ae*2)%Ae;if(w[q]){I=q;break}}for(let U=1;U<=Ae;U++){let q=(E+U)%Ae;if(w[q]){C=q,L=U;break}}if(I<0||C<0)continue;let N=0;for(let U=1;U<=Ae;U++){let q=(E-U+Ae*2)%Ae;if(h[q]){N=U;break}}if(N-1+L>r0)continue;let H=g[I],j=g[C],V=N/(N+L),T=H.inner+(j.inner-H.inner)*V,B=H.outer+(j.outer-H.outer)*V,D=H.front+(j.front-H.front)*V,G=H.top+(j.top-H.top)*V;g[E]={inner:T,outer:B,front:D,top:G,profile:{rs:[T,B],ls:[D,G]}}}for(let E=0;E<Ae;E++)g[E]&&(w[E]=!0);let v=360/Ae,P=[],R=w.filter(Boolean).length,k=[];if(R===Ae)k.push({start:0,len:Ae});else{let E=0;for(;w[E];)E=(E+1)%Ae;let I=-1;for(let C=0;C<=Ae;C++){let L=(E+C)%Ae,N=C<Ae&&w[L];if(N&&I<0)I=L;else if(!N&&I>=0){let O=(L-I+Ae)%Ae||Ae;k.push({start:I,len:O}),I=-1}}}for(let E of k){if(E.len*v<i0&&E.len<Ae)continue;let I=E.len===Ae,C=new Float64Array(E.len),L=new Float64Array(E.len),N=new Float64Array(E.len),O=new Float64Array(E.len),H=[];for(let U=0;U<E.len;U++){let q=g[(E.start+U)%Ae];C[U]=q.inner,L[U]=q.outer,N[U]=q.front,O[U]=q.top,H.push(q.profile??{rs:[q.inner,q.outer],ls:[q.front,q.top]})}let j=yr(C,I),V=yr(L,I),T=yr(N,I),B=yr(O,I);for(let U=0;U<E.len;U++)j[U]>C[U]&&(j[U]=C[U]),V[U]<L[U]&&(V[U]=L[U]),j[U]>V[U]-1e-6&&(j[U]=Math.max(0,V[U]-1e-6)),B[U]<T[U]&&(B[U]=T[U]);let D={startBin:E.start,binCount:E.len,closed:I,innerR:j,outerR:V,frontLevelM:T,topLevelM:B,profiles:H},G=(U,q,$)=>{let te=H[U],Q=te.rs,X=te.ls;if(q<=Q[0]){X[0]>$&&(X[0]=$);return}if(q>=Q[Q.length-1]){X[X.length-1]>$&&(X[X.length-1]=$);return}for(let Y=0;Y+1<Q.length;Y++)if(q<=Q[Y+1]){X[Y]>$&&(X[Y]=$),X[Y+1]>$&&(X[Y+1]=$);return}};for(let U=0;U<E.len;U++){let q=d[(E.start+U)%Ae];if(q)for(let $ of q.samples){G(U,$.r,$.levelM);let te=I?(U-1+E.len)%E.len:U-1,Q=I?(U+1)%E.len:U+1;te>=0&&G(te,$.r,$.levelM),Q<E.len&&G(Q,$.r,$.levelM)}}P.push(D)}P.reduce((E,I)=>E+I.binCount*v,0)<a0||m.push({arcs:P,sectionIds:f.members.map(E=>E.sectionId),innerRMedian:M,outerRMedian:S})}if(!m.length)return null;if(m.sort((f,d)=>f.innerRMedian-d.innerRMedian),t){let f=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*f)return null}return{centre:c,binCount:Ae,binStepDeg:360/Ae,rings:m}}function Jl(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],f=m.rs,d=m.ls;if(o<=f[0])return d[0];if(o>=f[f.length-1])return d[d.length-1];for(let h=0;h+1<f.length;h++)if(o<=f[h+1]){let p=f[h+1]-f[h],b=p>1e-9?(o-f[h])/p:0;return d[h]+(d[h+1]-d[h])*b}return d[d.length-1]};return l(a)*(1-c)+l(s)*c}function Ki(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,y)=>{At(e,p,b,y,l,a,s,{portalBase:u,ao:c})||ue(e,p,void 0,()=>y,b,a,s,c)},f=(p,b,y)=>({x:p.x+(b.x-p.x)*y,y:p.y+(b.y-p.y)*y}),d=o?t.length:t.length-1,h=0;for(let p=0;p<d;p++){let b=(p+1)%t.length,y=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*fe;if(y<1e-5)continue;let M=(g,w)=>[f(t[p],t[b],g),f(t[p],t[b],w),f(n[p],n[b],w),f(n[p],n[b],g)];m(M(0,1),r,r+.95),m(M(0,1),i-.22,i);let S=Math.ceil((h-.32)/6)*6,A=!1,x=!1;for(let g=S;g<h+y;g+=6){let w=Math.max(0,(g-h)/y),v=Math.min(1,(g+.32-h)/y);v<=w||(m(M(w,v),r+.95,i-.22),A||=w<1e-6,x||=v>1-1e-6)}if(!o&&(p===0&&!A||p===d-1&&!x)){let g=Math.min(1,.32/y);m(M(p===0?0:1-g,p===0?g:1),r+.95,i-.22)}h+=y}}var Ft=ft(require("polygon-clipping"),1),ho=.65;function $i(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Zi=.01;function eu(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-ho:r;e.setMaterial(5);let f=u?[]:s.filter(g=>{if(g.role!=="entrance"&&g.role!=="exit")return!1;let w=xe(g);if(!w)return!1;let v=Rn(w,r,r+ct(g).heightM);return v!==null&&v.openingTop<=o-.12});if((!f.length||!At(e,t,m,o,f,i,a,{holes:n,portalBase:r}))&&ue(e,t,n,()=>o,m,i,a,ae,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let d=c&&l.bays.length?l0(t,n,_t(t,fo/_),l):null,h=6/_,p=.22/_,b=s.flatMap(g=>{if(g.role!=="entrance"&&g.role!=="exit")return[];let w=xe(g);return w?.length?[{minX:Math.min(...w.map(v=>v.x)),maxX:Math.max(...w.map(v=>v.x)),minY:Math.min(...w.map(v=>v.y)),maxY:Math.max(...w.map(v=>v.y))}]:[]}),y=Math.min(...t.map(g=>g.x)),M=Math.max(...t.map(g=>g.x)),S=Math.min(...t.map(g=>g.y)),A=Math.max(...t.map(g=>g.y));for(let g=y+h/2;g<M;g+=h)for(let w=S+h/2;w<A;w+=h){if(b.some(P=>g+p>=P.minX&&g-p<=P.maxX&&w+p>=P.minY&&w-p<=P.maxY))continue;let v=[{x:g-p,y:w-p},{x:g+p,y:w-p},{x:g+p,y:w+p},{x:g-p,y:w+p}];!Ge({x:g,y:w},t,n)||$i({x:g,y:w},[t,...n??[]])<p*Math.SQRT2+(c?fo/_:0)||d&&$i({x:g,y:w},d.flat())<p*Math.SQRT2+fo/_||ue(e,v,void 0,()=>m,r,i,a,ae)}if(d){for(let[g,...w]of d)ue(e,g,w,()=>m,r-Zi,i,a,ae);e.setMaterial(0);return}let x=_t(t,fo/_);if(c&&x.length>=3){let g=s.filter(P=>{if(P.role!=="entrance"&&P.role!=="exit")return!1;let R=xe(P);return!!R&&R.some(k=>!Ge(k,t,void 0)||$i(k,[t])<=fo/_)}),w=[x.slice().reverse()],v=r-Zi;(!g.length||!At(e,t,v,m,g,i,a,{holes:w,portalBase:r+Zi}))&&ue(e,t,w,()=>m,v,i,a,ae)}e.setMaterial(0)}var qi=.25,fo=qi;function l0(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return Ft.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=Ft.default.difference(a,[r(n)]),c=Ft.default.intersection(a,i(o.bays));if(!c.length)return null;let l=Ft.default.difference(Ft.default.intersection(a,i(o.walls)),c);return Ft.default.union(Ft.default.difference(s,c),l).map(m=>m.map(f=>f.slice(0,-1).map(([d,h])=>({x:d,y:h}))))}catch{return null}}var u0=.02,m0=.25,f0=1.2,d0=.6,h0=.45,p0=2.3,b0=Math.PI/180,tu=.005;function yt(e,t,n){let o=n*b0;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function y0(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var g0=24,x0=.01;function M0(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=g0,m=fe,f=i+.02,d=i-x0,h=[];for(let I=0;I<l;I++){let C=(n.startBin+I+.5)*t.binStepDeg,L=new Float64Array(u+1);for(let N=0;N<=u;N++){let O=o[I]+(r[I]-o[I])*N/u;L[N]=Math.max(f,Jl(t,n,C,O)-m0)}h.push(L)}if(c){let I=0;for(let C=0;C+1<l;C++)for(let L=0;L<u;L++){let N=yt(t.centre,o[C]+(r[C]-o[C])*L/u,(n.startBin+C+.5)*t.binStepDeg),O=yt(t.centre,o[C+1]+(r[C+1]-o[C+1])*(L+1)/u,(n.startBin+C+1.5)*t.binStepDeg);I=Math.max(I,Math.hypot(O.x-N.x,O.y-N.y))}for(let C=0;C<l;C++){let L=(n.startBin+C+.5)*t.binStepDeg;for(let N=0;N<=u;N++){let O=yt(t.centre,o[C]+(r[C]-o[C])*N/u,L),H=c(O.x,O.y,I*1.01);H!==null&&(h[C][N]=Math.min(h[C][N],Math.max(d+tu,H-tu)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],y=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],M=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],S=(I,C)=>{let L=(n.startBin+I+.5)*t.binStepDeg,N=o[I]+(r[I]-o[I])*C/u,O=yt(t.centre,N,L);return[O.x*m,h[I][C],O.y*m]};{let I=Math.tan(12*Math.PI/180);for(let C=0;C<6;C++){let L=!1;for(let O=0;O<l;O++)for(let H=u-1;H>=0;H--)h[O][H]>h[O][H+1]&&(h[O][H]=h[O][H+1],L=!0);let N=n.closed?l:l-1;for(let O=0;O<N;O++){let H=(O+1)%l;for(let j=0;j<=u;j++){let V=h[H][j]-h[O][j];if(Math.abs(V)>1)continue;let T=o[O]+(r[O]-o[O])*j/u,B=o[H]+(r[H]-o[H])*j/u,D=yt(t.centre,T,(n.startBin+O+.5)*t.binStepDeg),G=yt(t.centre,B,(n.startBin+H+.5)*t.binStepDeg),U=I*Math.hypot(G.x-D.x,G.y-D.y)*m;V>U?(h[H][j]=h[O][j]+U,L=!0):-V>U&&(h[O][j]=h[H][j]+U,L=!0)}}if(!L)break}}let A=1,x=(I,C)=>{for(let L=0;L<=u;L+=4)if(Math.abs(h[I][L]-h[C][L])>A)return!0;return Math.abs(h[I][u]-h[C][u])>A},g=Math.tan(38*Math.PI/180),w=I=>(r[I]-o[I])/u*m,v=(I,C)=>h[I][C+1]-h[I][C]>g*Math.max(1e-6,w(I)),P=(I,C)=>{let L=n.closed?(I-1+l)%l:Math.max(0,I-1),N=n.closed?(I+1)%l:Math.min(l-1,I+1);Math.abs(h[L][C]-h[I][C])>A&&(L=I),Math.abs(h[N][C]-h[I][C])>A&&(N=I);let O=Math.max(0,C-1),H=Math.min(u,C+1);O<C&&v(I,O)&&(O=C),H>C&&v(I,C)&&(H=C);let j=S(L,C),V=S(N,C),T=S(I,O),B=S(I,H),D=V[0]-j[0],G=V[1]-j[1],U=V[2]-j[2],q=B[0]-T[0],$=B[1]-T[1],te=B[2]-T[2],Q=G*te-U*$,X=U*q-D*te,Y=D*$-G*q,K=Math.hypot(Q,X,Y);return K>1e-12?(Q/=K,X/=K,Y/=K,X<0&&(Q=-Q,X=-X,Y=-Y),[Q,X,Y]):[0,1,0]},R=(I,C,L=!1)=>{let N=L&&Math.min(I[1],C[1])-i>=3,O=[I[0],N?I[1]-ho:d,I[2]],H=[C[0],N?C[1]-ho:d,C[2]],j=C[0]-I[0],V=C[2]-I[2],T=Math.hypot(j,V);if(!(T>1e-12))return;let B=[V/T,0,-j/T];e.tri(I,C,H,B,y,y,M),e.tri(I,H,O,B,y,M,M)},k=.05*et,F=I=>r[I]-o[I]<k,E=n.closed?l:l-1;for(let I=0;I<E;I++){let C=(I+1)%l;if(F(I)||F(C))continue;if(x(I,C)){let V=(n.startBin+I+1)*t.binStepDeg,T=($,te)=>{let Q=(o[I]+o[C])/2,X=(r[I]+r[C])/2,Y=Q+(X-Q)*te/u,K=yt(t.centre,Y,V);return[K.x*m,h[$][te],K.y*m]};for(let $=0;$<u;$++){let te=S(I,$),Q=S(I,$+1),X=T(I,$),Y=T(I,$+1),K=P(I,$),J=P(I,$+1);e.triN(te,X,Y,K,K,J,p),e.triN(te,Y,Q,K,J,J,p);let ce=S(C,$),oe=S(C,$+1),ee=T(C,$),ne=T(C,$+1),he=P(C,$),re=P(C,$+1);e.triN(ee,ce,oe,he,he,re,p),e.triN(ee,oe,ne,he,re,re,p);let ve=T(I,$),we=T(I,$+1),ot=T(C,$+1),ut=T(C,$),Ye=we[0]-ve[0],rt=we[2]-ve[2],Ie=Math.hypot(Ye,rt);if(Ie>1e-12){let Ht=[rt/Ie,0,-Ye/Ie];e.tri(ve,we,ot,Ht,y),e.tri(ve,ot,ut,Ht,y)}}let B=S(I,0),D=S(C,0),G=S(C,u),U=S(I,u),q=$=>[$[0],d,$[2]];Math.min(B[1],D[1])-i<3&&(e.tri(q(B),q(G),q(D),[0,-1,0],b),e.tri(q(B),q(U),q(G),[0,-1,0],b)),R(B,D,!0),R(U,G,!0);continue}for(let V=0;V<u;V++){let T=P(I,V),B=P(C,V),D=P(C,V+1),G=P(I,V+1);if(v(I,V)||v(C,V)){let Q=(we,ot)=>{let ut=(n.startBin+we+.5)*t.binStepDeg,Ye=o[we]+(r[we]-o[we])*(V+.5)/u,rt=yt(t.centre,Ye,ut);return[rt.x*m,ot,rt.y*m]},X=S(I,V),Y=S(C,V),K=Q(I,h[I][V]),J=Q(C,h[C][V]);e.triN(X,Y,J,T,B,B,p),e.triN(X,J,K,T,B,T,p);let ce=S(C,V+1),oe=S(I,V+1),ee=Q(I,h[I][V+1]),ne=Q(C,h[C][V+1]);e.triN(ee,ne,ce,G,D,D,p),e.triN(ee,ce,oe,G,D,G,p);let he=J[0]-K[0],re=J[2]-K[2],ve=Math.hypot(he,re);if(ve>1e-12){let we=[-re/ve,0,he/ve];e.tri(K,J,ne,we,y),e.tri(K,ne,ee,we,y)}continue}let U=S(I,V),q=S(C,V),$=S(C,V+1),te=S(I,V+1);e.triN(U,q,$,T,B,D,p),e.triN(U,$,te,T,D,G,p)}let L=S(I,0),N=S(C,0),O=S(C,u),H=S(I,u),j=V=>[V[0],d,V[2]];Math.min(L[1],N[1])-i<3&&(e.tri(j(L),j(O),j(N),[0,-1,0],b),e.tri(j(L),j(H),j(O),[0,-1,0],b)),R(L,N,!0),R(H,O,!0)}if(!n.closed)for(let I of[0,l-1])for(let C=0;C<u;C++)R(S(I,C),S(I,C+1))}function nu(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let f=new Float64Array(m.binCount),d=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,y=Math.max(0,m.innerR[p]-tt);f[p]=Math.max(y,a[b]+.001),d[p]=Math.max(f[p]+.001,m.outerR[p]+tt)}let h=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>h&&(h=b)}h>=f0&&M0(e,t,m,f,d,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;d[p]>a[b]&&(a[b]=d[p])}}if(n.deriveShell===!1||y0(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=d0*et,l=h0*et;for(let u of s.arcs){let m=[],f=[];for(let P=0;P<u.binCount;P++){let R=(u.startBin+P+.5)*t.binStepDeg,k=u.outerR[P]+tt+c;m.push(yt(t.centre,k,R)),f.push(yt(t.centre,k+l,R))}let d=-1/0;for(let P=0;P<u.binCount;P++)u.topLevelM[P]>d&&(d=u.topLevelM[P]);let h=d+p0,p=u.closed?f:[...f,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,y=ge(r.shellWall,[.66,.71,.72],.62),M=(P,R,k,F,E)=>{let I=Math.abs(F-d)<1e-6?F-u0:F;At(e,P,k,I,n.shapes,r.shellTop,E,{holes:R,portalBase:o,ao:i})||ue(e,P,R,()=>I,k,r.shellTop,E,i)},S=Math.max(1,Math.ceil((d-o)/4.5)),A=(d-o)/S,x=new Set,g=n.tierFrontLevels??t.rings.map(P=>{let R=P.arcs.flatMap(k=>Array.from(k.frontLevelM)).filter(Number.isFinite).sort((k,F)=>k-F);return R[Math.floor(R.length/2)]});for(let P of g)Number.isFinite(P)&&P-o>=3&&P<d&&x.add(Math.max(0,Math.min(S-1,Math.floor((P-o)/A))));let w=Math.min(...g.filter(P=>Number.isFinite(P)&&P-o>=3&&P<d));for(let P=0;P<S;P++)o+(P+1)*A<=w-ho&&Number.isFinite(w)&&x.add(P);for(let P=0;P<S;P++){let R=o+(d-o)*P/S,k=o+(d-o)*(P+1)/S;x.has(P)&&k-R>=3.2?(M(p,b,R,R+.45,y),Ki(e,m,f,u.closed,R+.45,k-.16,r.shellTop,y,i,n.shapes,o)):M(p,b,R,k-.16,y),M(p,b,k-.16,k,le(y,.62))}Ki(e,m,f,u.closed,d,h,r.shellTop,y,i,n.shapes,o);let v=8;for(let P=1;P<f.length;P++){if(v+=Math.hypot(f[P].x-f[P-1].x,f[P].y-f[P-1].y)*fe,v<8)continue;v=0;let R=f[P],k=f[P-1],F=R.x-k.x,E=R.y-k.y,I=Math.max(1,Math.hypot(F,E)),C=F/I*.16*et,L=E/I*.16*et,N=Math.max(1,Math.hypot(R.x-t.centre.x,R.y-t.centre.y)),O=(R.x-t.centre.x)/N*.24*et,H=(R.y-t.centre.y)/N*.24*et,j=[{x:R.x-C,y:R.y-L},{x:R.x+C,y:R.y+L},{x:R.x+C+O,y:R.y+L+H},{x:R.x-C+O,y:R.y-L+H}];M(j,void 0,o,d,le(y,1.12))}}}var v0=2.5,ou=.65,S0=2,w0=.03;function P0(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function ea(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<v0||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,f=u.y-t.y,d=Math.max(1,Math.hypot(m,f));return{x:u.x-m/d*ou/_,y:u.y-f/d*ou/_}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],f=s[u];Math.hypot(f.x-m.x,f.y-m.y)*_>S0?(l.length>=2&&c.push(l),l=[f]):l.push(f)}l.length>=2&&c.push(l);for(let u of c)P0(u,w0/_);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var ru=.1,A0=1.1,I0=.22,Qi=.95,Ji=.05,iu=1.8;function au(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of ea(t,n,o)){let s=a.y;for(let c of a.runs){let l=iu;for(let u=1;u<c.length;u++){let m=c[u-1],f=c[u],d=f.x-m.x,h=f.y-m.y,p=Math.hypot(d,h);if(p<1e-5)continue;let b=y=>{let M=-h/p*y/_/2,S=d/p*y/_/2;return[{x:m.x+M,y:m.y+S},{x:f.x+M,y:f.y+S},{x:f.x-M,y:f.y-S},{x:m.x-M,y:m.y-S}]};if(ue(e,b(I0),void 0,()=>s+ru,s-A0,r,r,ae),ue(e,b(Ji),void 0,()=>s+Qi,s+Qi-Ji,i,i,ae),l+=p*_,l>=iu||u===c.length-1){l=0;let y=.028/_,M=[{x:m.x-y,y:m.y-y},{x:m.x+y,y:m.y-y},{x:m.x+y,y:m.y+y},{x:m.x-y,y:m.y+y}];ue(e,M,void 0,()=>s+Qi-Ji,s+ru,i,i,ae)}}}}}var R0=.9,E0=1.5,C0=.3;function su(e,t,n){let o=[],r=[],i=R0/_,a=E0/_,s=C0/_;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,y)=>{let M=u[b],S=u[y],A=Math.hypot(M.x-S.x,M.y-S.y)||1;u[b]={x:M.x+(M.x-S.x)/A*s,y:M.y+(M.y-S.y)/A*s}};m(0,1),m(u.length-1,u.length-2);let f=u.map((b,y)=>{let M=u[Math.max(0,y-1)],S=u[Math.min(u.length-1,y+1)],A=S.x-M.x,x=S.y-M.y,g=Math.hypot(A,x)||1,w=-x/g,v=A/g;return w*(b.x-t.x)+v*(b.y-t.y)<0&&(w=-w,v=-v),{nx:w,ny:v}}),d=u.map((b,y)=>({x:b.x-f[y].nx*a,y:b.y-f[y].ny*a})),h=u.map((b,y)=>({x:b.x+f[y].nx*i,y:b.y+f[y].ny*i})),p=u.map((b,y)=>({x:b.x+f[y].nx*(i+n/_),y:b.y+f[y].ny*(i+n/_)}));o.push([...d,...h.slice().reverse()]),r.push([...h,...p.reverse()])}return{bays:o,walls:r}}var ta=.88,gr=.27,_0=1.2,T0=.01;function cu(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*ta,i[1]*ta,i[2]*ta],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],f=l.pts[u===0?1:u-1],d=m.x-f.x,h=m.y-f.y,p=Math.hypot(d,h);if(p<1e-5)continue;d/=p,h/=p;let b=1/0;for(let C=0;C<n.length;C++){let L=n[C],N=n[(C+1)%n.length],O=N.x-L.x,H=N.y-L.y,j=d*H-h*O;if(Math.abs(j)<1e-8)continue;let V=L.x-m.x,T=L.y-m.y,B=(V*H-T*O)/j,D=(V*h-T*d)/j;B>0&&D>=0&&D<=1&&(b=Math.min(b,B))}let y=.3/_,M=b-.04/_;if(!Number.isFinite(b)||b*_>2||M-y<.12/_)continue;let S=!!o&&s(c),A=r?.[c]?.pitch,x=S&&A&&Number.isFinite(A)?Math.min(_0/_,Math.max(gr/_,A-gr/_-T0/_)):gr/_,g=-h,w=d;o&&g*(o.x-m.x)+w*(o.y-m.y)<0&&(g=-g,w=-w);let v=gr/_,P=[{x:m.x+d*y+g*v,y:m.y+h*y+w*v},{x:m.x+d*M+g*v,y:m.y+h*M+w*v},{x:m.x+d*M-g*x,y:m.y+h*M-w*x},{x:m.x+d*y-g*x,y:m.y+h*y-w*x}];if(!P.every(C=>Ze(n,C.x,C.y)))continue;let R=r?.[c]?.belowY,k=R==null?0:l.y-R,F=!!o&&k>.03&&k<=.65;if(F&&o){let C=(L,N)=>Math.hypot((L.x+N.x)/2-o.x,(L.y+N.y)/2-o.y);C(P[0],P[1])>C(P[3],P[2])&&(P=[P[3],P[2],P[1],P[0]])}let E=F?Math.ceil((k-1e-8)/.2):1,I=(C,L,N)=>({x:C.x+(L.x-C.x)*N,y:C.y+(L.y-C.y)*N});for(let C=0;C<E;C++){let L=C/E,N=(C+1)/E,O=[I(P[0],P[3],L),I(P[1],P[2],L),I(P[1],P[2],N),I(P[0],P[3],N)],H=l.y+.008-(F?k*(1-N):0);ue(e,O,void 0,()=>H,H-(F?k/E+.1:.16),i,a,ae)}}}}var L0=.02,k0=.012,O0=.01,F0=.3,D0=.5;function N0(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function B0(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=N0(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function lu(e,t,n,o,r,i,a){let s=o.filter(f=>f.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(f=>{let d=0,h=0;for(let b of f.pts)d+=b.x,h+=b.y;d/=f.pts.length,h/=f.pts.length;let p=0;for(let b of f.pts)p=Math.max(p,Math.hypot(b.x-d,b.y-h));return{cx:d,cy:h,rad:p}}),l=[...t],u=n.map(f=>[...f]),m=L0/_;for(let f of[l,...u])for(let d=0;d<f.length;d++){let h=f[d],p=f[(d+1)%f.length],b=p.x-h.x,y=p.y-h.y,M=Math.hypot(b,y);if(M*_<.05)continue;let S=(h.x+p.x)/2,A=(h.y+p.y)/2,x=y/M,g=-b/M;Ge({x:S+x*m,y:A+g*m},l,u)&&(x=-x,g=-g);let w=r.x-S,v=r.y-A,P=Math.hypot(w,v)||1;if((x*w+g*v)/P>D0)continue;let R=1/0;for(let O of[.2,.5,.8]){let H=B0(s,c,h.x+b*O-x*m*2,h.y+y*O-g*m*2);Number.isFinite(H)&&(R=Math.min(R,H))}if(!Number.isFinite(R)||R-i<F0)continue;let k=i-O0,F=R-k0,E={x:(h.x-x*m)*_,z:(h.y-g*m)*_},I={x:(p.x-x*m)*_,z:(p.y-g*m)*_},C=[x,0,g],L=le(a,ae.wallBottom),N=le(a,ae.top);e.tri([E.x,F,E.z],[I.x,F,I.z],[I.x,k,I.z],C,N,N,L),e.tri([E.x,F,E.z],[I.x,k,I.z],[E.x,k,E.z],C,N,L,L)}}function uu(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(M=>M.type==="shape"&&(M.role==="entrance"||M.role==="exit")),m=Wc(o,s.tierTop);if(!r)return;let f=M=>r.deckAt(M.x,M.y),d=sl(t,a),h=d[0]??t.outline;if(r.rowLevels.length>=2){let M=tr(r.rowLevels),S=cl(nl(r.rowLevels,n.focal,M),d),A=su(ea(r.rowLevels,n.focal,l),n.focal,qi);for(let g of S){let w=Math.max(l,g.topY-mu);for(let v of i.subtract(g.outline,w))eu(e,v,g.holes,w,l,s.tierTop,s.tierWall,u,!c,A);e.setMaterial(5),lu(e,g.outline,g.holes,r.rowLevels,n.focal,w,s.tierWall),e.setMaterial(0)}S.length||ue(e,h,t.holes,()=>r.landingY,l,m,s.tierWall,ae);let x={tread:[m[0]*ae.top,m[1]*ae.top,m[2]*ae.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let g of d.length?d:[h])rl(e,r.rowLevels,n.focal,r.landingY,x,g,M);au(e,r.rowLevels,n.focal,l),cu(e,r.rowLevels,t.outline,n.focal,M);return}let p=r.flat?1/0:yl,b=M=>r.normalAt(M.x,M.y),y=r.flat?r.landingY:void 0;for(let M of i.subtract(h,y))ue(e,M,t.holes,f,l,m,s.tierWall,ae,p,b)}function V0(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,f=u.get(m);f||(f={pts:[],levelM:0,n:0},u.set(m,f)),f.pts.push({x:l.x,y:l.y}),f.levelM+=n.seatDeckY(a),f.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function G0(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var mu=.02;function H0(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-mu);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!Ge(c,s.outline,s.holes)&&G0(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var z0=3,U0=.4;function fu(e,t,n,o,r,i,a=!0){let s=V0(t,n,o);if(s.length<z0)return;let c=Ql(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,f)=>m+f.binCount,0)))/c.binCount;e.setMaterial(5),nu(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:le(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??le(r.tierWall,1.15),shellWall:i??r.tierWall},ao:ae,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=U0,standTopNear:H0(t,o)}),e.setMaterial(0)}var du=4;var j0=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],W0=1.2,X0=12;function hu(e){if(e.heightM!==void 0)return!1;let t=xe(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*fe<X0*2?!1:2*po(t)/n*fe<=W0}function na(e){if(!e)return null;for(let[t,n]of j0)if(t.test(e))return n;return null}var bu="auto-rows-";function yu(e){return e.id.startsWith(bu)&&!e.label}var Y0=1.15,K0=.09,gu=6,$0=34,Z0=.35,q0=6,Q0=.35,J0=.75,ey=12,ty=2.5,ny=40,oy=[18,24],ry=[12,16],pu=14,iy=.8,ay=.6,sy=5,cy=.3,xu=.4,Mu=2,ly=400,uy=2.6,my=.8,fy=4,dy=26,hy=.7,py=.5,by=.985,yy=1.5,gy=2.2,xy=3,My=25,vy=.985,Sy=2,wy=6,Py=3,Ay=.1,Iy=1.5,Ry=1.6,Ey=6e3,Cy=.6,_y="#c3c7cd",oa=300,Ty=240;function Ly(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=ia([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<Ty)return null;let{h:a,s,l:c}=ms(ls(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&xe(u)?.some(m=>ca(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var ky="Estimated from the drawing; confirm with the venue.",aa=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},ia=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),po=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function Oy(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function sa(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function ca(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function la(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},f=Math.hypot(e.x-m.x,e.y-m.y);f<o&&(o=f,n=m)}return n}function vu(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=la(u,t),f=m.x-u.x,d=m.y-u.y,h=Math.hypot(f,d);h<1e-6||(o+=Math.abs((-c*f+s*d)/(l*h))*r.length,n+=r.length)}return n?o/n:0}function Fy(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=xe(r);return p?{shape:r,centre:ia(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=xe(p);if(!b)continue;let y=po(b);if(y*fe*fe<6||y>l)continue;let M=Math.min(...b.map(P=>P.x)),S=Math.max(...b.map(P=>P.x)),A=Math.min(...b.map(P=>P.y)),x=Math.max(...b.map(P=>P.y)),g=0;for(let P of n)P.x>M&&P.x<S&&P.y>A&&P.y<x&&ca(P,b)&&g++;if(g>n.length*.05)continue;let w=ia(b),v=vu(t,b);v>=iy&&u.push({shape:p,centre:w,outline:b,score:v,area:y,box:[M,A,S,x]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,f=u.filter(p=>!u.some(b=>m(p,b))),d=Math.max(0,...f.map(p=>p.score)),h=f.filter(p=>p.score>=d-.03).sort((p,b)=>b.area-p.area)[0]??null;return h?{shape:h.shape,centre:h.centre,outline:h.outline,inferred:!0}:null}function Dy(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=la(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function Su(e){return e.length<3?[...e].sort((t,n)=>t.x-n.x||t.y-n.y):wn(e)}function Ny(e){if(!e.length||e.length>Ey)return[];let t=[...sa(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=Ry/fe,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(f=>t[c].some(d=>Math.hypot(f.x-d.x,f.y-d.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function By(e,t,n){if(!t.length)return null;let o=t.filter(v=>n.tableIds.has(v.rowId)||v.kind==="booth").length>t.length/2,r=sa(t),i=!n.outline||vu(r,n.outline)>=ay,a=0,s=0;for(let v of r.values()){if(v.length<2)continue;let P=v[0],R=v[v.length-1],k=R.x-P.x,F=R.y-P.y,E=Math.hypot(k,F);if(E<1e-6)continue;let I={x:(P.x+R.x)/2,y:(P.y+R.y)/2},C=i?n.outline?la(I,n.outline):n.focal:n.middle,L=-F/E,N=k/E;L*(C.x-I.x)+N*(C.y-I.y)<0&&(L=-L,N=-N),a+=L*v.length,s+=N*v.length}let c={x:t.reduce((v,P)=>v+P.x,0)/t.length,y:t.reduce((v,P)=>v+P.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let v=i?n.focal:n.middle;a=v.x-c.x,s=v.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=v=>-(v.x*u.x+v.y*u.y),f=v=>-v.x*u.y+v.y*u.x,d=1/0,h=-1/0,p=1/0,b=-1/0,y=1/0,M=new Map;for(let v of t){let P=m(v),R=f(v);d=Math.min(d,P),h=Math.max(h,P),p=Math.min(p,R),b=Math.max(b,R),i&&(y=Math.min(y,Dy(v,n.focal,n.outline)));let k=v.logicalRowId??v.rowId,F=M.get(k);F?F.push(P):M.set(k,[P])}i||(y=Math.max(0,d-m(n.middle)));let S=[...M.values()].map(v=>aa(v)).sort((v,P)=>v-P),A=[];if(!o)for(let v of S)A.length&&v-A[A.length-1]<Q0/fe||A.push(v);let x=Oy(e),g=Ct(e,{floorBaseHeightM:n.baseHeightM}),w={id:e.id,section:e,authored:x,plane:n,facing:u,facesAction:i,hull:Su(t),sample:t.filter((v,P)=>P%Math.ceil(t.length/ly)===0),frontD:d,backD:h,latMin:p,latMax:b,frontDistance:y,rowDepths:A,rowCount:A.length,level:0,height:g.height,rake:x?g.rake:0,backHeight:0};return w.backHeight=w.height+(h-d)*fe*Math.tan(w.rake*Math.PI/180),w}function Vy(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*fe),i=n+Y0-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(J0,(e[l]-e[l-1])*fe),m=(i+K0)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(gu,Math.min($0,c))*10)/10}function Gy(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<cy)return null;let o=-1/0,r=1/0,i=-1/0;for(let f of t.hull){o=Math.max(o,-(f.x*e.facing.x+f.y*e.facing.y));let d=-f.x*e.facing.y+f.y*e.facing.x;r=Math.min(r,d),i=Math.max(i,d)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:xu*(e.latMax-e.latMin)))return null;let s=Mu/fe,c=new Map,l=new Map;for(let f of e.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);c.set(d,Math.min(c.get(d)??1/0,h))}for(let f of t.sample){let d=Math.floor((-f.x*e.facing.y+f.y*e.facing.x)/s),h=-(f.x*e.facing.x+f.y*e.facing.y);l.set(d,Math.max(l.get(d)??-1/0,h))}let u=[];for(let[f,d]of c){let h=l.get(f);h!==void 0&&u.push(d-h)}let m=u.length?aa(u):e.frontD-o;return m<-1/fe?null:m}function Hy(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>xu*(e.latMax-e.latMin)&&s>1/fe}function zy(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function Uy(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*fe*Math.tan(t.rake*Math.PI/180)}function jy(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=Mu/fe,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=by))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let f=Math.min(r-1,Math.floor((l-e.frontD)/o)),d=m==="left"?e.latMin-u:u-e.latMax;d<(i[m].get(f)?.gap??1/0)&&i[m].set(f,{gap:d,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<hy)continue;let d=e.frontD+(u+.5)*o,h={x:-d*e.facing.x+c*n.x,y:-d*e.facing.y+c*n.y},p=-(h.x*m.facing.x+h.y*m.facing.y),b=-h.x*m.facing.y+h.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=py};return a("left")&&a("right")}function Wy(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<vy)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*fe;if(i<-Sy||i>wy)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*fe<=Py&&a*fe>=-Ay}function Xy(e,t=!1,n=!1,o){let r=t?ry:oy,i=new Set(n?[]:e.filter(p=>!p.authored&&jy(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,y)=>{let M=new Map,S=[],A=new Map,x=g=>{if(g.plane.floorIndex===0||g.plane.baseHeightM>0)return g.plane.baseHeightM;let w=A.get(g.plane.floorIndex-1);return w===void 0?g.plane.baseHeightM:w+du};for(let g of a){if(i.has(g))g.height=x(g),g.level=0,g.rake=0,g.backHeight=g.height,M.set(g.id,void 0);else if(!g.authored){let v=x(g),P;for(let I of S){if(I.plane.floorIndex>g.plane.floorIndex)continue;if(Hy(g,I)){let O=Uy(g,I)+uy;O>v&&(v=O,P=I);continue}let C=Gy(g,I,i.has(I));if(C==null)continue;let L=n&&!!g.plane.stageDeck&&I.level===0&&I.plane.floorIndex===g.plane.floorIndex&&Math.max(0,C)*fe<=fy,N=i.has(I)?I.height+yy:L?I.backHeight:I.backHeight+Z0+Math.min(q0,Math.max(0,C)*fe)*Math.tan(I.rake*Math.PI/180);N>v&&(v=N,P=I)}let R=p.get(g);R&&R.height>v+.01?(v=R.height,P=void 0):R=void 0,g.height=Math.round(Math.min(v,g.plane.baseHeightM+ny)*100)/100;let k=!P&&!R&&g.height>g.plane.baseHeightM;if(g.level=P?P.level+1:R?R.level:k?1:0,g.rake=Vy(g.rowDepths,g.frontDistance,g.height,g.plane.focalHeightM),!g.facesAction&&g.rowCount<sy)g.rake=0;else if(g.level===0){let I=Math.max(1e-6,(g.backD-g.frontD)*fe);g.rake=Math.min(g.rake,ey,Math.round(Math.atan(ty/I)*1800/Math.PI)/10)}else g.rowCount>=2&&(g.rake=Math.max(g.rake,r[Math.min(g.level,r.length)-1]));let F=(g.backD-g.frontD)*fe,E=P&&i.has(P)||R&&y?.has(R.id);if(b!==void 0&&E&&g.rowCount>=2&&(g.rake=b),t&&F>0&&g.height+F*Math.tan(g.rake*Math.PI/180)>g.plane.baseHeightM+pu){let I=Math.max(0,g.plane.baseHeightM+pu-g.height);g.rake=Math.max(gu,Math.round(Math.atan(I/F)*1800/Math.PI)/10)}n&&g.plane.stageDeck&&g.level>0&&(g.rake=Math.min(g.rake,dy)),g.backHeight=g.height+F*Math.tan(g.rake*Math.PI/180),M.set(g.id,P?.id??(R?M.get(R.id):void 0))}let w=g.plane.floorIndex;A.set(w,Math.min(A.get(w)??1/0,g.height)),S.push(g)}return M},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let y of e)if(!(y.authored||i.has(y)))for(let M of e){let S=l.get(M)??M;M===y||S.height-S.plane.baseHeightM<Iy||S.height<=u(y)+.01||Wy(y,M)&&(l.set(y,S),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),f=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),d=f.length?aa(f.map(p=>p.rake)):void 0;if(!l.size&&d===void 0)return c;let h=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,h.get(b)])),d,new Set(f.map(p=>p.id)))}var ra=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function xr(e,t={x:0,y:-40}){let n=yn(e),o=new Map;for(let y of n){if(!y.sectionId)continue;let M=o.get(y.sectionId);M?M.push(y):o.set(y.sectionId,[y])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((y,M)=>({objects:y.objects,floorIndex:M,floorId:y.id,baseHeightM:y.baseHeightM??0,focal:y.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(y=>y.objects.filter(M=>M.type==="table").map(M=>M.id))),s=[],c,l=new Set,u=i.map(y=>{let M=E=>!e.floors?.length||E.floorId===y.floorId,S=Ny(n.filter(E=>!E.sectionId&&E.kind!=="booth"&&!a.has(E.rowId)&&M(E))),A=[];for(let E of S){let I=at(pt(Su(E)),Cy/fe);if(n.some(L=>!M(L)&&ca(L,I)))continue;let C=`${bu}${y.floorIndex}-${A.length}`;l.add(C),o.set(C,E),A.push({type:"section",id:C,label:"",color:_y,outline:I})}let x=A.length?{...y,objects:[...y.objects,...A]}:y,g=new Set(x.objects.filter(E=>E.type==="section").map(E=>E.logicalSectionId??E.id)),w=[...o.entries()].filter(([E])=>g.has(E)).flatMap(([,E])=>E),v=Fy(x.objects,sa(w),w),P=x.focal;(v||x.focal&&!ra(x.focal,t))&&(r.confident=!0),v&&(r.stage??={id:v.shape.id,inferred:v.inferred,...x.floorId?{floorId:x.floorId}:{}},(v.inferred||ra(x.focal,t))&&(P=v.centre,r.focalInferred=!0));let R=v&&(!v.inferred||po(v.outline)*fe*fe<=oa),k=v?void 0:c,F={tableIds:a,floorIndex:x.floorIndex,floorId:x.floorId,baseHeightM:x.baseHeightM,focal:k?.focal??P,outline:v?.outline??k?.outline,focalHeightM:k?.focalHeightM??x.baseHeightM+(v&&R?ct({...v.shape,role:"stage"}).heightM:0),stageDeck:k?.stageDeck??!!(v&&R&&po(v.outline)*fe*fe<=oa),middle:w.length?{x:w.reduce((E,I)=>E+I.x,0)/w.length,y:w.reduce((E,I)=>E+I.y,0)/w.length}:P};for(let E of x.objects){if(E.type!=="section")continue;let I=By(E,o.get(E.logicalSectionId??E.id)??[],F);I&&s.push(I)}return F.outline&&(c=F),ra(x.focal,F.focal)||(r.focal??=[]).push({...x.floorId?{floorId:x.floorId}:{},point:{...F.focal}}),{unit:x,plane:F,stage:v,planeSeats:w}}),m=i.flatMap(y=>y.objects).map(y=>y.type==="shape"&&!y.role&&(na(y.label)==="wall"||!na(y.label)&&hu(y))?{...y,role:"wall"}:y),f=kt({objects:m},n)!==null;f&&(r.indoor=!0);let d=new Set,h=Xy(s,f,zy(n,u[0]?.plane.focal??t)<my,d),p=new Map(s.filter(y=>!y.authored).map(y=>[y.id,y])),b=u.map(({unit:y,plane:M,stage:S,planeSeats:A})=>y.objects.map(x=>{let g=x.type==="shape"&&!x.role&&x.id!==S?.shape.id?na(x.label):null;if(x.type==="shape"&&!x.role&&x.id!==S?.shape.id&&(g==="wall"||!g&&hu(x))&&x.type==="shape"){(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:"wall"});let{fill:I,...C}=x;return{...C,role:"wall"}}if(g&&x.type==="shape")return(r.roles??=[]).push({id:x.id,...M.floorId?{floorId:M.floorId}:{},role:g}),{...x,role:g};let v=S?.inferred&&x.id===S.shape.id&&x.type==="shape"?Ly(x,S.outline,y.objects,A):null;if(v&&x.type==="shape")return r.stage?.id===x.id&&(r.stage.field=v),{...x,role:"stage",stageKind:v};let P=x.type==="shape"&&x.id===S?.shape.id&&x.heightM===void 0&&!x.stageKind&&s.some(I=>I.plane===M&&(d.has(I.id)||I.level===0&&I.facesAction&&I.rake<=xy&&(I.frontDistance+I.backD-I.frontD)*fe>=My)),R=P?{heightM:gy}:{};if(S?.inferred&&x.id===S.shape.id&&x.type==="shape"&&po(S.outline)*fe*fe<=oa)return r.stage?.id===x.id&&(r.stage.deck=!0),{...x,role:"stage",...R};if(P&&x.type==="shape"&&x.role==="stage")return{...x,...R};let k=x.type==="section"?p.get(x.id):void 0;if(!k||x.type!=="section")return x;let F=k.rowCount>=2&&k.rake>0;l.has(k.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:k.id,floorId:M.floorId,surfaceKind:F?"rakedRows":"flat",height:k.height,rake:k.rake,stackedOn:h.get(k.id)});let E={status:"inferred",source:"public-2d-topology",note:ky};return{...x,height:k.height,rake:k.rake,surfaceKind:F?"rakedRows":"flat",physical3dProvenance:{height:E,rake:E,surfaceKind:E}}}));if(e.floors?.length){let y=e.floors.map((M,S)=>({...M,objects:b[S],focalPoint:u[S].plane.focal}));return{doc:{...e,floors:y,objects:y[0].objects,focalPoint:y[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var wu=/^[\p{L}\p{N}]{1,4}$/u,Yy=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function Pu(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if(wu.test(a))return a}let i=Yy.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&wu.test(s))return s}return e}var Au={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Ky=new Map(fi.map(e=>[e.key,e.label]));function $y(e){return`picker.access.${e}`}function Iu(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(Au,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:Au[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Ky.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:$y(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function Ru(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function Eu(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var Zy=1.15,qy=2.75,Qy=4.5,Jy=.85,eg=.5,tg=.26;function Cu(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=Zy&&a.add("zone"),r<=(i?qy:Qy)&&(a.add("section"),a.add("ga")),r<=Jy&&(a.add("annotation"),a.add("booth")),r<=eg&&a.add("row"),r<=tg&&a.add("seat"),a}function _u(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function gt(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let f=c/m,d=l/m,h=u/m,p=f>=-1.05&&f<=1.05&&d>=-1.05&&d<=1.05&&h<=1;return{x:(f*.5+.5)*n,y:(1-(d*.5+.5))*o,depth:h,visible:p}}function Tu(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(bo(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var ng=6;function bo(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+ng):n;return r<a&&i<o}function Lu(e,t,n){return e.length*t*.58+(n?14:0)}var og={row:8,seat:14};function ku(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:og}function Ou(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function yo(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(bo(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(bo(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function ua(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var rg=1.5,ig=30,ag=4,sg=3.6,cg=6,ma=15,lg=3,ug=1;function mg(e){return Math.max(sg,Math.min(cg,2.4+.15*e))}var go=Math.PI*2;function fg(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let f=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;f>Math.PI;)f-=go;for(;f<-Math.PI;)f+=go;return f+r}),a=i.map((m,f)=>f).sort((m,f)=>i[m]-i[f]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let f=e[m],d=(m+e.length-1)%e.length,h=(m+1)%e.length,p=Math.abs(i[d]-i[m])<=Math.abs(i[h]-i[m])?d:h,b=e[p];return l(f)<=l(b)?[f,b]:[b,f]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function Fu(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function fa(e,t,n=()=>!0){let o=[];for(let c of e){if(!Fu(c)||!n(c))continue;let l=xe(c);if(!l||l.length<3)continue;let u=fg(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=xe(c);if(!l?.length)return[];let u=0,m=0;for(let f of l)u+=f.x,m+=f.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%go+go)%go;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let f=g=>i(g-l.end)<m;if(o.some(g=>g!==l&&g!==u&&(f(g.start)||f(g.end)||i(l.end-g.start)<g.end-g.start)))continue;let[h,p]=l.endEdge,[b,y]=u.startEdge,M={x:(h.x+p.x)/2,y:(h.y+p.y)/2},S={x:(b.x+y.x)/2,y:(b.y+y.y)/2},A=Math.hypot(S.x-M.x,S.y-M.y)*_;if(A<rg||A>ig||Math.abs(a(M)-a(S))*_>ag+.2*A)continue;let x={x:(M.x+S.x)/2,y:(M.y+S.y)/2};r.some(g=>f(Math.atan2(g.y-t.y,g.x-t.x))&&Math.abs(a(g)-a(x))*_<=lg)||s.push({quad:[h,p,y,b],mid:x,widthM:A,openingM:mg(A)})}return s}function Du(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*_;s<=ma&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function Nu(e,t,n,o,r,i,a,s=()=>!0){let c=fa(t,In(n),s);if(!c.length)return;let l=t.find(m=>Fu(m)&&s(m)),u=fr(l?.fill,a);e.setMaterial(or);for(let m of c)r-m.openingM<ug||ir(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var dg=6,hg=2.2,Mr=.1,pg=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,bg=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),yg=.3,gg=1.8,xg=.9,Mg=.55,vg=1,Bu=4e3,Sg=6,Vu="#d8a425",wg="#e8c15a",da="#1c1608";function Gu(e){let t=Pg(e);if(!t)return null;let n=Iu(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function Pg(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:Vo(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:Vu,ink:da}:n?.restrictedView?{icon:"restrictedView",color:Vu,ink:da}:n?.premium?{icon:"premium",color:wg,ink:da}:null}function Ag(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var Ig=6e3,Rg=.25,Hu=[-90,90,-135,135,-45,45];function Eg(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),f=1/0;for(let d of c)f=Math.min(f,Math.hypot(t[d].x-l,t[d].y-u));return c.length&&f>=m*Rg?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,f=o.y-c,p=(Math.hypot(m,f)>1e-6?Math.atan2(f,m):0)+Hu[u%Hu.length]*Math.PI/180,b=Math.cos(p),y=Math.sin(p),M=-1,S=-1/0;for(let A of l){let x=(t[A].x-s)*b+(t[A].y-c)*y;x>S&&(S=x,M=A)}i.set(a,[t[M].x*_,n.seatDeckY(M),t[M].y*_])}),i}function Uu(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let f of n)for(let d of f.objects)d.type==="section"&&d.zone&&c.set(d.id,d.zone);let l=new Map,u=new Map;for(let f=0;f<o.length;f++){let d=o[f],h=r.seatOwner[f],p=d.zoneId??(h?c.get(h):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let y=u.get(p);y||u.set(p,y=[]),y.push(f),b.n++,d.x<b.minX&&(b.minX=d.x),d.y<b.minY&&(b.minY=d.y),d.x>b.maxX&&(b.maxX=d.x),d.y>b.maxY&&(b.maxY=d.y),b.sumY+=r.seatDeckY(f)}let m=Eg(a.flatMap(f=>{let d=l.get(f.id);return d?[{id:f.id,a:d,members:u.get(f.id)??[]}]:[]}),o,r,i);for(let f of a){let d=l.get(f.id),h=[];for(let[p,b]of c)b===f.id&&h.push(p);if(!d||d.n===0){s.push({id:f.id,label:f.label,color:ye(f.color),sectionIds:h,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(f.focalPoint??i).x*_,1.5,(f.focalPoint??i).y*_]});continue}s.push({id:f.id,label:f.label,color:ye(f.color),sectionIds:h,seatCount:d.n,...m.has(f.id)?{labelAt:m.get(f.id)}:{},center:[(d.minX+d.maxX)/2*_,d.sumY/d.n,(d.minY+d.maxY)/2*_],radius:.5*Math.hypot((d.maxX-d.minX)*_,(d.maxY-d.minY)*_)||1,focalWorld:[(f.focalPoint??i).x*_,1.5,(f.focalPoint??i).y*_]})}}return s}function ju(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],f=new Map;for(let d of n)for(let h of d.objects){if(h.type!=="section"||!h.zone)continue;let p=(h.displayLabel||h.label||"").trim().toLocaleLowerCase();if(!p)continue;let b=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&b===p)continue;let y=f.get(h.zone);y||f.set(h.zone,y=new Set),y.add(p)}for(let d of s)d.seatCount!==0&&(f.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+dg,(d.labelAt??d.center)[2]],color:t.zones?.find(h=>h.id===d.id)?.color}));{let d=new Map,h=new Map,p=new Map,b=new Map;for(let y=0;y<o.length;y++){let M=r.seatOwner[y];if(!M)continue;let S=d.get(M);S||(S={n:0,x:0,y:0,deck:0},d.set(M,S)),S.n++,S.x+=o[y].x,S.y+=o[y].y,S.deck+=r.seatDeckY(y);let A=o[y].categoryKey;if(A){let g=h.get(M);g||(g=new Map,h.set(M,g)),g.set(A,(g.get(A)??0)+1)}if(o[y].accessibility?.includes("wheelchair")){let g=p.get(M);g?g.push(y):p.set(M,[y])}let x=b.get(M);x||(x={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},b.set(M,x)),x.minDeck=Math.min(x.minDeck,r.seatDeckY(y)),x.maxDeck=Math.max(x.maxDeck,r.seatDeckY(y)),o[y].x<x.minX&&(x.minX=o[y].x),o[y].x>x.maxX&&(x.maxX=o[y].x),o[y].y<x.minY&&(x.minY=o[y].y),o[y].y>x.maxY&&(x.maxY=o[y].y)}for(let y of n)for(let M of y.objects){if(M.type!=="section"||yu(M))continue;let S=d.get(M.id);if(!S||S.n===0)continue;let A=b.get(M.id),x=[S.x/S.n*_,S.deck/S.n,S.y/S.n*_],g=M.displayLabel||M.label||M.id;u.push({id:M.id,floorIndex:y.index,label:g,seatCount:S.n,center:x,radius:Math.max(1,Math.hypot(A.maxX-A.minX,A.maxY-A.minY)*.5*_),box:{min:[A.minX*_-.4,A.minDeck,A.minY*_-.4],max:[A.maxX*_+.4,A.maxDeck+1,A.maxY*_+.4]},focalWorld:[y.focal.x*_,y.baseHeightM+1.5,y.focal.y*_]});let w=t.floors?.[y.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&w===g.trim().toLocaleLowerCase())){let v=Ag(h.get(M.id),t),P=p.get(M.id);l.push({id:`section:${M.id}`,kind:"section",text:g,anchor:[x[0],x[1]+hg,x[2]],floorIndex:y.index,...v?{tint:v}:{},...P?{wheelchairSeats:P}:{}})}}}{for(let x of n)for(let g of x.objects){if(g.type!=="gaArea")continue;let w=fn(g.points);if(!w)continue;let v=g.labelPresentation?.visible===!1?"":g.displayLabel||g.label||g.id,P=g.capacity>0?[v,g.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):v;P&&l.push({id:`ga:${g.id}`,kind:"ga",text:P,anchor:[w.x*_,x.baseHeightM+gg,w.y*_],floorIndex:x.index})}let d=new Map,h=new Map;for(let x of n)for(let g of x.objects)if(g.type==="section"&&d.set(g.id,g.displayLabel||g.label||g.id),g.type==="row"){let w=g.displayLabel?.trim()||g.segmentedRow?.displayLabel?.trim();w&&h.set(g.id,w)}let p=new Map;for(let x=0;x<o.length;x++){let g=o[x],w=Math.hypot(g.x-c.x,g.y-c.y),v=p.get(g.rowId);(!v||w>v.far)&&p.set(g.rowId,{seat:g,index:x,far:w})}for(let[x,g]of p){let w=r.seatOwner[g.index]??g.seat.sectionId,v=zu(g.seat.label,x,d.get(w??""),h.get(x));v&&l.push({id:`row:${x}`,kind:"row",text:v,anchor:[g.seat.x*_,r.seatDeckY(g.index)+xg,g.seat.y*_],floorIndex:a[g.index]})}let b=new Map;for(let x=0;x<o.length;x++){let g=o[x],w=b.get(g.rowId);w||(w={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:zu(g.label,g.rowId,d.get(r.seatOwner[x]??g.sectionId??""),h.get(g.rowId)),sectionId:r.seatOwner[x]??g.sectionId},b.set(g.rowId,w));let v=x*3,P=i.iPosition[v],R=i.iPosition[v+1],k=i.iPosition[v+2];w.n++,w.x+=P,w.y+=R,w.z+=k,w.minX=Math.min(w.minX,P),w.maxX=Math.max(w.maxX,P),w.minZ=Math.min(w.minZ,k),w.maxZ=Math.max(w.maxZ,k)}for(let[x,g]of b)m.push({id:x,label:g.label,sectionId:g.sectionId,seatCount:g.n,center:[g.x/g.n,g.y/g.n,g.z/g.n],radius:Math.max(.8,Math.hypot(g.maxX-g.minX,g.maxZ-g.minZ)*.5)});let y=0,M=(x,g)=>{y++,l.push({id:`access:${o[x].id}`,kind:"access",text:g.name,icon:g.icon,color:g.color,...g.ink?{ink:g.ink}:{},seatWidthM:i.iChairWidth[x]*2,anchor:[o[x].x*_,r.seatDeckY(x)+vg,o[x].y*_],floorIndex:a[x],rowId:o[x].rowId})},S=null,A=()=>{if(S){let x=Gu(o[S.seats[0]]),g=S.seats.length,w=Math.max(1,Math.round(g/Sg));for(let v=0;v<w&&y<Bu;v++)M(S.seats[Math.min(g-1,Math.floor((v+.5)*g/w))],x)}S=null};for(let x=0;x<o.length&&y<Bu;x++){let g=Gu(o[x]);if(g&&o[x].accessibility?.length){A(),M(x,g);continue}if(!g){A();continue}S&&S.rowId===o[x].rowId&&S.icon===g.icon?S.seats.push(x):(A(),S={rowId:o[x].rowId,icon:g.icon,seats:[x]})}if(A(),o.length<=Ig)for(let x=0;x<o.length;x++){let g=o[x],w=ha(g.displayLabel||g.label);w&&l.push({id:`seat:${g.id}`,kind:"seat",seatWidthM:i.iChairWidth[x]*2,text:w,anchor:[g.x*_,r.seatDeckY(x)+Mg,g.y*_],floorIndex:a[x],rowId:g.rowId})}}for(let d of n){let h=kt(d,n.length===1?o:o.filter((y,M)=>a[M]===d.index)),p=h?Du(fa(d.objects,In(h)),d.objects.filter(y=>y.type==="text")):new Map,b=[...p.values()];for(let y of d.objects){let M=y.type==="text"?p.get(y.id):void 0;if(y.type==="shape"&&(y.role==="entrance"||y.role==="exit")&&pg.test(y.label?.trim()??"")){let S=xe(y),A=S?fn(S):null;if(A&&b.some(x=>Math.hypot(A.x-x.mid.x,A.y-x.mid.y)*_<=ma+x.widthM))continue}if(M&&y.type==="text")l.push({id:`text:${y.id}`,kind:"gate",text:y.text,icon:"entrance",anchor:[M.mid.x*_,d.baseHeightM+M.openingM+Mr,M.mid.y*_],color:y.color,floorIndex:d.index});else if(y.type==="shape"&&y.role&&bg.has(y.role)){let S=xe(y),A=S?fn(S):null;if(!A||!y.label||y.gate?.hideFromBuyers)continue;l.push({id:`architecture:${y.id}`,kind:y.role==="stage"?"stage":y.role==="entrance"||y.role==="exit"?"gate":"annotation",text:y.label,...y.role==="entrance"||y.role==="exit"?{icon:y.role}:{},...y.gate?.stepFree?{stepFree:!0}:{},anchor:[A.x*_,d.baseHeightM+ct(y).heightM+Mr,A.y*_],color:y.fill,floorIndex:d.index})}else if(y.type==="text"){let S=y.semanticKind==="icon"?so(y.iconKey)?.key:void 0,A=y.text||(S?so(S).label:"");if(!A)continue;l.push({id:`text:${y.id}`,kind:"annotation",text:A,...S?{venueIcon:S}:{},anchor:S?[(y.position.x+y.fontSize/2)*_,d.baseHeightM+Mr,(y.position.y+y.fontSize/2)*_]:[y.position.x*_,d.baseHeightM+Mr,y.position.y*_],color:y.color,rotation:y.rotation,floorIndex:d.index})}else if(y.type==="booth"){if(y.labelPresentation?.visible===!1)continue;let S=lt(y);if(!S)continue;let A=fn(S);if(!A)continue;l.push({id:`booth:${y.id}`,kind:"booth",text:y.displayLabel||y.label||y.id,anchor:[A.x*_,d.baseHeightM+dr+yg,A.y*_],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function Wu(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 ha(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function zu(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&Pu(i,n)}function Xu(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let f=0;f<i.floor.length;f+=1){let d=Math.max(0,Math.min(n.length-1,Math.round(i.floor[f]))),h=f*3,p=l[d];p.minX=Math.min(p.minX,i.position[h]),p.minY=Math.min(p.minY,i.position[h+1]),p.minZ=Math.min(p.minZ,i.position[h+2]),p.maxX=Math.max(p.maxX,i.position[h]),p.maxY=Math.max(p.maxY,i.position[h+1]),p.maxZ=Math.max(p.maxZ,i.position[h+2])}let u=new Map;for(let f=0;f<n.length;f++)for(let d of n[f].objects)d.type==="section"&&u.set(d.id,f);let m=n.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let f=0;f<o.length;f++){let d=r.seatOwner[f],h=(d!==null?u.get(d):void 0)??a[f];if(h===void 0)continue;let p=m[h],b=o[f];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let y=r.seatDeckY(f);p.sumX+=b.x*_,p.sumDeck+=y,p.sumZ+=b.y*_,p.minDeck=Math.min(p.minDeck,y),p.maxDeck=Math.max(p.maxDeck,y+1.6),s[f]=h}for(let f=0;f<n.length;f++){let d=m[f],h=t.floors?.[f],p=l[f],b=Math.min(d.n?d.minX*_:n[f].focal.x*_-1,Number.isFinite(p.minX)?p.minX:1/0),y=Math.max(d.n?d.maxX*_:n[f].focal.x*_+1,Number.isFinite(p.maxX)?p.maxX:-1/0),M=Math.min(d.n?d.minY*_:n[f].focal.y*_-1,Number.isFinite(p.minZ)?p.minZ:1/0),S=Math.max(d.n?d.maxY*_:n[f].focal.y*_+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),A=Math.min(d.n?Math.min(n[f].baseHeightM,d.minDeck):n[f].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),x=Math.max(d.n?Math.max(d.maxDeck,A+.5):A+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),g=[d.n?d.sumX/d.n:(b+y)/2,d.n?d.sumDeck/d.n:(A+x)/2,d.n?d.sumZ/d.n:(M+S)/2],w=Math.max(1,.5*Math.hypot(y-b,x-A,S-M));c.push({index:f,id:h?.id??`floor-${f}`,label:h?.name??(n.length>1?`Floor ${f+1}`:"Venue"),seatCount:d.n,center:g,radius:w,box:{min:[b,A,M],max:[y,x,S]},focalWorld:[n[f].focal.x*_,n[f].baseHeightM+1.5,n[f].focal.y*_]})}}return c}function pa(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=lt(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=hr(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=pr(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Qu(e,t,n,o,r,i,a){if(t.length===1){let s=n.map(f=>({x:f.x,y:f.y}));for(let f of t[0].objects)f.type==="section"?s.push(...f.outline):f.type==="shape"?s.push(...xe(f)??f.points??[]):f.type==="gaArea"?s.push(...f.points):f.type==="booth"?s.push(...lt(f)??[]):f.type==="table"?s.push(...hr(f)??[]):f.type==="decorImage"&&s.push(...pr(f)??[]);if($u(e,t[0],n,i)||qu(e,t[0],n,s,i))return!1;if(a&&Ku(e,t[0].baseHeightM,s,i,a))return!0;let c=co(s),l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2,m=c.length>=3?c.map(f=>{let d=f.x-l,h=f.y-u,p=Math.max(1,Math.hypot(d,h));return{x:f.x+d/p*80,y:f.y+h/p*80}}):Jn(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ue(e,m,void 0,()=>-.04,-.22,i.ground,i.ground,ae),!1}else{let s=t.reduce((b,y)=>y.baseHeightM<b.baseHeightM?y:b);e.setFloor(s.index);let c={...s,objects:t.flatMap(b=>b.objects)},l=n.map(b=>({x:b.x,y:b.y}));for(let b of c.objects)b.type==="section"&&l.push(...b.outline);if($u(e,c,n,i)||qu(e,c,n,l,i))return!1;if(a&&Ku(e,s.baseHeightM,l,i,a))return!0;let u=n.filter((b,y)=>o[y]===s.index),m=pa([s],u),f=Math.hypot(m.maxX-m.minX,m.maxY-m.minY),d=Math.max(28,Math.min(80,f*.04)),h=Jn(m.minX-d,m.minY-d,m.maxX-m.minX+d*2,m.maxY-m.minY+d*2),p=s.baseHeightM-.03;return ue(e,h,void 0,()=>p,p-.22,i.ground,i.ground,ae),!1}}function ba(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,f=-1/0,d=(b,y,M)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,y),m=Math.max(m,y),l=Math.min(l,M),f=Math.max(f,M)};for(let b=0;b<e.position.length;b+=3){let y=b/3;o&&y>=o[0]&&y<o[1]||d(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let y=b*3,M=t.iPosition[y],S=t.iPosition[y+1],A=t.iPosition[y+2],x=Math.max(.35,t.iMaxRadius[b]??.35);d(M-x,S,A-x),d(M+x,S+1.6,A+x)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,f=i+a);let h=[(s+u)/2,(c+m)/2,(l+f)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,f-l));return{center:h,radius:p,minY:c,maxY:m}}var Cg=4096;function Ju(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/Cg)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function em(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let x=0;x<e.count;x++){let g=x*3,w=e.iPosition[g],v=e.iPosition[g+2];w<s&&(s=w),w>l&&(l=w),v<c&&(c=v),v>u&&(u=v)}for(let[x,,g]of a)x<s&&(s=x),x>l&&(l=x),g<c&&(c=g),g>u&&(u=g);for(let x of t)s=Math.min(s,x.cx-x.halfX),l=Math.max(l,x.cx+x.halfX),c=Math.min(c,x.cz-x.halfZ),u=Math.max(u,x.cz+x.halfZ);let m=n.minX*_,f=n.maxX*_,d=n.minY*_,h=n.maxY*_,p=m,b=f,y=d,M=h;if(Number.isFinite(s)){let x=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-x),b=Math.min(f,l+x),y=Math.max(d,c-x),M=Math.min(h,u+x)}let S=Math.min(0,o),A=Math.max(r,i*.05);return{min:[p,S,y],max:[b,A,M]}}var Yu=12,_g=.6,Tg=40;function Ku(e,t,n,o,r){let i=co([...n]);if(i.length<3)return!1;let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let A of i)a=Math.min(a,A.x),c=Math.max(c,A.x),s=Math.min(s,A.y),l=Math.max(l,A.y);let u=Math.hypot(c-a,l-s)*_,m=at(i,Yu/_,1.2),f=Math.max(Tg,u*_g),d=at(i,(Yu+f)/_,1.2);if(m.length!==d.length)return!1;let h=ge(o.ground,[.78,.76,.72],.35),p=ge(o.ground,[.56,.62,.52],.3);ue(e,m,void 0,()=>t-.04,t-.22,h,h,ae);let b=t-.05,y=m.map(A=>[A.x*_,b,A.y*_]),M=d.map(A=>[A.x*_,b,A.y*_]),S=[0,1,0];for(let A=0;A<y.length;A++){let x=(A+1)%y.length;e.tri(y[A],M[x],M[A],S,p,r,r),e.tri(y[A],y[x],M[x],S,p,p,r)}return!0}function $u(e,t,n,o){let r=kt(t,n);if(!r)return!1;let i=t.baseHeightM,a=ge(o.ground,[.62,.55,.47],.4);return ue(e,r,void 0,()=>i-.04,i-.22,a,a,ae),!0}var Lg=3e3,kg=20,Zu=1.5,Og=1.2,Fg=.25;function qu(e,t,n,o,r){if(!n.length||n.length>Lg||o.length<3)return!1;for(let P of t.objects){if(P.type==="shape"&&jo(P.stageKind))return!1;if(P.type==="section"){let{height:R}=Ct(P,{floorBaseHeightM:t.baseHeightM});if(R-t.baseHeightM>kg)return!1}}let i=0,a=0;for(let P of o)i+=P.x,a+=P.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let P of o){let R=P.x-i,k=P.y-a;s+=R*R,c+=k*k,l+=R*k}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),f=Math.sin(u),d=-f,h=m,p=1/0,b=-1/0,y=1/0,M=-1/0;for(let P of o){let R=(P.x-i)*m+(P.y-a)*f,k=(P.x-i)*d+(P.y-a)*h;p=Math.min(p,R),b=Math.max(b,R),y=Math.min(y,k),M=Math.max(M,k)}let S=P=>[[p-P,y-P],[b+P,y-P],[b+P,M+P],[p-P,M+P]].map(([R,k])=>({x:i+m*R+d*k,y:a+f*R+h*k})),A=S(Zu/_),x=S((Zu+Fg)/_),g=t.baseHeightM,w=ge(r.ground,[.62,.55,.47],.4),v=ge(r.ground,[.86,.86,.84],.55);return ue(e,x,void 0,()=>g-.04,g-.22,w,w,ae),ue(e,x,[A.slice().reverse()],()=>g+Og,g-.04,ge(v,[1,1,1],.2),v,ae),!0}function tm(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=bc(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let f of m.objects)f.type==="shape"&&i.set(f.id,{shape:f,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let f=m.runtimeContentImageUrl;return[m.id,typeof f=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(f)?f:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let f=i.get(m.objectId),d=f?xe(f.shape):null,h=m.baseElevationM??0;if(!f||!d||d.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(h)||h<-10||h>100)return o();a.add(m.id),s.add(m.objectId);let p=d.map(v=>v.x*_),b=d.map(v=>v.y*_),y=f.unit.baseHeightM+h,M=Math.min(...p),S=Math.max(...p),A=Math.min(...b),x=Math.max(...b),g,w=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&w&&(g=xl(d,y,y+m.heightM,f.unit.focal),!g))if(S-M>=x-A){let v=Math.abs(A-f.unit.focal.y*_)<=Math.abs(x-f.unit.focal.y*_)?A-.006:x+.006;g=[[M,y,v],[S,y,v],[M,y+m.heightM,v],[S,y+m.heightM,v]]}else{let v=Math.abs(M-f.unit.focal.x*_)<=Math.abs(S-f.unit.focal.x*_)?M-.006:S+.006;g=[[v,y,A],[v,y,x],[v,y+m.heightM,A],[v,y+m.heightM,x]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:f.unit.index,baseY:y,topY:y+m.heightM,bounds:{min:[M,y,A],max:[S,y+m.heightM,x]},occlusion:m.occlusion,...w?{contentImageUrl:w}:{},...g?{contentPlane:g}:{}})}let u=l.sort((m,f)=>m.id.localeCompare(f.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}var nm=[.13,.14,.17],Tn=[.4,.43,.47],Dg=.18,Ng=.02,Bg=2.4,Vg=1500,Gg=240,Hg=.25;function om(e,t,n,o){let r=t.stageKind??"";if(Zt(r)||r==="round"||!o.length)return;let i=xe(t);if(!i||i.length<3)return;let a={x:i.reduce((L,N)=>L+N.x,0)/i.length,y:i.reduce((L,N)=>L+N.y,0)/i.length},s=0,c=0,l=new Set;for(let L of o)s+=L.x,c+=L.y,l.add(Math.floor(Math.atan2(L.y-a.y,L.x-a.x)*180/Math.PI/10));let u=a.x-s/o.length,m=a.y-c/o.length,f=Math.hypot(u,m);if(f<1e-6)return;let d=o.reduce((L,N)=>L+Math.hypot(N.x-a.x,N.y-a.y),0)/o.length;if(l.size*10>Gg&&f<Hg*d)return;let h=u/f,p=m/f,b=-p,y=h,M=-1/0,S=1/0,A=1/0,x=-1/0;for(let L of i){let N=(L.x-a.x)*h+(L.y-a.y)*p,O=(L.x-a.x)*b+(L.y-a.y)*y;M=Math.max(M,N),S=Math.min(S,N),A=Math.min(A,O),x=Math.max(x,O)}let g=(x-A)*_,w=(M-S)*_;if(g<3||w<1.5||g*w>Vg)return;let v=Dg/_,P=(L,N)=>({x:a.x+h*L+b*N,y:a.y+p*L+y*N}),R=(L,N,O,H)=>[P(L,O),P(L,H),P(N,H),P(N,O)],k=n+Math.max(3.5,Math.min(8,g*.35)),F=n+Math.min(Bg,k-n-1),E=.2/_,I=S+Math.min(w*.25,1.5)/_,C=Ng/_;ue(e,R(M-2*v+C,M-v-C,A+v+E,x-v-E),void 0,()=>F,n,nm,nm,ae);for(let[L,N]of[[A+v,A+v+E],[x-v-E,x-v]])ue(e,R(M-2*v,M-v,L,N),void 0,()=>k+.3,n,Tn,Tn,ae),ue(e,R(I+E,M-2*v,L,N),void 0,()=>k+.3,k,Tn,Tn,ae);ue(e,R(I,I+E,A+v,x-v),void 0,()=>k+.3,k,Tn,Tn,ae)}function Je(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Qe(e){return Array.isArray(e)?e:[]}function zg(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!Je(n))continue;let o=Je(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function vr(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function Ug(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function jg(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function Wg(e){let t=vr(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:vr(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:vr(e.rotation,4),r=e.scale===void 0?[1,1,1]:vr(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,f=s/l,d=c/l,h=u+u,p=m+m,b=f+f,y=u*h,M=u*p,S=u*b,A=m*p,x=m*b,g=f*b,w=d*h,v=d*p,P=d*b;return[(1-(A+g))*r[0],(M+P)*r[0],(S-v)*r[0],0,(M-P)*r[1],(1-(y+g))*r[1],(x+w)*r[1],0,(S+v)*r[2],(x-w)*r[2],(1-(y+A))*r[2],0,n[0],n[1],n[2],1]}function Xg(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function Yg(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,f=r*c-i*s,d=t*u+n*m+o*f;if(Math.abs(d)<1e-12)return null;let h=1/d;return[u*h,m*h,f*h,(o*c-n*l)*h,(t*l-o*s)*h,(n*s-t*c)*h,(n*a-o*i)*h,(o*r-t*a)*h,(t*i-n*r)*h]}function rm(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function Kg(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!Je(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function $g(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function Zg(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function qg(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 Qg(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=Kg(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!Je(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=Qe(o.extensionsUsed).filter(A=>typeof A=="string");if(i.includes("KHR_draco_mesh_compression")||zg(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||Qe(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(Qe(o.images).length||Qe(o.textures).length)return{ok:!1,issue:"external_resource"};let a=Qe(o.buffers);if(a.length!==1||!Je(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=Qe(o.accessors),c=Qe(o.bufferViews),l=Qe(o.meshes),u=Qe(o.nodes),m=Qe(o.scenes),f=typeof o.scene=="number"?o.scene:0;if(!Je(m[f]))return{ok:!1,issue:"unsupported_glb"};let d=new DataView(r.buffer,r.byteOffset,r.byteLength),h=(A,x,g)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(s[A]))return null;let w=s[A];if(w.type!==x||w.sparse!==void 0||w.normalized===!0||typeof w.count!="number"||!Number.isInteger(w.count)||w.count<1||typeof w.componentType!="number"||!g.includes(w.componentType)||typeof w.bufferView!="number")return null;let v=c[w.bufferView];if(!Je(v)||v.buffer!==0||typeof v.byteLength!="number"||!Number.isInteger(v.byteLength)||v.byteLength<0)return null;let P=Zg(w.type),R=$g(w.componentType),k=typeof v.byteStride=="number"?v.byteStride:P*R,F=typeof v.byteOffset=="number"?v.byteOffset:0,E=typeof w.byteOffset=="number"?w.byteOffset:0,I=F+E,C=E+(w.count-1)*k+P*R;if(!Number.isInteger(k)||!Number.isInteger(F)||!Number.isInteger(E)||k<P*R||F<0||E<0||F+v.byteLength>r.byteLength||C>v.byteLength)return null;let L=[];for(let N=0;N<w.count;N++){let O=[];for(let H=0;H<P;H++){let j=qg(d,I+N*k+H*R,w.componentType);if(!Number.isFinite(j))return null;O.push(j)}L.push(O)}return L},p=[],b=[],y=0,M=new Set,S=(A,x)=>{if(typeof A!="number"||!Number.isInteger(A)||!Je(u[A])||M.has(A))return!1;M.add(A);let g=u[A],w=Wg(g);if(!w)return!1;let v=jg(x,w),P=Yg(v);if(!P)return!1;if(g.mesh!==void 0){if(typeof g.mesh!="number")return!1;let R=l[g.mesh];if(!Je(R))return!1;for(let k of Qe(R.primitives)){if(!Je(k)||k.mode!==void 0&&k.mode!==4||!Je(k.attributes))return!1;let F=h(k.attributes.POSITION,"VEC3",[5126]),E=k.attributes.NORMAL===void 0?null:h(k.attributes.NORMAL,"VEC3",[5126]);if(!F||k.attributes.NORMAL!==void 0&&!E)return!1;let I=F.length;if(k.indices!==void 0){let L=typeof k.indices=="number"?s[k.indices]:null;I=Je(L)?L.count:void 0}if(typeof I!="number"||!Number.isInteger(I)||I%3!==0||(y+=I/3,y>1e5))return!1;let C=k.indices===void 0?F.map((L,N)=>[N]):h(k.indices,"SCALAR",[5121,5123,5125]);if(!C||C.length%3!==0||C.length!==I)return!1;for(let L=0;L<C.length;L+=3){let N=[C[L][0],C[L+1][0],C[L+2][0]];if(N.some(j=>!Number.isInteger(j)||j<0||j>=F.length))return!1;let O=N.map(j=>Xg(v,...F[j])),H=null;if(!E){let j=O[1][0]-O[0][0],V=O[1][1]-O[0][1],T=O[1][2]-O[0][2],B=O[2][0]-O[0][0],D=O[2][1]-O[0][1],G=O[2][2]-O[0][2];H=rm([1,0,0,0,1,0,0,0,1],V*G-T*D,T*B-j*G,j*D-V*B)}for(let j=0;j<3;j++)p.push(...O[j]),b.push(...E?rm(P,...E[N[j]]):H)}}}for(let R of Qe(g.children))if(!S(R,v))return!1;return M.delete(A),!0};for(let A of Qe(m[f].nodes))if(!S(A,Ug()))return{ok:!1,issue:y>1e5?"triangle_limit":"unsupported_glb"};return!y||p.length!==y*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:y,position:new Float32Array(p),normal:new Float32Array(b)}}function im(e){try{return Qg(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function Ln(e){let{doc:t}=e,n=Ws(t.theme),o=n.structure,r=al(t,e.eventConfigurationId??t.eventConfigurationId),i=tm(e.eventConfigurationId,e.eventConfiguration,r),a=e.seats,s=new zo,c=null;if(e.registeredShellGlb){let X=im(e.registeredShellGlb);if(X.ok){let Y=X.position.length/3,K=new Float32Array(X.position.length),J=n.materials.shell??o.tierWall;for(let ce=0;ce<Y;ce++){let oe=X.normal[ce*3+1],ee=oe<-.25?.4:.62+.38*Math.max(0,oe);K[ce*3]=J[0]*ee,K[ce*3+1]=J[1]*ee,K[ce*3+2]=J[2]*ee}c={position:X.position,normal:X.normal,color:K,floor:new Float32Array(Y).fill(-2),material:new Float32Array(Y),count:Y}}}let l=new Map;for(let X of r)for(let Y of X.objects)l.set(Y.id,X.index),Y.type==="section"&&l.set(Y.logicalSectionId??Y.id,X.index);let u=a.map(X=>l.get(X.sectionId??"")??l.get(X.rowId??"")??0),m=pa(r,a),f=s.vertexCount,h=Qu(s,r,a,u,m,o,ge(n.background.top,n.background.bottom,.5))?s.vertexCount:f,p=Xc(t,a),b=new Map,y=new Map;for(let X of t.categories??[])b.set(X.key,X.color),X.seatGlyph&&y.set(X.key,X.seatGlyph);let M=[],S=gl(r,a,u),A=new Map;a.forEach((X,Y)=>{let K=S.seatDeckY(Y);Number.isFinite(K)&&A.set(X.rowId,Math.min(A.get(X.rowId)??1/0,K))});let x=new Float32Array(a.length),g=[],w=new Map((t.floors??[]).map((X,Y)=>[X.id,Y])),v=r.map(()=>[]);for(let X of a){let Y=X.floorId?w.get(X.floorId)??0:0;v[Math.min(Y,v.length-1)]?.push(X)}let P=(X,Y)=>{if(!Y||Y.length<3)return!1;let K=Math.min(...Y.map(ee=>ee.x)),J=Math.max(...Y.map(ee=>ee.x)),ce=Math.min(...Y.map(ee=>ee.y)),oe=Math.max(...Y.map(ee=>ee.y));for(let ee=0;ee<X;ee++)for(let ne of v[ee])if(!(ne.x<K||ne.x>J||ne.y<ce||ne.y>oe)&&Ge(ne,Y,void 0))return!0;return!1},R=null,k=X=>r.length===1?a:a.filter((Y,K)=>u[K]===X),F=(X,Y)=>{let K=lt(X);if(!K)return!1;let J=1/0,ce=1/0,oe=-1/0,ee=-1/0;for(let ne of K)J=Math.min(J,ne.x),oe=Math.max(oe,ne.x),ce=Math.min(ce,ne.y),ee=Math.max(ee,ne.y);return a.some((ne,he)=>ne.kind!=="booth"&&(r.length===1||u[he]===Y)&&ne.x>J&&ne.x<oe&&ne.y>ce&&ne.y<ee&&Ze(K,ne.x,ne.y))},E;for(let X=0;X<r.length;X++){let Y=r[X];s.setFloor(X);let K=kt(Y,k(X)),J=0;if(K){let re=0;for(let ve of Y.objects)if(ve.type==="section")for(let we of S.bySection.get(ve.id)?.rowLevels??[])re=Math.max(re,we.y-Y.baseHeightM);if(J=dl(re),!E){let ve=In(K);E={centre:[ve.x*_,ve.y*_]}}}let ce=new nr,oe=[],ee=Y.objects.filter(re=>re.type==="shape"&&(re.role==="entrance"||re.role==="exit")),ne=Y.objects.filter(re=>re.type==="section"&&!!re.outline&&re.outline.length>=3),he=Kl(Y.objects.filter(re=>re.type==="booth"),Y.focal);for(let re of Y.objects)if(re.type==="section"){let ve=s.vertexCount;uu(s,re,Y,Yc(re,p),S.bySection.get(re.id),ce,ne,o,X>0&&P(X,re.outline));let we=s.vertexCount-ve;we>0&&g.push({sectionId:re.id,start:ve,count:we})}else if(re.type==="shape"){let ve=i.byObjectId.get(re.id),we=M.length,ot=K!==null&&re.role==="wall"&&!ve;s.setMaterial(ot?or:(ve?.kind??re.role)==="screen"?1:0);let ut=re.role==="stage"&&!ve?Zl(re,k(X)):ot&&re.heightM===void 0?{...re,heightM:J}:re,Ye=ml(ut,oe);if(jl(s,ut,Y.baseHeightM+Ye.supportOffsetM,Ye.topOffsetM-Ye.supportOffsetM,o,Y.focal,M,ve,ee),s.setMaterial(0),re.role==="stage"&&!ve&&M.length>we&&(R??X)===X){R=X;let rt=t.floors?.[X]?.id,Ie=r.length>1&&rt?a.filter(Ht=>Ht.floorId===rt):a;om(s,ut,M[M.length-1].y,Ie)}}else re.type==="gaArea"?Xl(s,re,Y.baseHeightM,ye(b.get(re.categoryKey)),o):re.type==="booth"?Hl(s,re,Y.baseHeightM,ye(b.get(re.categoryKey)),o,he.get(re.id)??Y.focal,F(re,X)):re.type==="table"?Ul(s,re,Math.max(Y.baseHeightM,A.get(re.id)??Y.baseHeightM),ye(re.fill??t.theme?.decorFill??"#232c40"),o,!!(re.fill??t.theme?.decorFill)):re.type==="decorImage"&&Wl(s,re,Y.baseHeightM,o);K&&Nu(s,Y.objects,K,Y.baseHeightM,J,Y.focal,o,re=>!i.byObjectId.has(re.id)),fu(s,Y,a,S,o,n.materials.shell,!c)}let I=r.length>1?{x:r.reduce((X,Y)=>X+Y.focal.x,0)/r.length,y:r.reduce((X,Y)=>X+Y.focal.y,0)/r.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},C=Vs(c?[s.build(),c]:[s.build()]),L=Hs(a,e.initialState,S,x,b,y),N=Uu({doc:t,units:r,seats:a,surfaces:S,focal:I}),{labels:O,sections:H,rows:j}=ju({doc:t,units:r,seats:a,surfaces:S,seatData:L,hintedSeatFloor:u,zones:N,focal:I}),V=new Map(H.map((X,Y)=>[X.id,Y]));S.seatOwner.forEach((X,Y)=>{L.iSection[Y]=X?V.get(X)??-1:-1});let T=Xu({doc:t,units:r,seats:a,surfaces:S,solids:C,hintedSeatFloor:u,seatFloor:x});Wu(O,T),L.iYaw=as(L.iPosition,a.length,X=>a[X].rowId,X=>{let Y=r[x[X]]?.focal??I;return[Y.x*_,Y.y*_]});let B=(m.minX+m.maxX)/2*_,D=(m.minY+m.maxY)/2*_,G=.5*Math.hypot((m.maxX-m.minX)*_,(m.maxY-m.minY)*_)||10,U=ba(C,L,{cx:B,cz:D,radius:G},[f,h]),q=ba(C,L,{cx:B,cz:D,radius:G}),$=Jg(r),te=em(L,M,m,U.minY,U.maxY,G,$);return{sharedAisles:zs(r.flatMap(X=>X.objects.flatMap(Y=>{if(Y.type!=="section")return[];let K=S.bySection.get(Y.id);return K?[{sectionId:Y.id,floorIndex:X.index,rows:K.rowLevels}]:[]}))),solids:C,sectionSolidRanges:g,seats:L,seatSectionIds:S.seatOwner,bounds:{center:[(te.min[0]+te.max[0])/2,(te.min[1]+te.max[1])/2,(te.min[2]+te.max[2])/2],radius:G,groundY:0,box:te,fitPoints:Ju(L,M,$)},...E?{room:E}:{},...!E&&r.some(X=>X.objects.some(Y=>Y.type==="shape"&&jo(Y.stageKind)))?{outdoor:!0}:{},renderBounds:{center:U.center,radius:U.radius},clipBounds:{center:q.center,radius:q.radius},stateColorLUT:Xs(n,ze),theme:n,seatCount:a.length,focalWorld:[I.x*_,1.5,I.y*_],zones:N,stages:M,productionElements:i.elements,sections:H,rows:j,labels:O,floors:T}}function Jg(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?lt(o):null;for(let i of r??[])t.push([i.x*_,n.baseHeightM,i.y*_])}return t}var Dt=require("ogl"),e1=.05,t1=.55,n1=12,o1=1.6,r1=1,i1=2.5,a1=650,en={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function s1(e,t){if(t)return 0;let n=(e-en.fadeInFromM)/(en.fullByM-en.fadeInFromM);return Math.max(en.nearStrength,Math.min(1,n))}var am=24;function c1(e){let t=[],n=[],o=[],r=(m,f,d)=>{t.push(...m),n.push(...f),o.push(d)};for(let m=0;m<16;m++){let f=m/16*Math.PI*2,d=(m+1)/16*Math.PI*2,h=S=>[Math.cos(S),0,Math.sin(S)],p=[Math.cos(f)*.012,0,Math.sin(f)*.012],b=[Math.cos(d)*.012,0,Math.sin(d)*.012],y=[Math.cos(f)*.03,1,Math.sin(f)*.03],M=[Math.cos(d)*.03,1,Math.sin(d)*.03];r(p,h(f),0),r(y,h(f),0),r(M,h(d),0),r(p,h(f),0),r(M,h(d),0),r(b,h(d),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let f=m/48*Math.PI*2,d=(m+1)/48*Math.PI*2,h=[Math.cos(f)*c,u,Math.sin(f)*c],p=[Math.cos(f)*l,u,Math.sin(f)*l],b=[Math.cos(d)*l,u,Math.sin(d)*l],y=[Math.cos(d)*c,u,Math.sin(d)*c];for(let M of[h,p,b,h,b,y])r(M,[0,1,0],1)}for(let m=0;m<32;m++){let f=m/32*Math.PI*2,d=(m+1)/32*Math.PI*2,h=en.baseRadius,p=en.topRadius,b=[Math.cos(f)*h,0,Math.sin(f)*h],y=[Math.cos(d)*h,0,Math.sin(d)*h],M=[Math.cos(f)*p,1,Math.sin(f)*p],S=[Math.cos(d)*p,1,Math.sin(d)*p],A=[Math.cos(f),0,Math.sin(f)],x=[Math.cos(d),0,Math.sin(d)];r(b,A,2),r(M,A,2),r(S,x,2),r(b,A,2),r(S,x,2),r(y,x,2)}return new Dt.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var l1=`#version 300 es
|
|
20
|
+
}`});async function Np(e,t,n,o={}){let r=o.fadeMs??400,i=t?.initialBearingDeg??0,a=Math.max(-rn,Math.min(rn,t?.initialPitchDeg??0)),s=ha,c=!1,l=new AbortController,u=()=>l.abort();o.signal?.addEventListener("abort",u,{once:!0});let m=()=>{},h=[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 H=n.camera.position,L=n.focalWorld[0]-H.x,G=n.focalWorld[1]-H.y,j=n.focalWorld[2]-H.z,D=Math.hypot(L,j);D>.001&&(i=Math.atan2(L,-j)*180/Math.PI,a=Math.max(-rn,Math.min(rn,Math.atan2(G,D)*180/Math.PI)))}let f=null;if(t){let H=n.gl.getParameter(n.gl.MAX_TEXTURE_SIZE),L=la(t,ca(H)),G;try{let j=t.resolveUrl?await t.resolveUrl(L.initialUrl):L.initialUrl;if(!j)throw new Error("panorama_asset_unavailable");G=await Nr(j,l.signal)}catch{return o.signal?.removeEventListener("abort",u),null}try{f=Op(n.gl,G)}catch{return l.abort(),o.signal?.removeEventListener("abort",u),null}f.mesh.renderOrder=999,f.mesh.setParent(n.scene),L.upgradeUrl&&(m=ua(()=>{(t.resolveUrl?t.resolveUrl(L.upgradeUrl):Promise.resolve(L.upgradeUrl)).then(D=>!D||l.signal.aborted?null:Nr(D,l.signal)).then(D=>{D&&(c||l.signal.aborted||(f?.setImage(D),n.requestRender()))}).catch(()=>{})}))}let d=n.camera.fov;n.camera.perspective({fov:s,aspect:n.camera.aspect});let p=n.camera.quaternion.slice(),b=()=>{let H=n.camera.position;f?.mesh.position.set(H.x,H.y,H.z);let[L,G,j]=Lp(i,a);n.camera.lookAt([H.x+L,H.y+G,H.z+j]),n.requestRender()};b();let y=document.createElement("div"),g=document.activeElement instanceof HTMLElement?document.activeElement:null;y.setAttribute("role","dialog"),y.setAttribute("aria-modal","true"),y.setAttribute("aria-label",o.seatLabel?`View from ${o.seatLabel}`:"View from seat"),y.tabIndex=-1,Object.assign(y.style,{position:"absolute",inset:"0",zIndex:"10",cursor:"grab",touchAction:"none"});let v=document.createElement("button");if(v.type="button",v.setAttribute("aria-label","Close"),v.textContent="\u2715",Object.assign(v.style,{position:"absolute",top:"12px",right:"12px",zIndex:"2",width:"44px",height:"44px",borderRadius:"999px",cursor:"pointer",border:"1px solid rgba(255,255,255,0.25)",background:"rgba(8,12,18,0.6)",color:"#e6edf3",fontSize:"15px",lineHeight:"1"}),y.appendChild(v),o.disclosure){let H=document.createElement("div");H.textContent=`${o.disclosurePrefix??"360\xB0 panorama"} \xB7 ${o.disclosure}`,Object.assign(H.style,{position:"absolute",top:"calc(12px + var(--sl-3d-top-inset, 0px))",left:"12px",zIndex:"2",maxWidth:"calc(100% - 88px)",padding:"8px 11px",borderRadius:"999px",overflow:"hidden",color:"#dce6f8",background:"rgba(8,12,18,0.68)",font:"600 11px/1.2 ui-sans-serif, system-ui, sans-serif",textOverflow:"ellipsis",whiteSpace:"nowrap",pointerEvents:"none",backdropFilter:"blur(6px)"}),y.appendChild(H)}let P=document.createElement("div");P.textContent=Lc(o.lookAroundHint),Object.assign(P.style,{position:"absolute",bottom:"12px",left:"0",right:"0",textAlign:"center",color:"rgba(230,237,243,0.7)",font:"12px ui-sans-serif, system-ui, sans-serif",pointerEvents:"none"}),y.appendChild(P),e.appendChild(y),v.focus({preventScroll:!0});let w=!1,x=0,S=0,A=0,M=new Map,E=()=>{let[H,L]=[...M.values()];return H&&L?Math.hypot(H.x-L.x,H.y-L.y):0},T=H=>{let L=kc(H);L!==s&&(s=L,n.camera.perspective({fov:s,aspect:n.camera.aspect}),b())},k=H=>{H.target!==v&&(M.set(H.pointerId,{x:H.clientX,y:H.clientY}),w=M.size===1,x=H.clientX,S=H.clientY,M.size===2&&(A=E()),y.setPointerCapture?.(H.pointerId),y.style.cursor="grabbing")},_=H=>{if(M.has(H.pointerId)){if(M.set(H.pointerId,{x:H.clientX,y:H.clientY}),M.size>=2){let L=E();A>0&&L>0&&T(s*(A/L)),A=L,w=!1;return}w&&(i+=(H.clientX-x)*Dp,a=Math.max(-rn,Math.min(rn,a+(H.clientY-S)*Dp)),x=H.clientX,S=H.clientY,b())}},R=H=>{M.delete(H.pointerId),A=M.size===2?E():0;let L=M.values().next().value;w=M.size===1,L?(x=L.x,S=L.y):y.style.cursor="grab";try{y.releasePointerCapture?.(H.pointerId)}catch{}},C=H=>{H.preventDefault(),T(s+H.deltaY*.04)};y.addEventListener("pointerdown",k),y.addEventListener("pointermove",_),y.addEventListener("pointerup",R),y.addEventListener("pointercancel",R),y.addEventListener("wheel",C,{passive:!1});let O=H=>{if(!c){if(H.key==="Tab"){H.preventDefault(),v.focus({preventScroll:!0});return}if(H.key==="Escape"){H.stopPropagation(),V.close();return}if(H.key==="ArrowLeft"||H.key==="ArrowRight")i+=H.key==="ArrowLeft"?-4:4;else if(H.key==="ArrowUp"||H.key==="ArrowDown")a=Math.max(-rn,Math.min(rn,a+(H.key==="ArrowUp"?4:-4)));else if(H.key==="+"||H.key==="="){T(s-5),H.preventDefault();return}else if(H.key==="-"){T(s+5),H.preventDefault();return}else return;H.preventDefault(),b()}};window.addEventListener("keydown",O);let B=0,F=(H,L)=>{if(!f){L?.();return}let G=H===1?0:1,j=performance.now(),D=()=>{if(c)return;let U=r<=0?1:Math.min(1,(performance.now()-j)/r);f?.setOpacity(G+(H-G)*U),n.requestRender(),U<1?B=requestAnimationFrame(D):L?.()};B=requestAnimationFrame(D)};F(1);let N=()=>{c||(c=!0,m(),l.abort(),o.signal?.removeEventListener("abort",u),cancelAnimationFrame(B),y.removeEventListener("pointerdown",k),y.removeEventListener("pointermove",_),y.removeEventListener("pointerup",R),y.removeEventListener("pointercancel",R),y.removeEventListener("wheel",C),window.removeEventListener("keydown",O),y.remove(),g?.isConnected&&g.focus({preventScroll:!0}),f?.dispose(),n.camera.position.set(h[0],h[1],h[2]),n.camera.perspective({fov:d,aspect:n.camera.aspect}),n.camera.quaternion.set(p[0],p[1],p[2],p[3]),n.requestRender())},V={close(){if(c)return;let H=()=>{N(),o.onClose?.()};cancelAnimationFrame(B),F(0,H)},dispose:N};return v.addEventListener("click",()=>V.close()),V}var Dp,Bp=Xo(()=>{"use strict";Fp();fa();fa();Tc();Dp=.15});var Hp={};Xc(Hp,{createOpenPanorama:()=>Jw});function Jw(e){let{container:t,model:n,opts:o,analytics:r,orbit:i,loop:a,seatsById:s,ensureSeatView:c,resolvedSeatViewPose:l,gpu:u,gl:m,isContextLost:h,isDisposed:f,flightGen:d,setPanorama:p,getLoadAbort:b,setLoadAbort:y,setPanoramaSphereVisible:g,setFrozen:v,raisePanoramaLayer:P,restorePanoramaLayer:w,getOverviewChip:x,labelOverlay:S,reducedMotion:A,removeArriveChip:M,showArriveChip:E}=e;return async(T,k,_)=>{b()?.abort();let R=new AbortController;y(R);let C=n.seats.idToIndex.get(T);if(C===void 0){i.syncFromCamera();return}let O=s.get(T)?.label??T,B=l(T,C),F=c(T);if(!F){R.abort(),b()===R&&y(null),i.syncFromCamera();return}v(!0),a.stop();let N;try{N=await F}catch{if(b()===R&&y(null),r.panoramaFailed(T,"source"),!f()&&_===d()){v(!1),i.resumeAfterFlight(B.focal),a.requestRender();let $=E(T,_,!0);requestAnimationFrame(()=>$?.querySelector("[data-panorama-trigger]")?.focus())}return}if(f()||_!==d()){R.abort(),b()===R&&y(null);return}M();let V=x(),H=()=>{R.abort(),b()===R&&y(null),p(null),g(!1),w(),V.style.display="",S.setVisible(!o.arriveAtSeatEye),v(!1),r.panoramaClosed(),i.resumeAfterFlight(B.focal),a.requestRender();let $=E(T,d());requestAnimationFrame(()=>$?.querySelector("[data-panorama-trigger]")?.focus())},L=N.generated===!0,G=Tp(N);P(),g(!L),V.style.display="none";let j=A()?0:k,D=u(),U=D&&!h()?await Np(t,L?null:N,{gl:m,scene:D.main,camera:i.camera,requestRender:()=>a.requestRender(),cameraOriginWorld:L?B.eye:void 0,focalWorld:B.focal},{fadeMs:j,seatLabel:O,disclosure:G,disclosurePrefix:L?"Live 3D view":"360\xB0 panorama",lookAroundHint:o.lookAroundHint,onClose:H,signal:R.signal}):null;if(f()||_!==d()){R.abort(),g(!1),b()===R&&y(null),U?.dispose(),V.style.display="",w();return}if(U)i.syncFromCamera(),S.setVisible(!1),v(!1),a.requestRender(),p(U);else if(L){w(),V.style.display="",v(!1),i.resumeAfterFlight(B.focal),a.requestRender(),p(null),g(!1),r.panoramaFailed(T,"mount");let $=E(T,d(),!0);requestAnimationFrame(()=>$?.querySelector("[data-panorama-trigger]")?.focus()),b()===R&&y(null);return}else g(!1),r.panoramaFallback(T),p(kp(t,N,{fadeMs:j,seatLabel:O,disclosure:G,onClose:H,signal:R.signal,lookAroundHint:o.lookAroundHint}));r.panoramaOpened()}}var Gp=Xo(()=>{"use strict";fa();Bp()});var SP={};Xc(SP,{VENUE3D_QUALITY_REPORT_VERSION:()=>gd,autoVenue3d:()=>Zi,buildSceneModel:()=>Oo,estimateVenue3D:()=>Br,inspectVenue3DQualityEvidence:()=>ea,mountVenue3D:()=>vP,prepareVenue3D:()=>c0,prepareVenue3DFromChart:()=>l0});module.exports=w0(SP);function Yc(e,t,n){let o=Math.floor(t.length/3),r=n.center[0],i=n.center[2];if(o>0){let c=Math.max(1,Math.floor(o/4e3)),l=0,u=0,m=0;for(let h=0;h<o;h+=c)l+=t[h*3],u+=t[h*3+2],m++;r=l/m,i=u/m}let a=e[0]-r,s=e[2]-i;return Math.hypot(a,s)>n.radius*.12?Math.atan2(a,s):void 0}var u0=require("ogl");function $c(e,t,n="#ffffff"){let{iPosition:o,count:r}=t.seats;if(r<2||typeof document>"u")return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let w=0;w<r;w++){let x=o[w*3],S=o[w*3+2];x<i&&(i=x),x>a&&(a=x),S<s&&(s=S),S>c&&(c=S)}for(let w of t.stages)i=Math.min(i,w.cx-w.halfX),a=Math.max(a,w.cx+w.halfX),s=Math.min(s,w.cz-w.halfZ),c=Math.max(c,w.cz+w.halfZ);let l=Math.min(130/Math.max(.001,a-i),86/Math.max(.001,c-s)),u=(148-(a-i)*l)/2,m=(104-(c-s)*l)/2,h=w=>u+(w-i)*l,f=w=>m+(w-s)*l,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),p=document.createElement("canvas");p.width=Math.round(148*d),p.height=Math.round(104*d),p.setAttribute("aria-hidden","true"),p.setAttribute("data-seat-locator","");let b=p.style;b.position="absolute",b.left="12px",b.bottom="12px",b.width="148px",b.height="104px",b.borderRadius="10px",b.background="rgba(10,14,22,.72)",b.border="1px solid rgba(255,255,255,.14)",b.boxShadow="0 4px 14px rgba(0,0,0,.35)",b.pointerEvents="none",b.zIndex="3",b.display="none",e.appendChild(p);let y=document.createElement("canvas");y.width=p.width,y.height=p.height;let g=y.getContext("2d");if(g){g.scale(d,d),g.fillStyle="rgba(214,222,234,.28)";let w=Math.max(1,Math.ceil(r/6e3));for(let x=0;x<r;x+=w)g.fillRect(h(o[x*3])-.6,f(o[x*3+2])-.6,1.2,1.2);g.fillStyle="rgba(236,240,246,.16)",g.strokeStyle="rgba(236,240,246,.55)",g.lineWidth=1;for(let x of t.stages){let S=h(x.cx-x.halfX),A=f(x.cz-x.halfZ),M=x.halfX*2*l,E=x.halfZ*2*l;g.fillRect(S,A,M,E),g.strokeRect(S+.5,A+.5,Math.max(0,M-1),Math.max(0,E-1))}}let v=p.getContext("2d"),P="";return{el:p,update(w,x){if(!w||!v||e.clientWidth>0&&e.clientWidth<560){b.display!=="none"&&(b.display="none"),P="";return}let S=h(w[0]),A=f(w[2]),M=x?Math.atan2(x[2],x[0]):0,E=`${S.toFixed(1)},${A.toFixed(1)},${M.toFixed(2)}`;if(E!==P){if(P=E,b.display="block",v.setTransform(1,0,0,1,0,0),v.clearRect(0,0,p.width,p.height),v.drawImage(y,0,0),v.setTransform(d,0,0,d,0,0),x){let T=v.createRadialGradient(S,A,0,S,A,26);T.addColorStop(0,"rgba(255,255,255,.55)"),T.addColorStop(1,"rgba(255,255,255,0)"),v.fillStyle=T,v.beginPath(),v.moveTo(S,A),v.arc(S,A,26,M-.5,M+.5),v.closePath(),v.fill()}v.fillStyle=n,v.strokeStyle="rgba(10,14,22,.9)",v.lineWidth=1.5,v.beginPath(),v.arc(S,A,3.6,0,Math.PI*2),v.fill(),v.stroke()}},dispose(){p.remove()}}}var dt={pedestal:0,pad:1,back:2,arm:3,footrest:4,leg:5,spine:6,armrest:7},P0=.44,A0=.15,Zc=.3,R0=.24;function qc(e){return e===void 0||!Number.isFinite(e)||e<=0?R0:Math.min(Zc,Math.max(A0,e*P0))}var Ko=.21,E0=.05,Qc=.45,sn=Qc+E0,dn=.92,Ur=.66,Jc=1.205;var Wr=.6,el=.56,tl=.5,nl=-.9,ol=.76,rl=.66;var Aa=.38,il=-.84,al=.06,Ra=78;var I0=.28,Tn=.15,_0=[{part:dt.pedestal,min:[-.3,0,-.3],max:[.3,.36,.3]},{part:dt.pad,min:[-1,.36,-.95],max:[1,Qc,1]},{part:dt.back,min:[-1,sn,-1],max:[1,dn,-.72]},{part:dt.arm,min:[-1,.44,-.82],max:[-.78,.65,.78]},{part:dt.arm,min:[.78,.44,-.82],max:[1,.65,.78]},{part:dt.footrest,min:[-.9,.18,.78],max:[.9,.31,1.34]},{part:dt.leg,min:[-.82,0,-.7],max:[-.62,.37,-.48]},{part:dt.leg,min:[.62,0,-.7],max:[.82,.37,-.48]},{part:dt.leg,min:[-.82,0,.48],max:[-.62,.37,.7]},{part:dt.leg,min:[.62,0,.48],max:[.82,.37,.7]},{part:dt.spine,min:[-.8,.3,-1],max:[.8,.6,-.9]},...[1,-1].flatMap(e=>{let t=a=>{let s=e*(Tn-a),c=e*(Tn+a);return[Math.min(s,c),Math.max(s,c)]},[n,o]=t(.09),[r,i]=t(I0/2);return[{part:dt.armrest,min:[n,0,-.5],max:[o,.6,.05],skip:[2,3]},{part:dt.armrest,min:[r,.6,-.74],max:[i,.655,.58],skip:[3]}]})],C0=[{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 sl(){let e=[],t=[],n=[],o=[],r=(f,d,p)=>{let b=n.length,[y,g,v]=f,P=[g[0]-y[0],g[1]-y[1],g[2]-y[2]],w=[v[0]-y[0],v[1]-y[1],v[2]-y[2]],x=P[1]*w[2]-P[2]*w[1],S=P[2]*w[0]-P[0]*w[2],A=P[0]*w[1]-P[1]*w[0],M=Math.hypot(x,S,A);M>1e-9?(x/=M,S/=M,A/=M):[x,S,A]=d,x*d[0]+S*d[1]+A*d[2]<0&&(x=-x,S=-S,A=-A);for(let E of f)e.push(...E),t.push(x,S,A),n.push(p);o.push(b,b+1,b+2,b,b+2,b+3)},i=f=>{for(let[d,p]of C0.entries()){if(f.skip?.includes(d))continue;let b=p.c.map(y=>y.map((g,v)=>g?f.max[v]:f.min[v]));r(b,p.n,f.part)}},a=f=>{let{part:d,vertical:p,across:b,along:y,alongCoord:g,halfWidth:v,swell:P,base:w}=f,x=(L,G,j)=>p?[L*v(G),g(G),j]:[L*v(G),j,g(G)],S=(L,G)=>x(L,G,P(L,G)),A=p?2:1,M=(L,G)=>{let D=Math.max(-1,L-.001),U=Math.min(1,L+.001),$=Math.max(0,G-.001),Z=Math.min(1,G+.001),te=S(D,G),X=S(U,G),me=S(L,$),re=S(L,Z),ce=[X[0]-te[0],X[1]-te[1],X[2]-te[2]],J=[re[0]-me[0],re[1]-me[1],re[2]-me[2]],ae=[ce[1]*J[2]-ce[2]*J[1],ce[2]*J[0]-ce[0]*J[2],ce[0]*J[1]-ce[1]*J[0]];ae[A]<0&&(ae=[-ae[0],-ae[1],-ae[2]]);let ie=Math.hypot(...ae)||1;return[ae[0]/ie,ae[1]/ie,ae[2]/ie]},E=(L,G)=>(e.push(...L),t.push(...G),n.push(d),n.length-1),T=y.map(L=>b.map(G=>E(S(G,L),M(G,L))));for(let L=0;L<y.length-1;L++)for(let G=0;G<b.length-1;G++)o.push(T[L][G],T[L][G+1],T[L+1][G+1],T[L][G],T[L+1][G+1],T[L+1][G]);let k=[];for(let L=0;L<b.length-1;L++)k.push([b[L],y[0]]);for(let L=0;L<y.length-1;L++)k.push([b[b.length-1],y[L]]);for(let L=b.length-1;L>0;L--)k.push([b[L],y[y.length-1]]);for(let L=y.length-1;L>0;L--)k.push([b[0],y[L]]);let _=k.map(([L,G])=>x(L,G,w)),R=L=>p?[L[0],L[1]]:[L[0],L[2]],C=L=>{let[G,j]=R(_[L]),[D,U]=R(_[(L+1)%_.length]),$=Math.hypot(D-G,U-j)||1;return[(U-j)/$,-(D-G)/$]},O=_.reduce((L,G)=>{let[j,D]=R(G);return[L[0]+j/_.length,L[1]+D/_.length]},[0,0]),B=L=>{let G=C((L+_.length-1)%_.length),j=C(L),D=G[0]+j[0],U=G[1]+j[1],[$,Z]=R(_[L]);D*($-O[0])+U*(Z-O[1])<0&&(D=-D,U=-U);let te=Math.hypot(D,U)||1;return p?[D/te,U/te,0]:[D/te,0,U/te]},F=k.map(([L,G],j)=>E(S(L,G),B(j))),N=_.map((L,G)=>E(L,B(G)));for(let L=0;L<k.length;L++){let G=(L+1)%k.length;o.push(F[L],F[G],N[G],F[L],N[G],N[L])}let V=p?[0,0,-1]:[0,-1,0],H=_.map(L=>E(L,V));for(let L=1;L<H.length-1;L++)o.push(H[0],H[L],H[L+1])},s=f=>1-f*f*f*f,c=f=>d=>{for(let p=1;p<f.length;p++)if(d<=f[p][0]){let[b,y]=f[p-1],[g,v]=f[p];return y+(v-y)*(d-b)/(g-b)}return f[f.length-1][1]};for(let f of _0)if(f.part===dt.back){let d=[[0,.8],[.04,.9],[.1,.97],[.25,1],[.77,.94],[.88,.88],[.95,.79],[1,Ur]],p=f.min[1],b=f.max[1];a({part:f.part,vertical:!0,across:[-1,-.6,0,.6,1],along:d.map(([y])=>y),alongCoord:y=>p+(b-p)*y,halfWidth:c(d),swell:(y,g)=>f.max[2]-.12+.12*s(y)*s(2*g-1),base:f.min[2]})}else if(f.part===dt.pad){let d=[[0,.84],[.1,.92],[.78,.92],[.9,.89],[.97,.82],[1,.72]],p=f.min[2],b=f.max[2],y=f.min[1],g=f.max[1];a({part:f.part,vertical:!1,across:[-1,-.6,0,.6,1],along:d.map(([v])=>v),alongCoord:v=>p+(b-p)*v,halfWidth:c(d),swell:(v,P)=>y+(g-y)*(.45+.55*s(v)*s(2*P-1)),base:y})}else i(f);let l=new Float32Array(e),u=new Float32Array(t),m=new Float32Array(n),h=new Uint16Array(o);return{position:l,normal:u,part:m,index:h,vertexCount:n.length,indexCount:o.length}}var Ea=20*Math.PI/180;function cl(e,t,n,o,r){let i=new Float32Array(t),a=m=>e[m*3],s=m=>e[m*3+2],c=Math.cos(Ea),l=0,u=(m,h)=>{let f=h-m,d=r?.(m),p=d!==void 0;for(let v=m+1;!p&&v<h-1;v++){let P=a(v)-a(v-1),w=s(v)-s(v-1),x=a(v+1)-a(v),S=s(v+1)-s(v),A=Math.hypot(P,w)*Math.hypot(x,S);A>1e-9&&(P*x+w*S)/A<c&&(p=!0)}let b=0,y=0,g=!1;if(p){if(d)[b,y]=d;else{for(let P=m;P<h;P++)b+=a(P),y+=s(P);b/=f,y/=f}let v=0;for(let P=m+1;P<h;P++)v=Math.max(v,Math.hypot(a(P)-a(P-1),s(P)-s(P-1)));g=f>=3&&Math.hypot(a(h-1)-a(m),s(h-1)-s(m))<=v*1.6}for(let v=m;v<h;v++){let[P,w]=p?[b,y]:o(v),x=P-a(v),S=w-s(v);if(f>=2&&!(d&&f<3)){let A=g?m+(v-1-m+f)%f:Math.max(m,v-1),M=g?m+(v+1-m)%f:Math.min(h-1,v+1),E=a(M)-a(A),T=s(M)-s(A),k=Math.hypot(E,T);if(k>1e-6){let _=-T/k,R=E/k;_*x+R*S<0&&(_=-_,R=-R),x=_,S=R}}i[v]=x===0&&S===0?0:Math.atan2(x,S)}};for(let m=1;m<=t;m++)(m===t||n(m)!==n(l))&&(u(l,m),l=m);return i}var Ia=78,ll=18;function ul(){let e=[],t=[],n=[],o=[],r=[],i=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,sn,-1],max:[1,dn,-.72]}])for(let c of i){let l=e.length/3,u=c.n[1]+(s.part===2?Math.abs(c.n[0])*(1-Ur)/(dn-sn):0),m=Math.hypot(c.n[0],u,c.n[2]),h=[c.n[0]/m,u/m,c.n[2]/m];for(let[f,d]of c.c.entries()){let p=d.map((b,y)=>s.min[y]+b*(s.max[y]-s.min[y]));s.part===2&&(p[0]*=1-d[1]*(1-Ur)),e.push(...p),t.push(...h),n.push(s.part),o.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][f])}r.push(l,l+1,l+2,l,l+2,l+3)}let a=e.length/3;for(let[s,c]of[[-1,-1],[1,-1],[1,1],[-1,1]])e.push(s,c,0),t.push(0,1,0),n.push(0),o.push(s,c);return r.push(a,a+1,a+2,a,a+2,a+3),r.push(...r.slice(12,18),...r.slice(60,66),...r.slice(72,78)),{position:new Float32Array(e),normal:new Float32Array(t),surface:new Float32Array(n),uv:new Float32Array(o),index:new Uint16Array(r)}}var yl=require("ogl");var T0=/^#?([\da-f]{3}|[\da-f]{6})$/i;function ml(e){let t=e.replace("#","");return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}}function k0(e){let t=T0.exec((e??"").trim());if(!t)return null;let n=t[1].length===3?t[1].split("").map(r=>r+r).join(""):t[1],o=parseInt(n,16);return[o>>16&255,o>>8&255,o&255]}function Ie(e){let t=k0(e);return t?[t[0]/255,t[1]/255,t[2]/255]:null}function _a(e){let t=e/255;return t<=.04045?t/12.92:((t+.055)/1.055)**2.4}function L0(e){return .2126*_a(e[0])+.7152*_a(e[1])+.0722*_a(e[2])}function hl(e){return L0([e[0]*255,e[1]*255,e[2]*255])}function O0(e){return .2126*e[0]+.7152*e[1]+.0722*e[2]}function we(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 Xt(e,t){let n=O0(e);return we(e,[n,n,n],t)}function fl({r:e,g:t,b:n}){let o=e/255,r=t/255,i=n/255,a=Math.max(o,r,i),s=Math.min(o,r,i),c=(a+s)/2;if(a===s)return{h:0,s:0,l:c};let l=a-s,u=c>.5?l/(2-a-s):l/(a+s),m;return a===o?m=((r-i)/l+(r<i?6:0))/6:a===r?m=((i-o)/l+2)/6:m=((o-r)/l+4)/6,{h:m,s:u,l:c}}var Ca=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4,Ta=e=>e<=.0031308?12.92*e:1.055*Math.max(0,e)**.4166666666666667-.055,ka=e=>Math.min(1,Math.max(0,e));function Xr(e){let t=Ca(e[0]),n=Ca(e[1]),o=Ca(e[2]),r=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*o),i=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*o),a=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*o);return[.2104542553*r+.793617785*i-.0040720468*a,1.9779984951*r-2.428592205*i+.4505937099*a,.0259040371*r+.7827717662*i-.808675766*a]}function jr([e,t,n]){let o=(e+.3963377774*t+.2158037573*n)**3,r=(e-.1055613458*t-.0638541728*n)**3,i=(e-.0894841775*t-1.291485548*n)**3;return[ka(Ta(4.0767416621*o-3.3077115913*r+.2309699292*i)),ka(Ta(-1.2684380046*o+2.6097574011*r-.3413193965*i)),ka(Ta(-.0041960863*o-.7034186147*r+1.707614701*i))]}var Kr=e=>Xr(e)[0];function Yo(e){let[,t,n]=Xr(e);return Math.hypot(t,n)}function kn(e,t,n){let[,o,r]=Xr(e);if(n===void 0)return jr([t,o,r]);let i=Math.hypot(o,r),a=i===0?0:n/i;return jr([t,o*a,r*a])}function dl(e,t,n){let[o,r,i]=Xr(e);return o>=t&&o<=n?e:jr([Math.min(n,Math.max(t,o)),r,i])}function Yr(e){return jr([e,-.004,-.008])}var ct=["available","held","sold","selected","dimmed"];function $o(e){let t=ct.indexOf(e);return t<0?0:t}var bl={available:[.24,.82,.52],held:[.34,.39,.45],sold:[.34,.39,.45],selected:[.24,.74,1],dimmed:[.28,.32,.37]};function F0(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=.78,o=.86;return[(t+(e[0]-t)*n)*o,(t+(e[1]-t)*n)*o,(t+(e[2]-t)*n)*o]}var pl={day:{ground:.9,deck:.84,fascia:.77,shell:.79,seatMin:.45,seatMax:.58,unavailable:.58,dimmed:.62,sectionDeck:.66,sectionDeckChromaShare:.8,sectionDeckChromaCap:.11,stageTop:.52,stageWall:.42},night:{ground:.26,deck:.34,fascia:.28,shell:.32,seatMin:.64,seatMax:.8,unavailable:.42,dimmed:.39,sectionDeck:.34,sectionDeckChromaShare:.45,sectionDeckChromaCap:.05,stageTop:0,stageWall:0}},$r=.012;function Kt(e){return Kr(e.tierTop)>.6}function Ln(e){return e?pl.day:pl.night}function gl(e,t){let n=Ln(t);return dl(F0(e),n.seatMin,n.seatMax)}var La={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]},On={top:[.05,.06,.08],bottom:[.1,.12,.15]};function oe(e,t){return[Math.min(1,e[0]*t),Math.min(1,e[1]*t),Math.min(1,e[2]*t)]}function D0(){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 xl=1e4;function N0(e){if(typeof navigator<"u"){let t=navigator.deviceMemory;if(typeof t=="number"&&t<=4)return 0}return e>=1.5?2:4}var Zr=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.");let o=D0();this.smoothingSamples=N0(o),this.renderer=new yl.Renderer({canvas:this.canvas,dpr:o,alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[On.top[0],On.top[1],On.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 pn=require("ogl"),B0=`#version 300 es
|
|
21
|
+
in vec2 position;
|
|
22
|
+
in vec2 uv;
|
|
23
|
+
out vec2 vUv;
|
|
24
|
+
void main() {
|
|
25
|
+
vUv = uv;
|
|
26
|
+
gl_Position = vec4(position, 0.0, 1.0);
|
|
27
|
+
}`,H0=`#version 300 es
|
|
28
|
+
precision highp float;
|
|
29
|
+
uniform sampler2D tFrame;
|
|
30
|
+
in vec2 vUv;
|
|
31
|
+
out vec4 fragColor;
|
|
32
|
+
void main() {
|
|
33
|
+
fragColor = vec4(texture(tFrame, vUv).rgb, 1.0);
|
|
34
|
+
}`,qr=class{constructor(t,n,o){this.gl=t;this.renderer=n;this.samples=o;this.fbo=null;this.colour=null;this.depth=null;this.resolved=null;this.copy=null;this.width=0;this.height=0;this.active=null;this.unavailable=!1}begin(t){if(this.active=null,!t||this.unavailable||this.samples<2)return null;let n=this.gl,o=n.drawingBufferWidth,r=n.drawingBufferHeight;return o<1||r<1?null:(!this.fbo||o!==this.width||r!==this.height)&&(this.release(),!this.allocate(o,r))?(this.unavailable=!0,this.release(),null):(this.active={target:n.FRAMEBUFFER,buffer:this.fbo,width:o,height:r,depth:!0,stencil:!1},this.active)}end(){if(!this.active||!this.resolved||!this.copy)return;let t=this.gl,{width:n,height:o}=this.active;this.active=null,t.bindFramebuffer(t.READ_FRAMEBUFFER,this.fbo),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,this.resolved.buffer),t.blitFramebuffer(0,0,n,o,0,0,n,o,t.COLOR_BUFFER_BIT,t.NEAREST),this.unbind(),this.renderer.render({scene:this.copy,clear:!1})}reset(){this.fbo=null,this.colour=null,this.depth=null,this.resolved=null,this.copy=null,this.active=null,this.width=0,this.height=0}dispose(){this.release()}allocate(t,n){let o=this.gl,r=Math.min(this.samples,o.getParameter(o.MAX_SAMPLES));if(r<2)return!1;this.fbo=o.createFramebuffer(),this.colour=o.createRenderbuffer(),this.depth=o.createRenderbuffer(),o.bindRenderbuffer(o.RENDERBUFFER,this.colour),o.renderbufferStorageMultisample(o.RENDERBUFFER,r,o.RGBA8,t,n),o.bindRenderbuffer(o.RENDERBUFFER,this.depth),o.renderbufferStorageMultisample(o.RENDERBUFFER,r,o.DEPTH_COMPONENT24,t,n),o.bindRenderbuffer(o.RENDERBUFFER,null),o.bindFramebuffer(o.FRAMEBUFFER,this.fbo),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.COLOR_ATTACHMENT0,o.RENDERBUFFER,this.colour),o.framebufferRenderbuffer(o.FRAMEBUFFER,o.DEPTH_ATTACHMENT,o.RENDERBUFFER,this.depth);let i=o.checkFramebufferStatus(o.FRAMEBUFFER)===o.FRAMEBUFFER_COMPLETE;if(this.unbind(),!i)return!1;this.resolved=new pn.RenderTarget(this.gl,{width:t,height:n,depth:!1,minFilter:o.NEAREST,magFilter:o.NEAREST});let a=new pn.Program(this.gl,{vertex:B0,fragment:H0,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{tFrame:{value:this.resolved.texture}}});return this.copy=new pn.Mesh(this.gl,{geometry:new pn.Triangle(this.gl),program:a}),this.copy.frustumCulled=!1,this.width=t,this.height=n,!0}unbind(){let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,null),this.renderer.state.framebuffer=null}release(){let t=this.gl;if(this.fbo&&t.deleteFramebuffer(this.fbo),this.colour&&t.deleteRenderbuffer(this.colour),this.depth&&t.deleteRenderbuffer(this.depth),this.resolved){for(let n of this.resolved.textures)t.deleteTexture(n.texture);t.deleteFramebuffer(this.resolved.buffer)}this.copy&&(this.copy.geometry.remove(),this.copy.program.remove()),this.reset()}};function Ml(e,t,n){return e<=n&&t<=500}var G0=25,V0=30,z0=8,U0=.8,W0=250,Qr=class{constructor(){this.limit=1/0;this.recent=[];this.slow=0;this.last=null}allows(t){return t<this.limit}frame(t,n,o){if(!t){this.last=null;return}let r=this.last===null?null:o-this.last;if(this.last=o,r===null||r>W0)return;let i=r>G0;this.recent.push(i),i&&(this.slow+=1),this.recent.length>V0&&this.recent.shift()&&(this.slow-=1),this.slow>=z0&&(this.limit=Math.min(this.limit,n*U0),this.recent=[],this.slow=0)}};var oo=require("ogl");var Oa=Math.PI/180,j0="map";function Sl(e){return e.touchNavigation??j0}var X0=3,Fa=6;function Jr(e,t,n=Fa){return Math.hypot(e,t)>n}var ei=10*Oa,K0=10,Y0=.35,$0=1e3/60;function Z0(e,t,n){let o=Math.sin(e.polar),r=o*Math.sin(e.azimuth),i=Math.cos(e.polar),a=o*Math.cos(e.azimuth),s=[e.target[0]+e.distance*r,e.target[1]+e.distance*i,e.target[2]+e.distance*a],c=-r,l=-i,u=-a,m=-u,h=c,f=Math.hypot(m,h)||1;m/=f,h/=f;let d=-h*l,p=h*c-m*u,b=m*l,y=Math.tan(e.fovYDeg*Oa/2),g=y*(e.aspect>0?e.aspect:1);return{eye:s,ray:[c+t*g*m+n*y*d,l+n*y*p,u+t*g*h+n*y*b]}}function Da(e,t,n,o,r=X0){let{eye:i,ray:a}=Z0(e,t,n);if(a[1]>=-1e-6)return null;let s=(o-i[1])/a[1];return!(s>0)||s*Math.hypot(a[0],a[1],a[2])>e.distance*r?null:[i[0]+a[0]*s,o,i[2]+a[2]*s]}function Na(e,t,n,o){let r=Da(e,n,o,t[1]);return r?[e.target[0]+t[0]-r[0],e.target[1],e.target[2]+t[2]-r[2]]:null}function wl(e,t){return!(e>0)||!(t>0)?1:Math.max(.5,Math.min(2,e/t))}function Pl(e,t,n){let o=e+n;if(t)return{soFar:o,turning:t,turn:n};let r=Math.abs(o)-ei;return r>0?{soFar:o,turning:!0,turn:Math.sign(o)*r}:{soFar:o,turning:!1,turn:0}}function Al(e,t,n){let o=e[0]-t[0],r=e[2]-t[2],i=Math.cos(n),a=Math.sin(n);return[t[0]+o*i+r*a,e[1],t[2]-o*a+r*i]}function Rl(e,t){let n=t[0].x-e[0].x,o=t[0].y-e[0].y,r=t[1].x-e[1].x,i=t[1].y-e[1].y;if(Math.max(Math.hypot(n,o),Math.hypot(r,i))<K0)return"undecided";let a=e[1].x-e[0].x,s=e[1].y-e[0].y,c=Math.hypot(a,s),l=c>0&&Math.abs(s)/c<.5,u=o*i>0&&Math.abs(o)>=4&&Math.abs(i)>=4&&Math.abs(o)>2*Math.abs(n)&&Math.abs(i)>2*Math.abs(r),m=Math.abs(Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)-c);return l&&u&&m<Math.max(8,c*.1)?"tilt":"free"}function El(e){let t=Math.tan(e.fovYDeg*Oa/2);return e.distance*t*Math.min(1,e.aspect>0?e.aspect:1)}function vl(e,t,n,o,r){let i=2*Math.max(0,r),a=Math.min(Math.max(0,o-n),i*(1-Y0)),s=Math.min(n+a-r,t),c=Math.max(o-a+r,t);return Math.max(s,Math.min(c,e))}function Il(e,t,n,o){return[vl(e[0],t[0],n.minX,n.maxX,o),e[1],vl(e[2],t[2],n.minZ,n.maxZ,o)]}function _l(e,t,n){let o=n&&Number.isFinite(t)?Math.max(1,Math.min(4,t/$0)):1;return 1-Math.pow(1-e,o)}var lt=Math.PI/180,ti=15*lt,ni=80*lt,Cl=.12,Tl=35,Ba=1.25,kl=.006,q0=4,ro=.82,Zo=1/ro,Q0=.12,J0=2;function Ll(e,t){return{azimuth:0-e*kl,polar:-t*kl}}function Ol(e,t,n){let o=Math.max(J0,Math.max(1,t)*Q0),r=n*q0;return{minDist:e?Math.min(e.minDist,o):o,maxDist:e?Math.max(e.maxDist,r):r}}var eb=1.5;function tb(e,t,n){let o=Math.max(1,n)*eb;if(!e)return{anchor:[t[0],t[1],t[2]],limit:o};let[r,i,a]=e.anchor,s=t[1]-i,c=Math.max(Math.abs(t[0]-r),Math.abs(t[2]-a),s>=0?s:-s*2);return{anchor:e.anchor,limit:Math.max(e.limit,c+o)}}function nb(e,t,n,o,r,i,a,s){let c=Math.sin(n),l=[c*Math.sin(t),Math.cos(n),c*Math.cos(t)],u=[e[0]+o*l[0],e[1]+o*l[1],e[2]+o*l[2]],m=[-l[0],-l[1],-l[2]],h=[-m[2],0,m[0]],f=Math.hypot(h[0],h[2])||1;h=[h[0]/f,0,h[2]/f];let d=[h[1]*m[2]-h[2]*m[1],h[2]*m[0]-h[0]*m[2],h[0]*m[1]-h[1]*m[0]],p=Math.tan(r*lt/2),b=p*(i>0?i:1),y=[0,1,2].map(P=>m[P]+a*b*h[P]+s*p*d[P]);if(y[1]>=-1e-6)return null;let g=(e[1]-u[1])/y[1],v=Math.hypot(y[0],y[1],y[2]);return!(g>0)||g*v>o*ob?null:[u[0]+y[0]*g,e[1],u[2]+y[2]*g]}var oi=3,ob=4,Fl=.72,rb=.6;function ib(e,t,n){return e!=="auto"?e:n!==null&&t<n*rb?"pan":"orbit"}function Dl(e,t){let n=Math.sin(t),o=-n*Math.sin(e),r=-Math.cos(t),i=-n*Math.cos(e);if(Math.abs(r)>.999)return null;let a=-i,s=o,c=Math.hypot(a,s);return a/=c,s/=c,{fx:o,fy:r,fz:i,rx:a,rz:s,ux:-s*r,uy:s*o-a*i,uz:a*r}}var ab=.4;function sb(e,t,n,o,r,i){let a=[e.center[0],e.center[1],e.center[2]],s=i(a),c=e.fitPoints,l=Dl(o,r);if(!c||c.length<9||!l)return{center:a,distance:s};let{fx:u,fy:m,fz:h,rx:f,rz:d,ux:p,uy:b,uz:y}=l,g=Math.hypot(u,h),v=u/g,P=h/g,w=v*p+P*y,x=ab*Math.max(1,e.radius);for(let S=0;S<3;S++){let A=1/0,M=-1/0,E=1/0,T=-1/0;for(let B=0;B+2<c.length;B+=3){let F=c[B]-a[0],N=c[B+1]-a[1],V=c[B+2]-a[2],H=s+F*u+N*m+V*h;if(!(H>.001))continue;let L=(F*f+V*d)/(H*t),G=(F*p+N*b+V*y)/(H*n);L<A&&(A=L),L>M&&(M=L),G<E&&(E=G),G>T&&(T=G)}if(!Number.isFinite(A))break;let k=(A+M)/2*s*t,_=Math.abs(w)>.1?(E+T)/2*s*n/w:0,R=k*f+_*v,C=k*d+_*P;if(Math.hypot(a[0]+R-e.center[0],a[2]+C-e.center[2])>x){let B=a[0]-e.center[0],F=a[2]-e.center[2],N=B+R,V=F+C,H=x/Math.hypot(N,V);R=N*H-B,C=V*H-F}a=[a[0]+R,a[1],a[2]+C],s=i(a)}return{center:a,distance:s}}var ri=class{constructor(t,n,o,r){this.fovY=Tl;this.target=new oo.Vec3;this.azimuth=-30*lt;this.polar=55*lt;this.distance=10;this.azT=-30*lt;this.polT=55*lt;this.distT=10;this.minDist=1;this.maxDist=100;this.envelope=null;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new oo.Vec3;this.panAnchor=new oo.Vec3;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.touchNavigation="classic";this.mapGesture=!1;this.hold=null;this.holdY=0;this.holdOnSeat=!1;this.touchStart=null;this.touchMoving=!1;this.twoStart=null;this.twoIntent="undecided";this.twistSoFar=0;this.twistTurning=!1;this.pair=null;this.catchingUp=!1;this.eventRect=null;this.venueFootprint=null;this.lastUpdateMs=0;this.wasMoving=!1;this.camera=new oo.Camera(t,{fov:Tl,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=o,this.onGesture=r,this.onPointerDown=i=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(i.pointerId)}catch{}if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.activePointers.size===1&&(this.mapGesture=this.touchNavigation==="map"&&(i.pointerType==="touch"||i.pointerType==="pen")),this.mapGesture){this.withEventRect(()=>this.mapTouchDown(i.clientX,i.clientY));return}if(this.activePointers.size===1){let a=this.dragAction(),s=a==="orbit"?"pan":"orbit",c=i.button===2||i.button===1||i.shiftKey?s:a;this.panning=c==="pan",this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let a=this.pinchCentroid();this.pinchCx=a.x,this.pinchCy=a.y}}},this.onPointerMove=i=>{if(!this.interactionEnabled||!this.activePointers.has(i.pointerId))return;let a=this.activePointers.get(i.pointerId);if(this.activePointers.set(i.pointerId,{x:i.clientX,y:i.clientY}),this.mapGesture){this.withEventRect(()=>this.mapTouchMove(i.clientX-a.x,i.clientY-a.y,i.pointerId));return}if(this.activePointers.size>=2){let u=this.currentPinchDistance(),m=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-u)*.005),m.x,m.y),this.fireGesture()),this.pinchDist=u;let h=this.currentPinchAngle(),f=h-this.pinchAngle;f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.pinchAngle=h,Math.abs(f)>1e-4&&Math.abs(f)<.5&&(this.azT+=f,this.fireGesture()),this.panBy(m.x-this.pinchCx,m.y-this.pinchCy),this.pinchCx=m.x,this.pinchCy=m.y;return}let s=i.clientX-this.lastX,c=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||c!==0)&&(this.panBy(s,c),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||c!==0)&&this.fireGesture();let l=Ll(s,c);this.azT+=l.azimuth,this.polT=Math.max(ti,Math.min(ni,this.polT+l.polar)),this.requestRender()},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1),this.mapGesture&&this.withEventRect(()=>this.mapTouchUp())},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let a=i.deltaMode===1?16:i.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,i.deltaY*a/100));this.dollyAt(Math.exp(s*.22),i.clientX,i.clientY),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let a=7*lt;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(ti,Math.min(ni,this.polT+(i.key==="ArrowUp"?-a:a)));else if(i.key==="+"||i.key==="=")this.dollyBy(ro);else if(i.key==="-"||i.key==="_")this.dollyBy(Zo);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let t=[...this.activePointers.values()];if(!t.length)return{x:0,y:0};let n=0,o=0;for(let r of t)n+=r.x,o+=r.y;return{x:n/t.length,y:o/t.length}}panBy(t,n){let o=this.canvas.clientHeight||1,r=2*this.distance*Math.tan(this.fovY*lt/2)/o,i=Math.sin(this.azimuth),a=Math.cos(this.azimuth),s=a,c=-i,l=Math.cos(this.polar),u=Math.sin(this.polar),m=-i*l,h=-a*l;this.targetT.x+=(-t*s+n*m)*r,this.targetT.z+=(-t*c+n*h)*r,this.targetT.y+=n*u*r,this.clampPan(),this.requestRender()}widenPanBox(t){if(!this.panBox){let n=Math.max(1,t.radius);this.venueFootprint=t.box?{minX:t.box.min[0],maxX:t.box.max[0],minZ:t.box.min[2],maxZ:t.box.max[2]}:{minX:t.center[0]-n,maxX:t.center[0]+n,minZ:t.center[2]-n,maxZ:t.center[2]+n}}this.panBox=tb(this.panBox,t.center,t.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let t=this.panLimit,n=this.panAnchor.x,o=this.panAnchor.y,r=this.panAnchor.z;this.targetT.x=Math.max(n-t,Math.min(n+t,this.targetT.x)),this.targetT.z=Math.max(r-t,Math.min(r+t,this.targetT.z)),this.targetT.y=Math.max(o-t*.5,Math.min(o+t,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchAngle(){let[t,n]=[...this.activePointers.values()];return t&&n?Math.atan2(n.y-t.y,n.x-t.x):0}dragAction(){return ib(this.primaryDragMode,this.distT,this.overviewDist)}currentPinchDistance(){let t=[...this.activePointers.values()];return t.length<2?0:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)}dollyBy(t){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*t)),this.requestRender()}dollyAt(t,n,o){let r=this.distT,i=this.canvas.getBoundingClientRect?.(),a=this.zoomPointResolver?.(n,o)??null;if(a){this.distT=Math.max(oi,Math.min(this.maxDist,this.distT*t)),this.minDist=Math.min(this.minDist,Math.max(oi,this.distT)),this.requestRender(),this.scaleTargetAbout(a,this.distT/r);return}let s=i&&i.width>0&&i.height>0?nb([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||i.width/i.height,(n-i.left)/i.width*2-1,1-(o-i.top)/i.height*2):null;this.dollyBy(t),s&&this.scaleTargetAbout(s,this.distT/r)}scaleTargetAbout(t,n){!Number.isFinite(n)||n===1||(this.targetT.x=t[0]+(this.targetT.x-t[0])*n,this.targetT.y=t[1]+(this.targetT.y-t[1])*n,this.targetT.z=t[2]+(this.targetT.z-t[2])*n,this.clampPan())}setZoomPointResolver(t){this.zoomPointResolver=t}zoomBy(t){this.interactionEnabled&&(this.dollyBy(t),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(t){this.primaryDragMode=t}setInteractionEnabled(t){this.interactionEnabled=t,!t&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0,this.endMapGesture())}setTouchNavigation(t){this.touchNavigation=t,t!=="map"&&this.endMapGesture()}get touchNavigationMode(){return this.touchNavigation}endMapGesture(){this.mapGesture=!1,this.hold=null,this.touchStart=null,this.touchMoving=!1,this.twoStart=null,this.pair=null,this.catchingUp=!1}withEventRect(t){this.eventRect=this.canvas.getBoundingClientRect?.()??null;try{t()}finally{this.eventRect=null}}steeredPose(){let t=this.eventRect??this.canvas.getBoundingClientRect?.();return{target:[this.targetT.x,this.targetT.y,this.targetT.z],azimuth:this.azT,polar:this.polT,distance:this.distT,fovYDeg:this.fovY,aspect:this.camera.aspect||(t&&t.height>0?t.width/t.height:1)}}ndc(t,n){let o=this.eventRect??this.canvas.getBoundingClientRect?.();return!o||!(o.width>0)||!(o.height>0)?null:{x:(t-o.left)/o.width*2-1,y:1-(n-o.top)/o.height*2}}takeHold(t,n){let o=this.ndc(t,n);this.hold=o?Da(this.steeredPose(),o.x,o.y,this.holdY):null}applySteered(){if(this.catchingUp){this.requestRender();return}this.target.copy(this.targetT),this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT,this.applyPosition(),this.requestRender()}steerTarget(t){let n=[this.targetT.x,this.targetT.y,this.targetT.z],o=this.venueFootprint?Il(t,n,this.venueFootprint,El(this.steeredPose())):t;this.targetT.set(o[0],o[1],o[2])}mapTouchDown(t,n){if(this.dragging=!1,this.panning=!1,this.activePointers.size===1){let o=this.zoomPointResolver?.(t,n)??null;this.holdY=o?o[1]:this.targetT.y,this.holdOnSeat=!!o,this.touchStart={x:t,y:n},this.touchMoving=!1,this.hold=null;return}if(this.activePointers.size===2){let[o,r]=[...this.activePointers.values()];this.twoStart=[{...o},{...r}],this.twoIntent="undecided",this.twistSoFar=0,this.twistTurning=!1,this.hold=null;let[i,a]=[...this.activePointers.keys()];this.pair=[i,a],this.touchMoving||(this.catchingUp=this.isSettling()),this.touchMoving=!0}}isSettling(){let t=Math.max(1e-4,this.distance*1e-4);return Math.abs(this.azT-this.azimuth)>1e-4||Math.abs(this.polT-this.polar)>1e-4||Math.abs(this.distT-this.distance)>1e-4||Math.abs(this.targetT.x-this.target.x)>t||Math.abs(this.targetT.y-this.target.y)>t||Math.abs(this.targetT.z-this.target.z)>t}rebasePair(){let t=[...this.activePointers.keys()],[n,o]=[...this.activePointers.values()];!n||!o||(this.pair=[t[0],t[1]],(this.twoIntent==="undecided"||!this.twoStart)&&(this.twoStart=[{...n},{...o}]),this.pinchDist=Math.hypot(o.x-n.x,o.y-n.y),this.pinchAngle=Math.atan2(o.y-n.y,o.x-n.x),this.pinchCy=(n.y+o.y)/2,this.hold=null,this.twoIntent==="free"&&this.takeHold((n.x+o.x)/2,(n.y+o.y)/2))}mapTouchMove(t,n,o){this.catchingUp&&!this.isSettling()&&(this.catchingUp=!1);let r=[...this.activePointers.values()];if(r.length>=2&&this.twoStart){let c=[...this.activePointers.keys()];if(o!==c[0]&&o!==c[1])return;this.mapTwoFingerMove(r[0],r[1]);return}let i=r[0];if(!i)return;if(!this.touchMoving){if(!this.touchStart||!Jr(i.x-this.touchStart.x,i.y-this.touchStart.y))return;this.touchMoving=!0,this.catchingUp=this.isSettling(),this.takeHold(i.x,i.y);return}let a=this.ndc(i.x,i.y),s=this.hold&&a?Na(this.steeredPose(),this.hold,a.x,a.y):null;if(s)this.steerTarget(s);else{let c=[this.targetT.x,this.targetT.y,this.targetT.z];this.panBy(t,n);let l=[this.targetT.x,this.targetT.y,this.targetT.z];this.targetT.set(c[0],c[1],c[2]),this.steerTarget(l),this.takeHold(i.x,i.y)}this.fireGesture(),this.applySteered()}mapTwoFingerMove(t,n){let o=(t.x+n.x)/2,r=(t.y+n.y)/2,i=Math.hypot(n.x-t.x,n.y-t.y),a=Math.atan2(n.y-t.y,n.x-t.x);if(this.twoIntent==="undecided"){if(this.twoIntent=Rl(this.twoStart,[t,n]),this.twoIntent==="undecided")return;this.pinchDist=i,this.pinchAngle=a;let[m,h]=this.twoStart,f=a-Math.atan2(h.y-m.y,h.x-m.x);f>Math.PI&&(f-=2*Math.PI),f<-Math.PI&&(f+=2*Math.PI),this.twistSoFar=Math.max(-ei,Math.min(ei,f)),this.pinchCy=r,this.twoIntent==="free"&&this.takeHold(o,r);return}if(this.twoIntent==="tilt"){this.polT=Math.max(ti,Math.min(ni,this.polT+Ll(0,r-this.pinchCy).polar)),this.pinchCy=r,this.fireGesture(),this.applySteered();return}let s=this.ndc(o,r);this.hold||this.takeHold(o,r);let c=this.hold&&s?Na(this.steeredPose(),this.hold,s.x,s.y):null;c&&this.steerTarget(c);let l=wl(this.pinchDist,i);if(this.pinchDist=i,l!==1){let m=this.distT,h=this.holdOnSeat?oi:this.minDist;this.distT=Math.max(Math.min(h,m),Math.min(this.maxDist,m*l)),this.holdOnSeat&&(this.minDist=Math.min(this.minDist,Math.max(oi,this.distT))),Number.isFinite(this.distT)||(this.distT=m);let f=this.distT/m;this.hold&&Number.isFinite(f)&&f!==1&&this.steerTarget([this.hold[0]+(this.targetT.x-this.hold[0])*f,this.hold[1]+(this.targetT.y-this.hold[1])*f,this.hold[2]+(this.targetT.z-this.hold[2])*f])}let u=a-this.pinchAngle;if(u>Math.PI&&(u-=2*Math.PI),u<-Math.PI&&(u+=2*Math.PI),this.pinchAngle=a,Math.abs(u)<.5){let m=Pl(this.twistSoFar,this.twistTurning,u);this.twistSoFar=m.soFar,this.twistTurning=m.turning,m.turn!==0&&(this.azT+=m.turn,this.hold&&this.steerTarget(Al([this.targetT.x,this.targetT.y,this.targetT.z],this.hold,m.turn)))}this.fireGesture(),this.applySteered()}mapTouchUp(){if(this.activePointers.size===0){this.endMapGesture();return}if(this.activePointers.size===1){let[n]=[...this.activePointers.values()];this.twoStart=null,this.pair=null,this.touchMoving=!0,this.takeHold(n.x,n.y);return}let t=[...this.activePointers.keys()];this.twoStart&&(!this.pair||this.pair[0]!==t[0]||this.pair[1]!==t[1])&&this.rebasePair()}frame(t,n=!1,o,r=!1,i){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t);let a=Math.max(1,t.radius),s=this.fovY*lt/2,c=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,l=Math.atan(Math.tan(s)*c);this.azT=o??-30*lt,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*lt;let u=this.framedOn(t,s,l),m=u.distance;this.target.set(u.center[0],u.center[1],u.center[2]),this.targetT.copy(this.target),this.distT=m*Math.max(1.05,Math.min(2,i?.margin??Ba)),this.envelope=Ol(this.envelope,a,m),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*lt,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(t){if(!(t>0)||!Number.isFinite(t))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let o=Math.min(n,1)/Math.min(t,1);this.distance*=o,this.distT*=o,this.overviewDist!==null&&(this.overviewDist*=o),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:t})}glideTo(t,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(t),this.targetT.set(t.center[0],t.center[1],t.center[2]);let o=this.fovY*lt/2,r=Math.atan(Math.tan(o)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*lt;let i=this.framedOn(t,o,r),a=i.distance;this.targetT.set(i.center[0],i.center[1],i.center[2]),this.distT=a*Math.max(1.05,Math.min(2,n?.margin??Ba)),this.envelope=Ol(this.envelope,Math.max(1,t.radius),a),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(t,n,o=!1,r){this.target.set(t.center[0],t.center[1],t.center[2]),this.targetT.copy(this.target),this.widenPanBox(t),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*lt/2,a=o?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(i)*a);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,r?.polarDeg??55))*lt;let c=this.framedOn(t,i,s);this.targetT.set(c.center[0],c.center[1],c.center[2]),this.distT=c.distance*Math.max(1.05,Math.min(2,r?.margin??Ba))}framedOn(t,n,o){return sb(t,Math.tan(o),Math.tan(n),this.azT,this.polT,r=>this.fitDistance({...t,center:r},n,o,this.azT,this.polT))}fitDistance(t,n,o,r,i){let a=Math.max(1,t.radius),s=Math.max(a/Math.tan(n),a/Math.tan(o)),c=t.box;if(!c)return s;let l=Dl(r,i);if(!l)return s;let{fx:u,fy:m,fz:h,rx:f,rz:d,ux:p,uy:b,uz:y}=l,g=Math.tan(o),v=Math.tan(n),P=1;for(let E=0;E<8;E++){let T=(E&1?c.max[0]:c.min[0])-t.center[0],k=(E&2?c.max[1]:c.min[1])-t.center[1],_=(E&4?c.max[2]:c.min[2])-t.center[2],R=T*u+k*m+_*h,C=Math.abs(T*f+_*d),O=Math.abs(T*p+k*b+_*y);P=Math.max(P,C/g-R,O/v-R)}let w=Math.min(s,Math.max(P,a*.35)),x=t.fitPoints;if(!x||x.length<9)return w;let S=0,A=1/(g*Fl),M=1/(v*Fl);for(let E=0;E+2<x.length;E+=3){let T=x[E]-t.center[0],k=x[E+1]-t.center[1],_=x[E+2]-t.center[2],R=T*u+k*m+_*h,C=Math.abs(T*f+_*d),O=Math.abs(T*p+k*b+_*y);S=Math.max(S,C*A-R,O*M-R)}return Math.min(w*1.5,Math.max(w*.55,S))}updateClipping(t){let n=this.camera.position.x-t.center[0],o=this.camera.position.y-t.center[1],r=this.camera.position.z-t.center[2],i=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),a=this.interactionEnabled&&Math.abs(i-this.distance)<=this.distance*.01,{near:s,far:c}=ub(Math.hypot(n,o,r),t.radius,a?this.distance:null);this.camera.perspective({near:s,far:c,aspect:this.camera.aspect})}update(){let t=this.azT-this.azimuth,n=this.polT-this.polar,o=this.distT-this.distance,r=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,a=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),c=Math.abs(t)>1e-4||Math.abs(n)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>s||Math.abs(i)>s||Math.abs(a)>s,l=typeof performance<"u"?performance.now():0,u=this.touchNavigation==="map"?_l(Cl,l-this.lastUpdateMs,this.wasMoving):Cl;return this.lastUpdateMs=l,this.wasMoving=c,this.azimuth+=t*u,this.polar+=n*u,this.distance+=o*u,this.target.x+=r*u,this.target.y+=i*u,this.target.z+=a*u,c&&this.applyPosition(),c}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let t=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,o=this.camera.position.z-this.target.z,r=Math.hypot(t,n,o)||1,i=Math.max(ti,Math.min(ni,Math.acos(Math.max(-1,Math.min(1,n/r)))));this.distance=this.distT=r,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(t,o)}snapshot(){let t=this.target.clone(),n=this.targetT.clone(),{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}=this,l=this.camera.position.clone(),u=[...this.camera.quaternion],m=this.camera.fov;return()=>{this.target.copy(t),this.targetT.copy(n),Object.assign(this,{azimuth:o,azT:r,polar:i,polT:a,distance:s,distT:c}),this.camera.position.copy(l),this.camera.quaternion.set(u[0],u[1],u[2],u[3]),this.camera.perspective({fov:m,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}setTarget(t){this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target)}resumeAfterFlight(t){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),t&&this.target.set(t[0],t[1],t[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let t=Math.sin(this.polar),n=this.target.x+this.distance*t*Math.sin(this.azimuth),o=this.target.y+this.distance*Math.cos(this.polar),r=this.target.z+this.distance*t*Math.cos(this.azimuth);this.camera.position.set(n,o,r),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}},cb=.1,lb=.25;function ub(e,t,n){let o=Math.max(1,t)*1.18,r=n==null?lb:Math.max(.05,n*cb),i=Math.max(r,e-o),a=Math.max(i+10,e+o);return{near:i,far:a}}var ii=class{constructor(t){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=t=>{let n=this.lastTime?(t-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=t,n>0){let r=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+r*.1:r}this.rendered++,this.frame(n)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=t}requestRender(){this.running||(this.running=!0,this.lastTime=0,this.rafId=requestAnimationFrame(this.tick))}stats(){return{fps:this.running?Math.round(this.fpsEma):0,rendered:this.rendered,idle:!this.running}}stop(){this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=0,this.running=!1}};function Nl(e){let t=!1;return n=>{n!==t&&(t=n,n?e.dataset.slReady="1":delete e.dataset.slReady)}}function Ha(e,t,n){return Math.max(t,Math.min(n,e))}function mb(e){return Ha(e,0,1)}function Bl(e){let t=mb(e);return t*t*(3-2*t)}var io=2.5,hb=1.15,qo=12,ao=22,Ga=30,Va=4,ai=8192;var jP=ao+Va;function Hl(e,t){let n=t*1.4,o=t*3.2;if(e<=n)return{scale:1,fade:0,minPixels:io};let r=Math.min(1,(e-n)/Math.max(.001,o-n));return{scale:1-r*.4,fade:r*.55,minPixels:io+r*(hb-io)}}function Gl(e,t,n){return!(e>0)||!(t>0)||!(n>0)?!1:t*n/e>=64}var fb=12;function Vl(e,t,n,o,r){if(!(e>0)||!(t>0)||!(n>0)||!(o>0)||!(r>0))return!1;let i=Math.tan(o/2*Math.PI/180);if(!(i>0))return!1;let a=t/(n*i)*(r/2);return Math.PI*a*a/e>=fb}var za=[{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"}],KP=new Map(za.map(e=>[e.key,e]));var db={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 si(e){let t=e?.[0];return t&&db[t]||"#3b82f6"}var pb=[{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"}],YP=new Map(pb.map(e=>[e.key,e]));var bb=["reference-focal","bar","entrance","exit","restroom","screen","sound","concession","coat","wall","rail","suite","obstruction"],$P=new Set(bb);var Ul=[{key:"circle",label:"Standard seat",shortLabel:"Standard",useCase:"General assigned seating",group:"general",path:null,bounds:null,mark:null},{key:"theatre",label:"Theatre chair",shortLabel:"Theatre",useCase:"Auditoriums, arenas and stadium stands",group:"fixed",path:"M4.5 3.5 Q4.5 1.5 6.5 1.5 L17.5 1.5 Q19.5 1.5 19.5 3.5 L19.5 13 L4.5 13 Z M3.5 12 L20.5 12 Q22.5 12 22.5 14 L22.5 21 Q22.5 22.5 21 22.5 Q19.5 22.5 19.5 21 L19.5 17.5 L4.5 17.5 L4.5 21 Q4.5 22.5 3 22.5 Q1.5 22.5 1.5 21 L1.5 14 Q1.5 12 3.5 12 Z",bounds:{x:1.5,y:1.5,width:21,height:21},mark:{x:12,y:10,radius:6}},{key:"dining",label:"Dining chair",shortLabel:"Dining",useCase:"Banquets, restaurants and table seating",group:"flexible",path:"M7 1 Q6 1 6 2.5 L6.75 10.5 L5 10.5 Q4 10.5 4 12 L4 14 Q4 15 5.25 15 L6 15 L4 23 L7 23 L9.5 15 L14.5 15 L17 23 L20 23 L18 15 L18.75 15 Q20 15 20 14 L20 12 Q20 10.5 19 10.5 L17.25 10.5 L18 2.5 Q18 1 17 1 Z",bounds:{x:4,y:1,width:16,height:22},mark:{x:12,y:10,radius:4.5}},{key:"folding",label:"Folding chair",shortLabel:"Folding",useCase:"Concert floors, ceremonies and conferences",group:"flexible",path:"M6 2 Q5 2 5 3 L6 8 L18 8 L19 3 Q19 2 18 2 Z M5 9 L19 9 Q20 9 20 10.5 L19 13 L5 13 L4 10.5 Q4 9 5 9 Z M6 12 L18 12 L18.5 23 L16 23 L15.5 13 L8.5 13 L8 23 L5.5 23 Z",bounds:{x:4,y:2,width:16,height:21},mark:{x:12,y:5,radius:3}},{key:"armchair",label:"Premium armchair",shortLabel:"Armchair",useCase:"Boxes, lounges and club seating",group:"premium",path:"M3.5 4 Q3.5 1.5 6 1.5 L18 1.5 Q20.5 1.5 20.5 4 L20.5 13 L3.5 13 Z M1.5 12.5 Q1.5 10 3.25 10 Q5 10 5 12.5 L5 13.5 L19 13.5 L19 12.5 Q19 10 20.75 10 Q22.5 10 22.5 12.5 L22.5 19.5 Q22.5 22 20 22 L4 22 Q1.5 22 1.5 19.5 Z",bounds:{x:1.5,y:1.5,width:21,height:20.5},mark:{x:12,y:7.5,radius:5.5}},{key:"recliner",label:"Recliner",shortLabel:"Recliner",useCase:"Luxury cinemas and premium clubs",group:"premium",path:"M7 2 Q7 1 8.5 1 L15.5 1 Q17 1 17 2 L19 13 L5 13 Z M4 9 Q2 9 2 11.5 L2 16 Q2 18 4 18 L6 18 L6 15 L18 15 L18 18 L20 18 Q22 18 22 16 L22 11.5 Q22 9 20 9 Q18 9 18 11 L18 13 L6 13 L6 11 Q6 9 4 9 Z M7 17 L17 17 Q18 17 18.5 18.5 L19.5 22.5 L4.5 22.5 L5.5 18.5 Q6 17 7 17 Z",bounds:{x:2,y:1,width:20,height:21.5},mark:{x:12,y:8,radius:5}},{key:"stool",label:"Stool",shortLabel:"Stool",useCase:"Bars, high-tops and seating rails",group:"flexible",path:"M6 2.5 L18 2.5 Q22 2.5 22 6.5 L22 12 Q22 16 18 16 L6 16 Q2 16 2 12 L2 6.5 Q2 2.5 6 2.5 Z M6 15.5 L9.5 15.5 L7.5 22.5 L3 22.5 Z M14.5 15.5 L18 15.5 L20.5 22.5 L16 22.5 Z",bounds:{x:2,y:2.5,width:20,height:20},mark:{x:12,y:9.25,radius:6.5}},{key:"bench",label:"Bench place",shortLabel:"Bench",useCase:"Pews, bleachers and terraces",group:"fixed",path:"M2.5 0.5 L21.5 0.5 Q23 0.5 23 2 L23 5 Q23 6.5 21.5 6.5 L2.5 6.5 Q1 6.5 1 5 L1 2 Q1 0.5 2.5 0.5 Z M2 7.5 L22 7.5 Q23.5 7.5 23.5 9 L23.5 15.5 Q23.5 17 22 17 L18 17 L18 21.5 Q18 22.5 16.75 22.5 Q15.5 22.5 15.5 21.5 L15.5 17 L8.5 17 L8.5 21.5 Q8.5 22.5 7.25 22.5 Q6 22.5 6 21.5 L6 17 L2 17 Q0.5 17 0.5 15.5 L0.5 9 Q0.5 7.5 2 7.5 Z",bounds:{x:.5,y:.5,width:23,height:22},mark:{x:12,y:12.25,radius:4.75}}],Wl=Ul.map(e=>e.key),gb=new Map(Ul.map(e=>[e.key,e]));function zl(e){return typeof e=="string"&&gb.has(e)}function jl(e,t){return zl(e)?e:zl(t?.seatGlyph)?t.seatGlyph:"circle"}var Me=.02291666666666667,kt=1/Me,yb=58,xb=yb*Me;var Mb=3,Xl=0,Ua=120,vb=0,Sb=45,wb=7,Yt=1.2;function Wa(e,t,n,o){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):o}function Pb(e){return!Number.isFinite(e)||!Number.isInteger(e)||e<0?0:e<=wb?e:Mb}function bn(e,t={}){let n=Wa(t.floorBaseHeightM,Xl,Ua,0),o=Math.min(Ua,n+Pb(e.elevation)*xb),r=e.height===void 0?o:Wa(e.height,Xl,Ua,o),i=Wa(e.rake,vb,Sb,0);return{height:r,rake:i}}var Yl=jt(require("earcut"),1),Ka=jt(require("polygon-clipping"),1);var tA=Math.PI/180;function ut(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function ja(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function Xa(e){let t=0,n=0;for(let r of e)t+=r.x,n+=r.y;let o=e.length||1;return{x:t/o,y:n/o}}function so(e){return e.length?Xa(e):null}function Rt(e){let t=0;for(let n=0,o=e.length;n<o;n+=1){let r=e[n],i=e[(n+1)%o];t+=r.x*i.y-i.x*r.y}return t/2}function Ye(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}var I=Me,Ab=.002;function Rb(e,t,n){let o=Math.hypot(t[0]-e[0],t[1]-e[1],t[2]-e[2]),r=Math.hypot(n[0]-t[0],n[1]-t[1],n[2]-t[2]),i=Math.hypot(e[0]-n[0],e[1]-n[1],e[2]-n[2]),a=Math.max(o,r,i);if(a<1e-9)return!0;let s=(o+r+i)/2;return 2*Math.sqrt(Math.max(0,s*(s-o)*(s-r)*(s-i)))/a<Ab}var er=-2,Fn=class{constructor(t=16384){this.len=0;this.buf=new Float32Array(t)}push3(t,n,o){this.len+3>this.buf.length&&this.grow(this.len+3),this.buf[this.len++]=t,this.buf[this.len++]=n,this.buf[this.len++]=o}push1(t){this.len+1>this.buf.length&&this.grow(this.len+1),this.buf[this.len++]=t}grow(t){let n=this.buf.length*2;for(;n<t;)n*=2;let o=new Float32Array(n);o.set(this.buf.subarray(0,this.len)),this.buf=o}get length(){return this.len}toArray(){return this.buf.slice(0,this.len)}},ui=class{constructor(){this.pos=new Fn;this.nor=new Fn;this.col=new Fn;this.flr=new Fn;this.mat=new Fn;this.currentFloor=0;this.currentMaterial=0}setFloor(t){this.currentFloor=t}setMaterial(t){this.currentMaterial=t}tri(t,n,o,r,i,a=i,s=i,c){if(Rb(t,n,o))return;this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(r[0],r[1],r[2]),this.col.push3(i[0],i[1],i[2]),this.col.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor);let l=this.currentMaterial;this.mat.push1(c?.[0]??l),this.mat.push1(c?.[1]??l),this.mat.push1(c?.[2]??l)}triN(t,n,o,r,i,a,s,c=s,l=s){[...t,...n,...o].every(Number.isFinite)&&(this.pos.push3(t[0],t[1],t[2]),this.pos.push3(n[0],n[1],n[2]),this.pos.push3(o[0],o[1],o[2]),this.nor.push3(r[0],r[1],r[2]),this.nor.push3(i[0],i[1],i[2]),this.nor.push3(a[0],a[1],a[2]),this.col.push3(s[0],s[1],s[2]),this.col.push3(c[0],c[1],c[2]),this.col.push3(l[0],l[1],l[2]),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.flr.push1(this.currentFloor),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial),this.mat.push1(this.currentMaterial))}get vertexCount(){return this.pos.length/3}build(){return{position:this.pos.toArray(),normal:this.nor.toArray(),color:this.col.toArray(),floor:this.flr.toArray(),material:this.mat.toArray(),count:this.pos.length/3}}};function Eb(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=n[0]-e[0],s=n[1]-e[1],c=n[2]-e[2],l=r*c-i*s,u=i*a-o*c,m=o*s-r*a,h=Math.hypot(l,u,m)||1;return l/=h,u/=h,m/=h,[l,u,m]}function Ib(e,t){let n=[...e],o=[];for(let a of e)o.push(a.x,a.y);let r=[];if(t){for(let a of t)if(!(a.length<3)){r.push(n.length);for(let s of a)n.push(s),o.push(s.x,s.y)}}let i=(0,Yl.default)(o,r.length?r:void 0,2);return{pts:n,tris:i}}function $t(e){return Rt(e)<0?[...e].reverse():e}var _b=3;function Cb(e,t,n,o){let r=o(e),i=o(t),a=o(n),s=(f,d,p,b)=>Math.abs(o({x:(f.x+d.x)/2,y:(f.y+d.y)/2})-(p+b)/2),c=(e.x+t.x+n.x)/3,l=(e.y+t.y+n.y)/3,u=(r+i+a)/3,m=Math.max(s(e,t,r,i),s(t,n,i,a),s(n,e,a,r),Math.abs(o({x:c,y:l})-u)),h=(f,d,p)=>{let b=Math.abs(o({x:(f+c)/2,y:(d+l)/2})-(p+u)/2);b>m&&(m=b)};return h((e.x+t.x)/2,(e.y+t.y)/2,(r+i)/2),h((t.x+n.x)/2,(t.y+n.y)/2,(i+a)/2),h((n.x+e.x)/2,(n.y+e.y)/2,(a+r)/2),m}function Qo(e,t,n,o,r){if(r<=0)return Cb(e,t,n,o);let i={x:(e.x+t.x)/2,y:(e.y+t.y)/2},a={x:(t.x+n.x)/2,y:(t.y+n.y)/2},s={x:(n.x+e.x)/2,y:(n.y+e.y)/2};return Math.max(Qo(e,i,s,o,r-1),Qo(i,t,a,o,r-1),Qo(s,a,n,o,r-1),Qo(i,a,s,o,r-1))}function Jo(e,t,n,o,r,i,a,s){if(a>0){let h={x:(t.x+n.x)/2,y:(t.y+n.y)/2},f={x:(n.x+o.x)/2,y:(n.y+o.y)/2},d={x:(o.x+t.x)/2,y:(o.y+t.y)/2};Jo(e,t,h,d,r,i,a-1,s),Jo(e,h,n,f,r,i,a-1,s),Jo(e,d,f,o,r,i,a-1,s),Jo(e,h,f,d,r,i,a-1,s);return}let c=[t.x*I,r(t),t.y*I],l=[n.x*I,r(n),n.y*I],u=[o.x*I,r(o),o.y*I];if(s){e.triN(c,l,u,s(t),s(n),s(o),i);return}let m=Eb(c,l,u);m[1]<0&&(m=[-m[0],-m[1],-m[2]]),e.tri(c,l,u,m,i)}var Tb=8;function Kl(e,t,n){if(!Number.isFinite(n))return e;let o=[],r=(i,a,s,c,l)=>{if(l>0){let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=t(u);if(Math.abs(m-(s+c)/2)>n){r(i,u,s,m,l-1),r(u,a,m,c,l-1);return}}o.push(i)};for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length];r(a,s,t(a),t(s),Tb)}return o}function ci(e,t){if(e.length<3)return e;let n=[];for(let r of e){let i=n[n.length-1];i&&Math.hypot(r.x-i.x,r.y-i.y)<t||n.push(r)}for(;n.length>2&&Math.hypot(n[0].x-n[n.length-1].x,n[0].y-n[n.length-1].y)<t;)n.pop();if(n.length<3)return e;let o=[];for(let r=0;r<n.length;r++){let i=o.length?o[o.length-1]:n[(r-1+n.length)%n.length],a=n[r],s=n[(r+1)%n.length],c=s.x-i.x,l=s.y-i.y,u=Math.hypot(c,l);u>t&&Math.abs((a.x-i.x)*l-(a.y-i.y)*c)/u<t||o.push(a)}return o.length>=3?o:n}var li=.001*kt*.1;function ue(e,t,n,o,r,i,a,s,c=1/0,l){if(!t||t.length<3||(c===void 0&&(c=1/0),Math.abs(Rt(t))<1e-4))return;let u=ci(Kl(ci($t(t),li),o,c),li),m=n?.map(x=>ci(Kl(ci($t(x),li),o,c),li)).filter(x=>x.length>=3&&Math.abs(Rt(x))>=1e-4),{pts:h,tris:f}=Ib(u,m),d=[i[0]*s.top,i[1]*s.top,i[2]*s.top],p=[i[0]*s.bottomCap,i[1]*s.bottomCap,i[2]*s.bottomCap],b=[a[0]*s.top,a[1]*s.top,a[2]*s.top],y=[a[0]*s.wallBottom,a[1]*s.wallBottom,a[2]*s.wallBottom],g=0;if(Number.isFinite(c))for(;g<_b;g++){let x=0;for(let S=0;S<f.length;S+=3){let A=Qo(h[f[S]],h[f[S+1]],h[f[S+2]],o,g);A>x&&(x=A)}if(x<=c)break}for(let x=0;x<f.length;x+=3){let S=h[f[x]],A=h[f[x+1]],M=h[f[x+2]];Jo(e,S,A,M,o,d,g,l);let E=[S.x*I,r,S.y*I],T=[A.x*I,r,A.y*I],k=[M.x*I,r,M.y*I];e.tri(E,k,T,[0,-1,0],p)}let v=x=>{if(g<=0)return x;let S=1<<g,A=[];for(let M=0;M<x.length;M++){let E=x[M],T=x[(M+1)%x.length];for(let k=0;k<S;k++){let _=k/S;A.push({x:E.x+(T.x-E.x)*_,y:E.y+(T.y-E.y)*_})}}return A},P=Xa(u),w=[{ring:v(u),flip:!1}];if(m)for(let x of m)x.length>=3&&w.push({ring:v(x),flip:!0});for(let{ring:x,flip:S}of w)for(let A=0;A<x.length;A++){let M=x[A],E=x[(A+1)%x.length],T=(E.x-M.x)*I,_=(E.y-M.y)*I,R=-T,C=Math.hypot(_,R)||1;_/=C,R/=C;let O=(M.x+E.x)/2-P.x,B=(M.y+E.y)/2-P.y,F=_*O+R*B;S&&(F=-F),F<0&&(_=-_,R=-R);let N=[_,0,R],V=[M.x*I,o(M),M.y*I],H=[E.x*I,o(E),E.y*I],L=[M.x*I,r,M.y*I],G=[E.x*I,r,E.y*I];e.tri(V,H,G,N,b,b,y),e.tri(V,G,L,N,b,y,y)}}function $l(e){let t=0;for(let c of e)t+=c.count;let n=new Float32Array(t*3),o=new Float32Array(t*3),r=new Float32Array(t*3),i=new Float32Array(t),a=new Float32Array(t),s=0;for(let c of e)n.set(c.position,s*3),o.set(c.normal,s*3),r.set(c.color,s*3),i.set(c.floor,s),a.set(c.material,s),s+=c.count;return{position:n,normal:o,color:r,floor:i,material:a,count:t}}function Zt(e,t,n=2.5){if(t<=0||e.length<3)return e;let o=$t(e),r=o.length,i=[];for(let s=0;s<r;s++){let c=o[s],l=o[(s+1)%r],u=l.x-c.x,m=l.y-c.y,h=Math.hypot(u,m)||1;i.push({x:m/h,y:-u/h})}let a=[];for(let s=0;s<r;s++){let c=o[s],l=i[(s-1+r)%r],u=i[s],m=l.x+u.x,h=l.y+u.y,f=Math.hypot(m,h),d=()=>{a.push([c.x+l.x*t,c.y+l.y*t]),a.push([c.x+u.x*t,c.y+u.y*t])};if(f<1e-9){d();continue}m/=f,h/=f;let p=m*l.x+h*l.y,b=1/Math.max(p,1e-6);if(!Number.isFinite(b)||b>n){d();continue}a.push([c.x+m*t*b,c.y+h*t*b])}if(a.length<3)return e;try{let s=Ka.default.union([[...a,a[0]]]),c=null,l=-1/0;for(let m of s){let h=Math.abs(Rt(m[0].map(([f,d])=>({x:f,y:d}))));h>l&&(l=h,c=m[0])}if(!c)return e;let u=c.map(([m,h])=>({x:m,y:h}));if(u.length>1){let m=u[0],h=u[u.length-1];Math.abs(m.x-h.x)<1e-9&&Math.abs(m.y-h.y)<1e-9&&u.pop()}return u.length>=3?u:e}catch{return e}}function Lt(e,t,n=2.5){if(e.length<3)return[];if(t<=0)return e;let o=$t(e),r=o.length,i=[];for(let c=0;c<r;c++){let l=o[c],u=o[(c+1)%r],m=Math.hypot(u.x-l.x,u.y-l.y)||1;i.push({x:-(u.y-l.y)/m,y:(u.x-l.x)/m})}let a=[],s=[];for(let c=0;c<r;c++){let l=o[c],u=i[(c-1+r)%r],m=i[c],h=u.x+m.x,f=u.y+m.y,d=Math.hypot(h,f),p=d<1e-9?1/0:1/Math.max(h/d*u.x+f/d*u.y,1e-6);if(!Number.isFinite(p)||p>n){a.push({x:l.x+u.x*t,y:l.y+u.y*t},{x:l.x+m.x*t,y:l.y+m.y*t}),s.push(c,c);continue}h/=d,f/=d,a.push({x:l.x+h*t*p,y:l.y+f*t*p}),s.push(c)}for(let c=0;c<a.length;c++){let l=(c+1)%a.length,u=s[c],m=s[l];if(m!==(u+1)%r)continue;let h=o[u],f=o[m];if((a[l].x-a[c].x)*(f.x-h.x)+(a[l].y-a[c].y)*(f.y-h.y)<=0)return[]}try{let c=Ka.default.intersection([[...a.map(d=>[d.x,d.y]),[a[0].x,a[0].y]]],[[...o.map(d=>[d.x,d.y]),[o[0].x,o[0].y]]]),l=null,u=0;for(let d of c){let p=Math.abs(Rt(d[0].map(([b,y])=>({x:b,y}))));p>u&&(u=p,l=d[0])}if(!l)return[];let m=l.map(([d,p])=>({x:d,y:p})),h=m[0],f=m[m.length-1];return m.length>1&&Math.abs(h.x-f.x)<1e-9&&Math.abs(h.y-f.y)<1e-9&&m.pop(),m.length>=3?$t(m):[]}catch{return[]}}function mi(e,t,n,o,r=28){let i=[];for(let a=0;a<r;a++){let s=a/r*Math.PI*2;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function tr(e,t,n,o){return[{x:e,y:t},{x:e+n,y:t},{x:e+n,y:t+o},{x:e,y:t+o}]}var cn=.22;function ql(e){let t=ct[e];return t==="sold"||t==="held"?1:0}var kb=.42,Zl=1.6;function Lb(e,t){let n=new Float32Array(e.length*4),o=Math.cos(Ea),r=0;for(let i=1;i<=e.length;i++){if(i<e.length&&e[i].rowId===e[r].rowId)continue;let a=i-r>=2&&!t?.has(e[r].rowId);for(let l=r;a&&l<i;l++)e[l].kind==="booth"&&(a=!1);for(let l=r+1;a&&l<i-1;l++){let u=e[l].x-e[l-1].x,m=e[l].y-e[l-1].y,h=e[l+1].x-e[l].x,f=e[l+1].y-e[l].y,d=Math.hypot(u,m)*Math.hypot(h,f);d>1e-9&&(u*h+m*f)/d<o&&(a=!1)}let s=[];for(let l=r+1;a&&l<i;l++){let u=Math.hypot(e[l].x-e[l-1].x,e[l].y-e[l-1].y);u>1e-6&&s.push(u)}s.sort((l,u)=>l-u);let c=s.length?s[Math.floor(s.length/2)]:0;for(let l=r;c>0&&l<i;l++){let u=b=>{let y=l+b;if(y<r||y>=i)return null;let g=e[y].x-e[l].x,v=e[y].y-e[l].y,P=Math.hypot(g,v);return P>1e-6?{x:g/P,y:v/P,gap:P}:null},m=u(1),h=u(-1),f=c/2,d=m??(h?{x:-h.x,y:-h.y,gap:1/0}:null);if(!d)continue;let p=m&&m.gap<c*Zl?m.gap/2:f;if(n[l*4]=d.x*p*I,n[l*4+1]=d.y*p*I,!h||h.gap>=c*Zl){let b=h??{x:-d.x,y:-d.y};n[l*4+2]=b.x*f*I,n[l*4+3]=b.y*f*I}}r=i}return n}function Ob(e){let t=e.length,n=new Float64Array(t);if(t<2)return n.fill(1/0),n;let o=1/0,r=1/0,i=-1/0,a=-1/0;for(let d of e)d.x<o&&(o=d.x),d.y<r&&(r=d.y),d.x>i&&(i=d.x),d.y>a&&(a=d.y);let s=Math.max(i-o,1e-6),c=Math.max(a-r,1e-6),l=Math.max(Math.sqrt(s*c/t),1e-6),u=Math.max(1,Math.ceil(s/l)+1),m=Math.max(1,Math.ceil(c/l)+1),h=new Map,f=(d,p)=>{let b=Math.min(u-1,Math.max(0,Math.floor((d-o)/l)));return Math.min(m-1,Math.max(0,Math.floor((p-r)/l)))*u+b};for(let d=0;d<t;d++){let p=f(e[d].x,e[d].y),b=h.get(p);b?b.push(d):h.set(p,[d])}for(let d=0;d<t;d++){let p=e[d],b=Math.min(u-1,Math.max(0,Math.floor((p.x-o)/l))),y=Math.min(m-1,Math.max(0,Math.floor((p.y-r)/l))),g=1/0;for(let v=1;v<=4;v++){for(let P=y-v;P<=y+v;P++)if(!(P<0||P>=m))for(let w=b-v;w<=b+v;w++){if(w<0||w>=u||v>1&&Math.abs(P-y)<v&&Math.abs(w-b)<v)continue;let x=h.get(P*u+w);if(x)for(let S of x){if(S===d)continue;let A=Math.hypot(e[S].x-p.x,e[S].y-p.y);A<g&&(g=A)}}if(Number.isFinite(g)&&g<=v*l)break}n[d]=g}return n}function Fb(e){let t=e.eyeHeightM;return Number.isFinite(t)?Math.max(0,t-Yt):0}function Ql(e,t,n,o,r,i,a){let s=e.length,c=new Float32Array(s*3),l=new Float32Array(s),u=new Float32Array(s*3),m=new Float32Array(s),h=new Float32Array(s),f=new Float32Array(s),d=new Float32Array(s),p=new Float32Array(s*3),b=new Map,y=Ob(e);for(let g=0;g<s;g++){let v=e[g],w=(n?.seatPitchU(g)??y[g])*I;m[g]=Number.isFinite(w)?Math.max(.06,Math.min(cn,w*kb)):cn,h[g]=qc(Number.isFinite(w)?w:void 0);let x=jl(v.glyph,{seatGlyph:i?.get(v.categoryKey)}),S=v.glyph!==void 0||i?.has(v.categoryKey);f[g]=Wl.indexOf(!S&&a?.has(v.rowId)?"dining":x),d[g]=v.wheelchairSpaceType==="no-seat"?0:1,c[g*3]=v.x*I,c[g*3+1]=n?n.seatDeckY(g):Fb(v),c[g*3+2]=v.y*I,l[g]=$o(t?t(v):"available");let A=Ie(r?.get(v.categoryKey)??"#6e7bff")??[.43,.48,1];if(u[g*3]=A[0],u[g*3+1]=A[1],u[g*3+2]=A[2],v.accessibility?.length){let M=Ie(si(v.accessibility));M&&(p[g*3]=M[0],p[g*3+1]=M[1],p[g*3+2]=M[2])}b.set(v.id,g)}return{count:s,iPosition:c,iState:l,iCategory:u,iMaxRadius:m,iRing:p,idToIndex:b,iChairWidth:h,iGlyph:f,iPhysicalSeat:d,iArmrests:Lb(e,a),iFloor:o??new Float32Array(s),iSection:new Float32Array(s).fill(-1),iYaw:new Float32Array(s)}}var Db=64;function Ya(e,t){let n=[];for(let a of t){let s=e.idToIndex.get(a.seatId);if(s===void 0)continue;let c=$o(a.state);e.iState[s]!==c&&(e.iState[s]=c,n.push(s))}if(!n.length)return[];n.sort((a,s)=>a-s);let o=[],r=n[0],i=n[0];for(let a=1;a<n.length;a++){let s=n[a];if(s!==i){if(s<=i+Db){i=s;continue}o.push({start:r,length:i-r+1}),r=s,i=s}}return o.push({start:r,length:i-r+1}),o}var nr=3,Dn=.38,or=.24;function Nb(e){if(e.length<3)return null;let t=e[0],n=e[Math.floor(e.length/2)],o=e[e.length-1],r=(n.x-t.x)*I,i=(n.y-t.y)*I,a=(o.x-t.x)*I,s=(o.y-t.y)*I,c=2*(r*s-i*a);if(Math.abs(c)<1e-7)return null;let l=r*r+i*i,u=a*a+s*s,m=(l*s-u*i)/c+t.x*I,h=(r*u-a*l)/c+t.y*I,f=Math.hypot(t.x*I-m,t.y*I-h);return f<1||f>200||!Number.isFinite(f)||e.some(d=>Math.abs(Math.hypot(d.x*I-m,d.y*I-h)-f)>.03)?null:{x:m,z:h,radius:f}}function Jl(e){let t=[],n=new Map,o=(c,l)=>`${Math.floor(c/nr)},${Math.floor(l/nr)}`;for(let c of e)for(let l of c.rows){for(let m of l.pts){let h=m.x*I,f=m.y*I,d=o(h,f),p=n.get(d)??[];p.push({x:h,z:f,y:l.y,floor:c.floorIndex}),n.set(d,p)}if(l.patch||l.pts.length<2)continue;let u=Nb(l.pts);for(let m of[0,l.pts.length-1]){let h=l.pts[m],f=l.pts[m===0?1:m-1],d=h.x-f.x,p=h.y-f.y,b=Math.hypot(d,p);b<1e-6||t.push({sectionId:c.sectionId,floorIndex:c.floorIndex,curve:u,row:l,point:h,x:h.x*I,z:h.y*I,dx:d/b,dz:p/b})}}let r=new Map;t.forEach((c,l)=>{let u=o(c.x,c.z),m=r.get(u)??[];m.push(l),r.set(u,m)});let i=(c,l)=>{let u=Math.floor(c/nr),m=Math.floor(l/nr);return[-1,0,1].flatMap(h=>[-1,0,1].map(f=>`${u+h},${m+f}`))},a=new Map;t.forEach((c,l)=>{let u=-1,m=1/0,h=!1;for(let f of i(c.x,c.z))for(let d of r.get(f)??[]){let p=t[d];if(c.sectionId===p.sectionId&&c.row.blockId===p.row.blockId||c.floorIndex!==p.floorIndex||Math.abs(c.row.y-p.row.y)>.05)continue;let b=p.x-c.x,y=p.z-c.z,g=Math.hypot(b,y);if(g<Dn*2+.45||g>nr)continue;let v=c.curve&&p.curve&&Math.hypot(c.curve.x-p.curve.x,c.curve.z-p.curve.z)<=.05&&Math.abs(c.curve.radius-p.curve.radius)<=.05,P=Math.min((b*c.dx+y*c.dz)/g,(-b*p.dx-y*p.dz)/g);(v?P<.8:P<.98)||!v&&(Math.abs(b*c.dz-y*c.dx)>.15||Math.abs(b*p.dz-y*p.dx)>.15)||(g<m-.02?(u=d,m=g,h=!1):Math.abs(g-m)<=.02&&(h=!0))}u>=0&&!h&&a.set(l,u)});let s=[];for(let[c,l]of a){if(c>=l||a.get(l)!==c)continue;let u=t[c],m=t[l],h=Math.hypot(m.x-u.x,m.z-u.z),f=(m.x-u.x)/h,d=(m.z-u.z)/h,p=!1;for(let y of i((u.x+m.x)/2,(u.z+m.z)/2))for(let g of n.get(y)??[]){if(g.floor!==u.floorIndex||Math.abs(g.y-u.row.y)>.75)continue;let v=(g.x-u.x)*f+(g.z-u.z)*d,P=Math.abs((g.x-u.x)*d-(g.z-u.z)*f);v>.01&&v<h-.01&&P<or+Dn&&(p=!0)}if(p)continue;let b=(y,g)=>({x:(u.x+f*y-d*g)/I,y:(u.z+d*y+f*g)/I});s.push({sections:[u.sectionId,m.sectionId],blocks:[u.row.blockId,m.row.blockId],floorIndex:u.floorIndex,ends:[u.point,m.point],clearWidthM:h-2*Dn,heightM:(u.row.y+m.row.y)/2,outline:[b(Dn,-or),b(h-Dn,-or),b(h-Dn,or),b(Dn,or)]})}return s}var Bb=.15,Hb=1.6;function eu(e){return Ha(e??1,Bb,Hb)}var $a={key:[1,1,1],ambient:[1,1,1]},tu=.5,Gb=[{id:"daylight",label:"Daylight",description:"Open air by day: pale concrete under a warm sun and a blue sky.",background:"#dce3e8",materials:{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87},light:{key:[1.05,1,.93],ambient:[.95,.99,1.06]},indoor:!1},{id:"floodlit",label:"Floodlit night",description:"A night match: dark sky, hard cool-white floodlights.",background:"#0c1420",materials:{deck:"#66727c",fascia:"#3a4a58",shell:"#4c6072",roughness:.84},light:{key:[1.08,1.08,1.12],ambient:[.8,.88,1.1]},indoor:!1},{id:"evening",label:"Evening",description:"A quiet dark hall: slate structure in a cool, even light.",background:"#17232e",materials:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87},light:{key:[1,.99,.96],ambient:[.94,.98,1.06]},indoor:!1},{id:"arena-show",label:"Arena show",description:"House lights down for a show: deep blue room, warm light on the floor.",background:"#10121c",materials:{deck:"#626a7a",fascia:"#383f52",shell:"#484f66",roughness:.82},light:{key:[1.08,.98,.88],ambient:[.8,.84,1.16]},indoor:!0},{id:"theatre",label:"Theatre house lights",description:"A warm auditorium before curtain-up: amber light, dark warm room.",background:"#1c1512",materials:{deck:"#74685c",fascia:"#4c4038",shell:"#5c4e44",roughness:.9},light:{key:[1.14,.98,.78],ambient:[1.04,.94,.84]},indoor:!0},{id:"concert-hall",label:"Concert hall",description:"A bright hall in pale wood and cream, softly warm.",background:"#e9e2d6",materials:{deck:"#d2c8b8",fascia:"#bcb0a0",shell:"#c8beae",roughness:.8},light:{key:[1.06,1,.9],ambient:[1.02,1,.95]},indoor:!0}],Vb=new Map(Gb.map(e=>[e.id,e])),nu="plain",ou=3e3;function ru(e,t){return e.openField?t?"daylight":"floodlit":e.openAir?t?"daylight":e.court?"floodlit":"evening":e.court||e.inTheRound||e.stage&&e.seatCount>ou?t?"daylight":"arena-show":e.stage?t?"concert-hall":"theatre":t?"daylight":"evening"}function iu(e){return e.openField||e.openAir?!1:e.indoorCourt?!0:e.stage&&!e.inTheRound&&!e.court&&e.standing<e.seatCount&&e.seatCount<=ou}function Za(e){return e&&Vb.get(e)||null}var zb=.15,Ub=.9,Wb=1.76;function jb(e,t,n){let o=e??Xb,r=(i,a,s)=>[Math.min(1,i[0]*a*s[0]),Math.min(1,i[1]*a*s[1]),Math.min(1,i[2]*a*s[2])];return rr(e)?{indoor:n,ceiling:r(o,1.02,t.light.ambient),wall:r(o,.9,t.light.ambient),lamp:r([.1,.1,.1],1,t.light.key)}:{indoor:n,ceiling:r(o,.7,t.light.ambient),wall:r(o,1.55,t.light.ambient),lamp:r([.92,.86,.74],1,t.light.key)}}var Xb=[.075,.09,.115];function au(e){return rr(e)?{zenith:[.36,.58,.84],horizon:[.82,.88,.94]}:{zenith:[.05,.08,.15],horizon:[.3,.38,.5]}}function rr(e){return!!e&&e[0]*.2126+e[1]*.7152+e[2]*.0722>.55}function Kb(){return{background:{top:[...On.top],bottom:[...On.bottom]},sky:au(null),structure:La,seatStates:{...bl},seatScale:1,materials:{seat:null,shell:null,roughness:.78},light:{key:[...$a.key],ambient:[...$a.ambient]},house:null}}function Yb(e){return rr(e)?{deck:"#c9ccc8",fascia:"#b4bab8",shell:"#c3c9c8",roughness:.87}:{deck:"#69747b",fascia:"#3e4d58",shell:"#526572",roughness:.87}}function su(e,t){let n=e?.venue3d?.look;if(n===nu)return{look:null,chosen:!0};let o=Za(n);return o?{look:o,chosen:!0}:t?{look:Za(ru(t,rr(Ie(e?.background)))),chosen:!1}:{look:null,chosen:!1}}function $b(e,t){let{look:n,chosen:o}=su(e,t);return Ie(e?.background)??(o?Ie(n?.background):null)}function cu(e,t){let n=Kb();e??={};let{look:o,chosen:r}=su(e,t);o&&(n.light={key:[...o.light.key],ambient:[...o.light.ambient]});let i=$b(e,t);if(o&&(n.house=jb(i,o,r?o.indoor:!!t&&iu(t))),i){n.background={top:oe(i,Ub),bottom:oe(i,Wb)},n.sky=au(i);let u={};for(let[h,f]of Object.entries(La))u[h]=we(f,i,zb);i[0]*.2126+i[1]*.7152+i[2]*.0722>.55&&(u.ground=oe(i,.86)),n.structure=u}let a=Ie(e.selectionColor)??Ie(e.accent);a&&(n.seatStates={...n.seatStates,selected:a});let s=e.seatScale;typeof s=="number"&&Number.isFinite(s)&&(n.seatScale=eu(s));let c=Object.fromEntries(Object.entries(e.venue3d??{}).filter(([u,m])=>m!=null&&u!=="look")),l={...Yb(i),...o?.materials,...c};if(l){let u=Ie(l.deck),m=Ie(l.fascia);u&&(n.structure={...n.structure,tierTop:u,gaTop:u}),m&&(n.structure={...n.structure,tierWall:m,gaWall:m}),n.materials.seat=Ie(l.seat),n.materials.shell=Ie(l.shell),typeof l.roughness=="number"&&Number.isFinite(l.roughness)&&(n.materials.roughness=Math.min(1,Math.max(0,l.roughness)))}return Zb(n,rr(i)),n}function Zb(e,t){let n=Ln(t);e.seatStates={...e.seatStates,held:Yr(n.unavailable),sold:Yr(n.unavailable),dimmed:Yr(n.dimmed)};let o=(i,a)=>kn(i,a,Math.min(Yo(i),$r)),r=e.structure;e.structure={...r,ground:o(r.ground,n.ground),tierTop:o(r.tierTop,n.deck),tierWall:o(r.tierWall,n.fascia)},e.materials.shell&&(e.materials.shell=o(e.materials.shell,n.shell))}function lu(e,t){let n=[];for(let o of t)n.push(...e.seatStates[o]);return n}var qb=new Set(["pitch-football","rink-hockey","track-athletics","oval-cricket","pitch-rugby","diamond-baseball","court-basketball","court-tennis","ring-boxing","track-motorsport"]),hu=new Set(["pitch-football","track-athletics","oval-cricket","pitch-rugby","diamond-baseball"]);function Et(e){return!!e&&qb.has(e)}function hi(e){return!!e&&hu.has(e)}var Qb="open-air",Jb=new Set([...hu,"court-tennis","track-motorsport",Qb]);function co(e){return!!e&&Jb.has(e)}var eg=new Set(["court-basketball","rink-hockey","ring-boxing"]);function fu(e){return!!e&&eg.has(e)}var qa=1.1;function du(e){return di(e)?e==="ring-boxing"?qa:.06:1}var tg={round:{width:6,height:6},"pitch-football":{width:105,height:68},"rink-hockey":{width:60,height:30},"track-athletics":{width:176.9,height:92.5},"oval-cricket":{width:150,height:140},"pitch-rugby":{width:120,height:70},"diamond-baseball":{width:140,height:140},"court-basketball":{width:32,height:19},"court-tennis":{width:36.57,height:18.29},"ring-boxing":{width:7.8,height:7.8},"track-motorsport":{width:300,height:15}},ng={"pitch-football":"#2f7d4f","rink-hockey":"#e8f1f8","track-athletics":"#a4472f","oval-cricket":"#3d8a53","pitch-rugby":"#2f7d4f","diamond-baseball":"#2f7d4f","court-basketball":"#c8894f","court-tennis":"#3f7a5a","ring-boxing":"#2a4d8f","track-motorsport":"#3b4048"};var pu="proscenium";var og=Math.PI*2;function rg(e,t,n,o,r,i){return{x:r+e*n-t*o,y:i+e*o+t*n}}function uu(e,t){let n=Math.max(0,e-t),o=[],r=20;for(let i=0;i<=r;i++){let a=-Math.PI/2+i/r*Math.PI;o.push({x:n+t*Math.cos(a),y:t*Math.sin(a)})}for(let i=0;i<=r;i++){let a=Math.PI/2+i/r*Math.PI;o.push({x:-n+t*Math.cos(a),y:t*Math.sin(a)})}return o}var mu=(()=>{let t={x:0,y:52},n=25,o={x:70,y:t.y-70},r=(o.x*o.x+o.y*o.y-4900)/(2*(o.y+70)),i=r+70,a=[],s=Math.atan2(o.y-r,o.x),c=Math.atan2(o.y-r,-o.x);for(let l=0;l<=24;l++){let u=s+(c-s)*l/24;a.push({x:i*Math.cos(u),y:r+i*Math.sin(u)})}return{half:70,home:t,backstop:n,fence:a}})();var fi="#f1f5f9";function di(e){return Et(e)}function gn(e,t,n,o,r=32){let i=[];for(let a=0;a<r;a++){let s=a/r*og;i.push({x:e+n*Math.cos(s),y:t+o*Math.sin(s)})}return i}function qt(e,t,n,o){return[{x:e-n,y:t-o},{x:e+n,y:t-o},{x:e+n,y:t+o},{x:e-n,y:t+o}]}function ig(e){let{kind:t,cx:n,cy:o,width:r,height:i}=e,a=(e.rotation??0)*Math.PI/180,s=Math.cos(a),c=Math.sin(a),l=r/2,u=i/2,m=[],h=tg[t],f=p=>h?p/h.width*r:0,d=p=>h?p/h.height*i:0;switch(t){case"pitch-football":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1}),m.push({points:gn(0,0,f(9.15),d(9.15)),closed:!0});for(let p of[-1,1])m.push({points:qt(p*(l-f(16.5)/2),0,f(16.5)/2,d(40.32)/2),closed:!0}),m.push({points:qt(p*(l-f(5.5)/2),0,f(5.5)/2,d(18.32)/2),closed:!0});break}case"rink-hockey":{m.push({points:[{x:0,y:-u},{x:0,y:u}],closed:!1,ink:"#d63b3b"});for(let p of[-1,1]){m.push({points:[{x:p*f(7.5),y:-u},{x:p*f(7.5),y:u}],closed:!1,ink:"#2f6ecb"}),m.push({points:[{x:p*(l-f(4)),y:-d(11)},{x:p*(l-f(4)),y:d(11)}],closed:!1,ink:"#d63b3b"});for(let b of[-1,1])m.push({points:gn(p*f(20.5),b*d(7),f(4.5),d(4.5)),closed:!0,ink:"#2f6ecb"})}m.push({points:gn(0,0,f(4.5),d(4.5)),closed:!0,ink:"#2f6ecb"});break}case"track-athletics":{let b=u-d(1.22)*8;b>0&&m.push({points:uu(l-f(1.22)*8,b),closed:!0,fill:"#2f7d4f"});for(let y=1;y<8;y++){let g=d(1.22)*y,v=u-g;if(v<=0)break;m.push({points:uu(l-f(1.22)*y,v),closed:!0})}break}case"oval-cricket":{m.push({points:gn(0,0,f(27.4),d(27.4+20.12/2),40),closed:!0}),m.push({points:qt(0,0,f(3.05)/2,d(20.12)/2),closed:!0,ink:"#d8cfae"});break}case"pitch-rugby":{let p=b=>({points:[{x:f(b),y:-u},{x:f(b),y:u}],closed:!1});m.push(p(0));for(let b of[-1,1]){m.push(p(b*50),p(b*28));for(let y=-35;y<35;y+=4)m.push({points:[{x:f(b*10),y:d(y)},{x:f(b*10),y:d(Math.min(35,y+2))}],closed:!1})}break}case"diamond-baseball":{let p=(O,B)=>({x:f(O),y:d(B)}),{home:b}=mu,y=27.43,g=y/Math.SQRT2,v={x:b.x+g,y:b.y-g},P={x:b.x,y:b.y-2*g},w={x:b.x-g,y:b.y-g},x={x:b.x,y:b.y-18.44},S="#b98a59",A=ng["diamond-baseball"],M=38.94,E=[p(b.x,b.y)],T=Math.atan2(b.y-M/Math.SQRT2-x.y,M/Math.SQRT2),k=Math.PI-T;for(let O=0;O<=16;O++){let B=T-(T+Math.PI*2-k)%(Math.PI*2)*(O/16);E.push(p(x.x+29*Math.cos(B),x.y+29*Math.sin(B)))}m.push({points:E,closed:!0,fill:S,ink:S});let _={x:b.x,y:b.y-g},R=[{x:b.x,y:b.y},v,P,w].map(O=>p(_.x+(O.x-_.x)*.84,_.y+(O.y-_.y)*.84));m.push({points:R,closed:!0,fill:A,ink:A}),m.push({points:gn(f(x.x),d(x.y),f(2.74),d(2.74),20),closed:!0,fill:S,ink:S}),m.push({points:gn(f(b.x),d(b.y),f(3.96),d(3.96),20),closed:!0,fill:S,ink:S});let C=mu.fence;m.push({points:[p(b.x,b.y),p(C[0].x,C[0].y)],closed:!1}),m.push({points:[p(b.x,b.y),p(C[C.length-1].x,C[C.length-1].y)],closed:!1});for(let O of[v,P,w])m.push({points:qt(f(O.x),d(O.y),f(.3),d(.3)),closed:!0,fill:fi});break}case"court-basketball":{m.push({points:qt(0,0,f(14),d(7.5)),closed:!0}),m.push({points:[{x:0,y:-d(7.5)},{x:0,y:d(7.5)}],closed:!1}),m.push({points:gn(0,0,f(1.8),d(1.8),24),closed:!0});for(let p of[-1,1]){let b=p*14,y=p*(14-5.8),g=p*(14-1.575);m.push({points:qt(f((b+y)/2),0,f(2.9),d(2.45)),closed:!0,fill:"#2f5d8a"}),m.push({points:gn(f(y),0,f(1.8),d(1.8),24),closed:!0});let v=Math.sqrt(6.75*6.75-6.6*6.6),P=[{x:f(b),y:-d(6.6)}],w=Math.atan2(-6.6,-p*v),x=2*Math.atan2(6.6,v);for(let S=0;S<=16;S++){let A=w-p*x*(S/16);P.push({x:f(g+6.75*Math.cos(A)),y:d(6.75*Math.sin(A))})}P.push({x:f(b),y:d(6.6)}),m.push({points:P,closed:!1})}break}case"court-tennis":{m.push({points:qt(0,0,f(11.885),d(5.485)),closed:!0,fill:"#2b5f99"});for(let p of[-1,1])m.push({points:[{x:-f(11.885),y:p*d(4.115)},{x:f(11.885),y:p*d(4.115)}],closed:!1}),m.push({points:[{x:p*f(6.4),y:-d(4.115)},{x:p*f(6.4),y:d(4.115)}],closed:!1});m.push({points:[{x:-f(6.4),y:0},{x:f(6.4),y:0}],closed:!1}),m.push({points:[{x:0,y:-d(6.4)},{x:0,y:d(6.4)}],closed:!1,ink:"#d1d5db"});break}case"ring-boxing":{m.push({points:qt(0,0,f(3.05),d(3.05)),closed:!0});let y=[[-1,-1,"#c53030"],[1,1,"#2b6cb0"],[1,-1,"#e2e8f0"],[-1,1,"#e2e8f0"]];for(let[g,v,P]of y)m.push({points:qt(g*f(3.05),v*d(3.05),f(.3),d(.3)),closed:!0,fill:P,ink:P});break}case"track-motorsport":{for(let y of[-1,1])m.push({points:[{x:-l,y:y*d(7)},{x:l,y:y*d(7)}],closed:!1});let b=90;m.push({points:qt(f(b),0,f(.6),d(7)),closed:!0,fill:"#f1f5f9"});for(let y=0;y<10;y++){let g=b-8*(y+1),v=y%2?2.6:-2.6;m.push({points:[{x:f(g),y:d(v-1.3)},{x:f(g),y:d(v+1.3)}],closed:!1})}break}default:return[]}return m.map(p=>({...p,points:p.points.map(b=>rg(b.x,b.y,s,c,n,o))}))}function Qa(e){if(e.role!=="stage"||!di(e.stageKind))return[];let t=null;if(e.x!=null&&e.y!=null&&e.width!=null&&e.height!=null&&e.width>0&&e.height>0&&[e.x,e.y,e.width,e.height].every(Number.isFinite))t={cx:e.x+e.width/2,cy:e.y+e.height/2,width:e.width,height:e.height};else if(e.points&&e.points.length>=3&&e.points.every(n=>Number.isFinite(n.x)&&Number.isFinite(n.y))){let n=e.points.map(u=>u.x),o=e.points.map(u=>u.y),r=Math.min(...n),i=Math.max(...n),a=Math.min(...o),s=Math.max(...o),c=Math.max(1,i-r),l=Math.max(1,s-a);t={cx:r+c/2,cy:a+l/2,width:c,height:l}}return t?ig({kind:e.stageKind,...t}):[]}var lo=Math.PI*2;function uo(e){return Number.isFinite(e.x)&&Number.isFinite(e.y)}function ag(e,t,n){let o=t-e;if(n){for(;o<0;)o+=lo;for(;o>=lo;)o-=lo}else{for(;o>0;)o-=lo;for(;o<=-lo;)o+=lo}return o}function yu(e){if(e.version!==1||e.closed!==!0||!uo(e.start)||!Array.isArray(e.segments)||e.segments.length<2||e.segments.length>512)return!1;let t=e.start;for(let n of e.segments){if(!n||!uo(n.end))return!1;if(n.kind==="line"){if(ut(t,n.end)<=1e-9)return!1}else if(n.kind==="bezier"){if(!uo(n.control1)||!uo(n.control2)||ut(t,n.end)<=1e-9)return!1}else if(n.kind==="arc"){if(!uo(n.center)||!Number.isFinite(n.radius)||n.radius<=1e-6||Math.abs(ut(t,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||Math.abs(ut(n.end,n.center)-n.radius)>Math.max(1e-4,n.radius*1e-4)||ut(t,n.end)<=1e-9)return!1}else return!1;t=n.end}return ut(t,e.start)<=1e-4}function sg(e,t,n){let o=1-n;return{x:o**3*e.x+3*o**2*n*t.control1.x+3*o*n**2*t.control2.x+n**3*t.end.x,y:o**3*e.y+3*o**2*n*t.control1.y+3*o*n**2*t.control2.y+n**3*t.end.y}}function xu(e,t=2){if(!yu(e))throw new Error("Section outline path is invalid");let n=Math.max(.25,t),o=[{...e.start}],r=e.start;for(let i of e.segments){if(i.kind==="line")o.push({...i.end});else if(i.kind==="arc"){let a=Math.atan2(r.y-i.center.y,r.x-i.center.x),s=Math.atan2(i.end.y-i.center.y,i.end.x-i.center.x),c=ag(a,s,i.clockwise),l=Math.max(2,Math.ceil(Math.abs(c)*i.radius/n));for(let u=1;u<=l;u+=1){let m=a+c*u/l;o.push({x:i.center.x+Math.cos(m)*i.radius,y:i.center.y+Math.sin(m)*i.radius})}}else{let a=ut(r,i.control1)+ut(i.control1,i.control2)+ut(i.control2,i.end),s=Math.max(2,Math.ceil(a/n));for(let c=1;c<=s;c+=1)o.push(sg(r,i,c/s))}r=i.end}return ut(o[o.length-1],o[0])<=1e-4&&o.pop(),o}var cg=45,Ja=150,lg=60;function ug(e){let t=cg/100;if(e<=t)return Ja;let n=Math.min(1,(e-t)/(1-t));return Ja-n*(Ja-lg)}var bu=.5523;function gu(e,t){return Math.abs(e.x-t.x)<=1e-6&&Math.abs(e.y-t.y)<=1e-6}function mg(e){let t=[],n=[];for(e.forEach((o,r)=>{uo(o)&&(t.length&&gu(t[t.length-1],o)||(t.push({x:o.x,y:o.y}),n.push(r)))});t.length>1&&gu(t[0],t[t.length-1]);)t.pop(),n.pop();return{points:t,sourceIndex:n}}var hg=.5,fg=4/3;function dg(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<=1e-9)return{kind:"line",end:{...t}};let a=-r/i,s=o/i,c=n*fg;return{kind:"bezier",control1:{x:e.x+o/3+a*c,y:e.y+r/3+s*c},control2:{x:e.x+o*2/3+a*c,y:e.y+r*2/3+s*c},end:{...t}}}function Mu(e,t){let{points:n,sourceIndex:o}=mg(e),r=n.length;if(r<3)return null;let i=Math.min(100,Math.max(0,t.cornerSmoothing??0))/100,a=t.edgeCurvature,s=new Array(r).fill(0);if(a?.length)for(let P=0;P<r;P+=1){let w=a[o[P]];s[P]=Number.isFinite(w)?Math.min(100,Math.max(-100,w))/100:0}let c=s.some(P=>Math.abs(P)>1e-6);if(i<=0&&!c)return null;let l=t.wideAngleThresholdDeg??ug(i),u=[];for(let P=0;P<r;P+=1)u[P]=ut(n[P],n[(P+1)%r]);let m=new Array(r).fill(0);for(let P=0;P<r;P+=1){let w=n[(P-1+r)%r],x=n[P],S=n[(P+1)%r],A={x:w.x-x.x,y:w.y-x.y},M={x:S.x-x.x,y:S.y-x.y},E=Math.hypot(A.x,A.y),T=Math.hypot(M.x,M.y);if(E<=1e-9||T<=1e-9)continue;let k=Math.min(1,Math.max(-1,(A.x*M.x+A.y*M.y)/(E*T))),_=Math.acos(k)*180/Math.PI;if(_<l)continue;let R=Bl((_-l)/(180-l));m[P]=i*R*.5*Math.min(E,T)}for(let P=0;P<r;P+=1){let w=(P+1)%r,x=m[P]+m[w];if(x>u[P]&&x>1e-9){let S=u[P]/x;m[P]*=S,m[w]*=S}}let h=new Array(r),f=new Array(r);for(let P=0;P<r;P+=1){let w=n[(P-1+r)%r],x=n[P],S=n[(P+1)%r];if(m[P]<=1e-6){h[P]={...x},f[P]={...x};continue}let A=ut(x,w)||1,M=ut(x,S)||1;h[P]={x:x.x+(w.x-x.x)/A*m[P],y:x.y+(w.y-x.y)/A*m[P]},f[P]={x:x.x+(S.x-x.x)/M*m[P],y:x.y+(S.y-x.y)/M*m[P]}}if(m.every(P=>P<=1e-6)&&!c)return null;let d=[],p={...f[0]},b=p,y=(P,w)=>{if(ut(b,P)<=1e-9)return;let x=s[w];Math.abs(x)>1e-6?d.push(dg(b,P,x*hg*u[w])):d.push({kind:"line",end:{...P}}),b=P};for(let P=1;P<=r;P+=1){let w=P%r,x=n[w];y(h[w],(P-1)%r),m[w]>1e-6&&ut(h[w],f[w])>1e-9&&(d.push({kind:"bezier",control1:ja(h[w],x,bu),control2:ja(f[w],x,bu),end:{...f[w]}}),b=f[w])}if(!d.length)return null;let g=d[d.length-1];ut(g.end,p)>1e-9&&(g.kind==="line"?g.end={...p}:d.push({kind:"line",end:{...p}}));let v={version:1,closed:!0,start:p,segments:d};return yu(v)?v:null}function vu(e,t){let n=1-t,o=n*n*n,r=3*n*n*t,i=3*n*t*t,a=t*t*t;return{x:o*e.start.x+r*e.control1.x+i*e.control2.x+a*e.end.x,y:o*e.start.y+r*e.control1.y+i*e.control2.y+a*e.end.y}}function Su(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[vu(e,.5)];let o=Array.from({length:n+1},(c,l)=>vu(e,l/n)),r=new Float64Array(o.length);for(let c=1;c<o.length;c+=1){let l=o[c].x-o[c-1].x,u=o[c].y-o[c-1].y;r[c]=r[c-1]+Math.hypot(l,u)}let i=r[r.length-1];if(i<=1e-9)return Array.from({length:t},()=>({...e.start}));let a=[],s=1;for(let c=0;c<t;c+=1){let l=i*c/(t-1);for(;s<r.length-1&&r[s]<l;)s+=1;let u=r[s-1],m=r[s],h=m===u?0:(l-u)/(m-u);a.push({x:o[s-1].x+(o[s].x-o[s-1].x)*h,y:o[s-1].y+(o[s].y-o[s-1].y)*h})}return a}function wu(e){let t=new Map,n=new Map;for(let o of e){if(o.type!=="row"||!o.segmentedRow)continue;let r=n.get(o.segmentedRow.groupId)??[];r.push(o),n.set(o.segmentedRow.groupId,r)}for(let[o,r]of n){let i=r.slice().sort((h,f)=>h.segmentedRow.componentIndex-f.segmentedRow.componentIndex),a=i[0]?.segmentedRow?.componentCount??0,s=i[0]?.segmentedRow;if(!s||!(a>=2&&i.length===a&&s?.boundaryBefore==="start"&&i.every((h,f)=>h.segmentedRow?.kind==="segmented-row-v1"&&h.segmentedRow.groupId===o&&h.segmentedRow.componentCount===a&&h.segmentedRow.componentIndex===f&&h.segmentedRow.repeatLabelOnComponents===s.repeatLabelOnComponents&&(f===0?h.segmentedRow.boundaryBefore==="start":h.segmentedRow.boundaryBefore!=="start")&&h.segmentedRow.displayLabel===s.displayLabel)))continue;let l=i.reduce((h,f)=>h+f.seatCount,0),u=0,m=0;for(let h of i)h.segmentedRow.boundaryBefore==="break"&&(u+=1),t.set(h.id,{groupId:o,adjacencyOffset:u,displayOffset:m,displayLabel:s.displayLabel,totalSeats:l,canonical:i[0],viewFromSeatUrl:s.viewFromSeatUrl,viewFromSeatMeta:s.viewFromSeatMeta,confidenceEvidence:s.confidenceEvidence}),u+=h.seatCount,m+=h.seatCount}return t}var pg="ABCDEFGHIJKLMNOPQRSTUVWXYZ";var bg="abcdefghijklmnopqrstuvwxyz";function gg(e,t){let n=t.length,o=e+1,r="";for(;o>0;){o-=1;let i=o%n;r=t[i]+r,o=Math.floor(o/n)}return r}function ir(e,t=!1){let n=t?bg:pg;return gg(Math.max(0,Math.floor(e)-1),n)}var yg=[[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 Pu(e){if(!Number.isFinite(e)||e<=0)return String(e);let t=Math.floor(e),n="";for(let[o,r]of yg)for(;t>=o;)n+=r,t-=o;return n}function xg(e){let t=new Array(e);return Array.from({length:e},(n,o)=>o).sort((n,o)=>Math.abs(2*n-(e-1))-Math.abs(2*o-(e-1))||n-o).forEach((n,o)=>t[n]=o),t}function es(e,t){let n=e.seatLabelStart??1,o=e.seatNumbering?.direction??"ltr",r=e.seatNumbering?.step??1,i=e.seatNumbering?.scheme??"decimal",a=e.seatNumbering?.prefix??"",s=e.seatNumbering?.endAt,c=e.seatCount;if(i==="updown"||i==="updown-descending"){let f=Math.ceil(c/2),d=i==="updown"?t<f?n+2*t:n-1+2*(c-t):t<f?n+2*(f-1-t):n+1+2*(t-f);return`${a}${d}`}let l=i==="odd"||i==="even"?2:r,u=s!=null&&Number.isFinite(s)?s-(c-1)*l:n,m=o==="center"?xg(c)[t]:o==="rtl"?c-1-t:t,h;switch(i){case"odd":{let f=u%2===1?u:u+1;h=String(f+m*2);break}case"even":{let f=u%2===0?u:u+1;h=String(f+m*2);break}case"roman":h=Pu(u+m*r);break;case"letters-upper":h=ir(u+m*r,!1);break;case"letters-lower":h=ir(u+m*r,!0);break;default:h=String(u+m*r);break}return`${a}${h}`}function Mg(e){return{...e.canonical,seatCount:e.totalSeats,label:e.displayLabel,displayLabel:e.displayLabel}}function Au(e,t,n){return n?.label??`${e.seatLabelBase??e.label}-${es(e,t)}`}function vg(e,t,n,o){if(o?.displayLabel)return null;if(e.seatDisplayLabelMode==="number"||!n)return{row:e.displayLabel||e.label,seat:es(e,t)};let r=Mg(n);return{row:n.displayLabel,seat:es(r,n.displayOffset+t)}}function ts(e,t,n,o){let r=vg(e,t,n,o);return r?e.seatDisplayLabelMode==="number"?r.seat:`${r.row}-${r.seat}`:o.displayLabel}function Ru(e,t){return`${e.label}-${t+1}`}function Sg(e,t,n){return e?.direction==="anticlockwise"?Math.max(0,t-1-n):n}function wg(e,t){let n=e.chairNumbering,o=n?.start??1,r=Sg(n,Math.max(0,Math.round(e.seatCount)),t);return n?.format==="letter"?ir(Math.max(1,o)+r):String(o+r)}function Eu(e,t){let n=wg(e,t);return(e.chairNumbering?.format??"table-number")==="table-number"?`${e.displayLabel??e.label}-${n}`:n}function Iu(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 mo(e,t,n){if(!e.length)return 1/0;if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=t-(i.x+u*s),h=n-(i.y+u*c);if(Math.abs(m)>=o||Math.abs(h)>=o)continue;let f=Math.hypot(m,h);f<o&&(o=f)}return o}function Pg(e){let t=0,n=0;for(let i of e)t+=i.x,n+=i.y;let o=e.length||1;t/=o,n/=o;let r=0;for(let i of e){let a=Math.hypot(i.x-t,i.y-n);a>r&&(r=a)}return{cx:t,cy:n,r}}function _u(e,t){return Math.hypot(e.cx-t.cx,e.cy-t.cy)-e.r-t.r}function ns(e,t){let n=1/0;for(let o of Iu(e)){let r=mo(t,o.x,o.y);r<n&&(n=r)}for(let o of Iu(t)){let r=mo(e,o.x,o.y);r<n&&(n=r)}return n}function Ag(e,t){if(e.length<3)return{pts:e,seatIndices:t};let n=0,o=0;for(let u of e)n+=u.x,o+=u.y;n/=e.length,o/=e.length;let r=-1,i=e[0];for(let u of e){let m=Math.hypot(u.x-n,u.y-o);m>r&&(r=m,i=u)}let a=i.x-n,s=i.y-o,c=Math.hypot(a,s);c>1e-9?(a/=c,s/=c):(a=1,s=0);let l=e.map((u,m)=>({p:u,i:m,t:(u.x-n)*a+(u.y-o)*s})).sort((u,m)=>u.t-m.t);return{pts:l.map(u=>u.p),seatIndices:l.map(u=>t[u.i])}}function os(e){let t=e.length;if(t<3)return null;let n=0,o=0;for(let g of e)n+=g.x,o+=g.y;n/=t,o/=t;let r=0,i=0,a=0,s=0,c=0,l=0,u=0;for(let g of e){let v=g.x-n,P=g.y-o;r+=v*v,a+=P*P,i+=v*P,s+=v*v*v,c+=P*P*P,l+=v*P*P,u+=P*v*v}let m=r*a-i*i;if(Math.abs(m)<1e-9)return null;let h=(s+l)/2,f=(c+u)/2,d=(h*a-f*i)/m,p=(f*r-h*i)/m,b=d+n,y=p+o;return!Number.isFinite(b)||!Number.isFinite(y)?null:{cx:b,cy:y}}var Rg=.15,Eg=.001;function Ig(e){let t=e[0],n=e[e.length-1],o=n.x-t.x,r=n.y-t.y,i=Math.hypot(o,r);if(!(i>1e-9))return 0;let a=0;for(let s of e){let c=Math.abs((s.x-t.x)*r-(s.y-t.y)*o)/i;c>a&&(a=c)}return a/i}function _g(e){if(e.length<2)return null;let t=e.map(w=>{let x=0,S=0;for(let A of w.pts)x+=A.x,S+=A.y;return{x:x/w.pts.length,y:S/w.pts.length}}),n=0,o=0;for(let w of t)n+=w.x,o+=w.y;n/=t.length,o/=t.length;let r=0,i=0,a=0;for(let w of t){let x=w.x-n,S=w.y-o;r+=x*x,i+=x*S,a+=S*S}let s=r+a,c=r*a-i*i,l=s/2+Math.sqrt(Math.max(0,s*s/4-c)),u,m;Math.abs(i)>1e-12?(u=l-a,m=i):r>=a?(u=1,m=0):(u=0,m=1);let h=Math.hypot(u,m);if(!(h>1e-12))return null;u/=h,m/=h;let f=0,d=0,p=0;for(let w of e){if(w.pts.length<2)continue;let x=w.pts[0],S=w.pts[w.pts.length-1],A=S.x-x.x,M=S.y-x.y,E=Math.hypot(A,M);if(!(E>1e-9))continue;let T=A/E,k=M/E;f+=(T*T-k*k)*E,d+=2*T*k*E,p+=E}if(p>0&&Math.hypot(f,d)>=Tg*p){let w=Math.atan2(d,f)/2;u=-Math.sin(w),m=Math.cos(w)}let b=1/0,y=-1/0,g=[];for(let w of e){let x=1/0,S=-1/0;for(let A of w.pts){let M=A.x*u+A.y*m;M<x&&(x=M),M>S&&(S=M),M<b&&(b=M),M>y&&(y=M)}g.push(S-x)}let v=y-b;return v>1e-9?(g.sort((w,x)=>w-x),g[Math.min(g.length-1,Math.floor(g.length*.9))]/v<=Cg?{x:u,y:m}:null):null}var Cg=.35,Tg=.8;function pi(e,t,n,o){let r=new Map;for(let x of n){let S=t[x],A=S.rowId||`__seat-${x}`,M=r.get(A);M||(M={pts:[],idx:[]},r.set(A,M)),M.pts.push({x:S.x,y:S.y}),M.idx.push(x)}if(!r.size)return{sectionId:e,rows:[],blockCount:0};let i=[];for(let[x,S]of r){let A=Ag(S.pts,S.idx),M=0;for(let E of A.pts)M+=Math.hypot(E.x-o.x,E.y-o.y);i.push({id:x,pts:A.pts,seatIndices:A.seatIndices,blockId:-1,ordinal:0,blockDepth:0,focalDistance:M/A.pts.length})}let a=i.map(x=>Pg(x.pts)),s=i.length<=256?i.length*(i.length-1)/2:0,c=s?new Float64Array(s):null;c?.fill(Number.NaN);let l=c?new Map(i.map((x,S)=>[x,S])):null,u=(x,S)=>(x>S&&([x,S]=[S,x]),x*(2*i.length-x-1)/2+(S-x-1)),m=(x,S)=>{if(!c)return ns(i[x].pts,i[S].pts);let A=u(x,S),M=c[A];if(!Number.isNaN(M))return M;let E=ns(i[x].pts,i[S].pts);return c[A]=E,E},h=(x,S)=>l?m(l.get(x),l.get(S)):ns(x.pts,S.pts),f=[];for(let x=0;x<i.length;x++){let S=1/0;for(let A=0;A<i.length;A++){if(x===A||_u(a[x],a[A])>=S)continue;let M=m(x,A);M<S&&(S=M)}Number.isFinite(S)&&f.push(S)}f.sort((x,S)=>x-S);let d=f.length?f[Math.floor(f.length/2)]:1,p=Math.max(d*1.8,1e-6),b=i.map(()=>[]);for(let x=0;x<i.length;x++)for(let S=x+1;S<i.length;S++)_u(a[x],a[S])>p||m(x,S)<=p&&(b[x].push(S),b[S].push(x));let y=0;for(let x=0;x<i.length;x++){if(i[x].blockId!==-1)continue;let S=y++,A=[x];for(i[x].blockId=S;A.length;){let M=A.pop();for(let E of b[M])i[E].blockId===-1&&(i[E].blockId=S,A.push(E))}}let g=new Map;for(let x of i){let S=g.get(x.blockId)??[];S.push(x),g.set(x.blockId,S)}let v=[];for(let x of i){if(x.pts.length<4||Ig(x.pts)<Eg)continue;let S=os(x.pts);S&&(!Number.isFinite(S.cx)||!Number.isFinite(S.cy)||v.push({x:S.cx,y:S.cy}))}let P=v.length>=2?(()=>{let x=v.map(M=>M.x).sort((M,E)=>M-E),S=v.map(M=>M.y).sort((M,E)=>M-E),A=Math.floor(v.length/2);return{cx:x[A],cy:S[A]}})():null;if(P){let x=k=>Math.hypot(k.x-P.cx,k.y-P.cy),S=1/0,A=-1/0,M=[];for(let k of i){let _=1/0,R=-1/0;for(let C of k.pts){let O=x(C);O<_&&(_=O),O>R&&(R=O)}M.push(R-_),_<S&&(S=_),R>A&&(A=R)}let E=A-S;M.sort((k,_)=>k-_);let T=M[Math.min(M.length-1,Math.floor(M.length*.9))];if(E>1e-9&&T/E<=Rg){let k=i.map(L=>{let G=0;for(let j of L.pts)G+=x(j);return{row:L,radius:G/L.pts.length}}),_=0,R=0;for(let L of k)_+=L.radius,R+=L.row.focalDistance;_/=k.length,R/=k.length;let C=0;for(let L of k)C+=(L.radius-_)*(L.row.focalDistance-R);if(C<0)for(let L of k)L.radius=-L.radius;let B=1/0;for(let L of k)L.radius<B&&(B=L.radius);k.sort((L,G)=>L.radius-G.radius);let F=-1,N=-1/0,V=E/Math.max(1,k.length)*.5,H=[];for(let L of k)L.radius-N>V&&(F++,N=L.radius),L.row.ordinal=F,L.row.blockDepth=L.radius-B,H.push(L.row);return{sectionId:e,rows:H,blockCount:y}}}let w=[];for(let[,x]of g){let S=_g(x);if(S){let A=k=>{let _=0;for(let R of k.pts)_+=R.x*S.x+R.y*S.y;return _/k.pts.length};x.sort((k,_)=>A(k)-A(_)),x.length>=2&&x[0].focalDistance>x[x.length-1].focalDistance&&x.reverse();let M=[],E=d*.5;for(let k of x){let _=M[M.length-1];_&&Math.abs(A(k)-A(_[0]))<E?_.push(k):M.push([k])}let T=0;for(let k=0;k<M.length;k++){if(k>0){let _=1/0;for(let R of M[k-1])for(let C of M[k])_=Math.min(_,h(R,C));_=Math.min(_,Math.abs(A(M[k][0])-A(M[k-1][0]))),T+=_}for(let _ of M[k])_.ordinal=k,_.blockDepth=T,w.push(_)}}else{let A=1/0;for(let M of x)M.focalDistance<A&&(A=M.focalDistance);x.sort((M,E)=>M.focalDistance-E.focalDistance);for(let M=0;M<x.length;M++)x[M].ordinal=M,x[M].blockDepth=Math.max(0,x[M].focalDistance-A),w.push(x[M])}}return{sectionId:e,rows:w,blockCount:y}}var kg=/^\d{4}-\d{2}-\d{2}$/;function Lg(e){let t=Date.parse(e);return Number.isFinite(t)?kg.test(e)?t+864e5:t:null}function Og(e,t=Date.now()){if(e.validUntil===void 0){if(e.status!=="approved")return!0;let o=e.assessedAt?Date.parse(e.assessedAt):Number.NaN;return Number.isFinite(o)&&(t instanceof Date?t.getTime():t)<=o+366*864e5}let n=Lg(e.validUntil);return n===null?!1:(t instanceof Date?t.getTime():t)<n}function Fg(e,t,n){return!(e.eventConfigurationId&&e.eventConfigurationId!==t||e.eventConfigurationVersion!==void 0&&e.eventConfigurationVersion!==n)}function Dg(e){return e.status!=="draft"&&e.status!=="retracted"}function Ng(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 Cu(e,t={}){return!!e&&Dg(e)&&Fg(e,t.activeConfigurationId,t.activeConfigurationVersion)&&Ng(e,t.activeBasisSha256)&&Og(e,t.now)}var Bg=/^data:image\/(?:png|jpe?g|webp|gif|avif);base64,[a-z0-9+/]+={0,2}$/i,Hg=/[\s"'<>`\\]/;function Gg(e){if(typeof e!="string"||!e||e.length>2e6||e!==e.trim())return!1;if(e.startsWith("data:"))return Bg.test(e);if(Hg.test(e))return!1;try{let t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password}catch{return!1}}function Tu(e){let t=e.trim();return Gg(t)?t:null}var rs="seatlayer.event-configuration/1";var ho=100,Vg=120,zg=2e5,Ug=1e4,Wg=/^[a-f0-9]{64}$/,jg=new Set(["stage","screen","barrier","camera_platform","sound_desk","rigging_truss"]);function ar(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Nn(e,t){return typeof e=="string"&&e.length>=1&&e.length<=t&&e.normalize("NFKC").trim()===e}function Xg(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}function ku(e){return!Array.isArray(e)||e.length>zg||!e.every(t=>Nn(t,ho))?null:[...new Set(e)].sort()}function Kg(e){return!ar(e)||!Nn(e.chartId,ho)||!Nn(e.version,ho)||e.sha256!==void 0&&(typeof e.sha256!="string"||!Wg.test(e.sha256))?null:{chartId:e.chartId,version:e.version,...typeof e.sha256=="string"?{sha256:e.sha256}:{}}}function is(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n}function Yg(e){return ar(e)?e.mode==="none"||e.mode==="opaque"?e.opacity===void 0?{mode:e.mode}:null:e.mode==="partial"&&is(e.opacity,.01,.99)?{mode:"partial",opacity:e.opacity}:null:null}function $g(e,t){if(e===void 0)return;if(!Array.isArray(e)||e.length>Ug)return null;let n=new Set(t),o=new Set,r=new Set,i=0,a=[];for(let s of e){if(!ar(s)||!Nn(s.id,ho)||!Nn(s.objectId,ho)||!n.has(s.objectId)||!jg.has(String(s.kind))||!is(s.heightM,.05,50)||s.baseElevationM!==void 0&&!is(s.baseElevationM,-10,100))return null;let c=Yg(s.occlusion);if(!c||o.has(s.id)||r.has(s.objectId))return null;let l=s.contentImageUrl===void 0?void 0:typeof s.contentImageUrl=="string"?Tu(s.contentImageUrl):null;if(s.contentImageUrl!==void 0&&(!l||s.kind!=="screen"||++i>1))return null;o.add(s.id),r.add(s.objectId),a.push({id:s.id,objectId:s.objectId,kind:s.kind,heightM:s.heightM,...s.baseElevationM!==void 0?{baseElevationM:s.baseElevationM}:{},occlusion:c,...l?{contentImageUrl:l}:{}})}return a.sort((s,c)=>s.id.localeCompare(c.id))}function Zg(e){let t=[];if(!ar(e))return{issues:[{code:"invalid_export",path:"configuration",message:"Configuration must be an object"}]};e.schema!==rs&&t.push({code:"unsupported_schema",path:"configuration.schema",message:`Configuration schema must be ${rs}`}),Nn(e.id,ho)||t.push({code:"invalid_id",path:"configuration.id",message:"Configuration id must contain 1 to 100 normalized characters"}),Nn(e.label,Vg)||t.push({code:"invalid_label",path:"configuration.label",message:"Configuration label must contain 1 to 120 normalized characters"}),Xg(e.version)||t.push({code:"invalid_version",path:"configuration.version",message:"Configuration version must be a positive integer"});let n=Kg(e.baseVenue);n||t.push({code:"invalid_base_venue",path:"configuration.baseVenue",message:"Base venue must identify one normalized chart id and exact version"});let o=ar(e.overlay)?e.overlay:null,r=ku(o?.objectIds),i=ku(o?.productionKillSeatIds),a=r?$g(o?.productionElements,r):null;return(!o||!r||!i)&&t.push({code:"invalid_overlay",path:"configuration.overlay",message:"Overlay ids must be bounded arrays of normalized stable ids"}),a===null&&t.push({code:"invalid_production_element",path:"configuration.overlay.productionElements",message:"Production elements must be unique, bounded semantics over referenced base-venue objects"}),t.length||!n||!r||!i||a===null?{issues:t}:{issues:t,value:{schema:rs,id:e.id,label:e.label,version:e.version,baseVenue:n,overlay:{objectIds:r,productionKillSeatIds:i,...a!==void 0?{productionElements:a}:{}}}}}function Lu(e){let t=Zg(e);return t.value?{ok:!0,value:t.value}:{ok:!1,issues:t.issues}}function qg(e){if((e.kind==="polygon"||e.kind==="polyline"||e.kind==="line")&&e.points&&e.points.length>=2)return e.kind==="polygon"?bi(e,6):e.points;if(e.x==null||e.y==null||e.width==null||e.height==null)return null;let t=e.x,n=e.y,o=e.width,r=e.height;return[{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r},{x:t,y:n+r}]}function Qg(e,t,n){let o=n*Math.PI/180,r=Math.cos(o),i=Math.sin(o),a=e.x-t.x,s=e.y-t.y;return{x:t.x+a*r-s*i,y:t.y+a*i+s*r}}function Ou(e){let t=qg(e);if(!t||t.length<2)return null;let n=e.rotation??0,o=Math.abs(n)<1e-6?t:t.map(c=>Qg(c,{x:t.reduce((l,u)=>l+u.x,0)/t.length,y:t.reduce((l,u)=>l+u.y,0)/t.length},n)),r=1/0,i=1/0,a=-1/0,s=-1/0;for(let c of o)r=Math.min(r,c.x),i=Math.min(i,c.y),a=Math.max(a,c.x),s=Math.max(s,c.y);return!Number.isFinite(r)||a-r<1e-6||s-i<1e-6?null:{minX:r,minY:i,maxX:a,maxY:s}}var Jg=5,ey=3,ty=.92,ny=1.9,oy=2,ry=.6,iy=1,ay=.06;function sy(e){return e.heightM!==void 0?e.heightM:e.stageKind==="ring-boxing"?qa:di(e.stageKind)?ay:iy}function Fu(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=-1/0;for(let a of Bu(e)){let s=a.baseHeightM??0;for(let c of a.objects){if(c.type!=="shape"||c.role!=="stage")continue;let l=Ou(c);l&&(t=Math.min(t,l.minX),n=Math.min(n,l.minY),o=Math.max(o,l.maxX),r=Math.max(r,l.maxY),i=Math.max(i,s+sy(c)))}}return!Number.isFinite(t)||!Number.isFinite(i)?null:{minX:t,minY:n,maxX:o,maxY:r,deckTopM:i}}function cy(e,t,n,o){let r=1/0,i=1/0,a=-1/0,s=-1/0;for(let f of e)Number.isFinite(f.eyeHeightM)&&(r=Math.min(r,f.x),a=Math.max(a,f.x),i=Math.min(i,f.y),s=Math.max(s,f.y));if(!Number.isFinite(r))return null;let c=r*t,l=i*t,u=Math.max(1,Math.ceil((a-r)*t/n)+1),m=Math.max(1,Math.ceil((s-i)*t/n)+1),h=new Float64Array(u*m).fill(-1/0);for(let f of e){if(!Number.isFinite(f.eyeHeightM))continue;let d=f.eyeHeightM-Yt,p=Math.min(u-1,Math.max(0,Math.floor((f.x*t-c)/n))),y=Math.min(m-1,Math.max(0,Math.floor((f.y*t-l)/n)))*u+p,g=d+o;g>h[y]&&(h[y]=g)}return{cellM:n,minX:c,minY:l,cols:u,rows:m,top:h}}function ly(e,t,n){let o=Math.floor((t-e.minX)/e.cellM),r=Math.floor((n-e.minY)/e.cellM);return o<0||r<0||o>=e.cols||r>=e.rows?-1/0:e.top[r*e.cols+o]}function Du(e,t,n={}){let o=new Map;if(!t||!e.length)return o;let r=n.metresPerChartUnit??Me,i=n.cellM??ry,a=n.chairBackM??ty,s=n.selfRowSkipM??oy,c=n.clearThreshold??.9,l=n.partialThreshold??.25,u=Math.max(1,n.columns??Jg),m=Math.max(1,n.rows??ey),h=cy(e,r,i,a);if(!h)return o;let f=(t.maxX-t.minX)*r,d=(t.maxY-t.minY)*r,p=f>=d,b=(t.minX+t.maxX)/2*r,y=(t.minY+t.maxY)/2*r,g=[];for(let P=0;P<u;P++){let w=(P+.5)/u-.5,x=p?b+w*f:b,S=p?y:y+w*d;for(let A=0;A<m;A++){let M=t.deckTopM+(m===1?0:A/(m-1)*ny);g.push({x,y:S,z:M})}}let v=i/2;for(let P of e){if(!Number.isFinite(P.eyeHeightM))continue;let w=P.x*r,x=P.y*r,S=P.eyeHeightM,A=0,M=1/0;for(let T of g){let k=T.x-w,_=T.y-x,R=Math.hypot(k,_);if(!(R>s)){A++;continue}let C=k/R,O=_/R,B=0;for(let F=s;F<R;F+=v){let N=ly(h,w+C*F,x+O*F);if(!(!Number.isFinite(N)||N>=S)&&N>S+(T.z-S)*F/R){B=F;break}}B?M=Math.min(M,B):A++}let E=A/g.length;E>=c||o.set(P.id,{seatId:P.id,mark:E<l?"obstructedView":"restrictedView",visibleFraction:E,totalRays:g.length,atDistanceM:Number.isFinite(M)?M:0})}return o}function Nu(e,t){if(!t.size)return 0;let n=0;for(let o of e){let r=t.get(o.id);if(!r)continue;let i=o.commercial;i?.restrictedView!==void 0||i?.obstructedView!==void 0||(o.commercial={...i,[r.mark]:!0},n++)}return n}function as(e){return e?e.accessibility?.length?e.wheelchairSpaceType&&!e.accessibility.includes("wheelchair")?["wheelchair",...e.accessibility]:e.accessibility:e.wheelchairSpaceType?["wheelchair"]:e.accessible?["wheelchair"]:[]:[]}var yi=Math.PI/180;var sr=16;function ss(e,t,n,o){let r=n*yi,i=Math.cos(r),a=Math.sin(r);return{x:o.x+e*i-t*a,y:o.y+e*a+t*i}}function ls(e){let{seatCount:t,seatSpacing:n,curve:o,rotation:r,origin:i}=e,a=[];if(e.path)return Su(e.path,t);if(t<=1)return t===1&&a.push({x:i.x,y:i.y}),a;if(o===0){for(let l=0;l<t;l++)a.push(ss(l*n,0,r,i));return a}let s=o/(t-1)*yi,c=n/(2*Math.sin(Math.abs(s)/2));for(let l=0;l<t;l++){let u=l*s,m=c*Math.sin(u),h=-c+c*Math.cos(u);a.push(ss(m,h,r,i))}return a}function us(e){let t=new Map;if(e.overrides)for(let n of e.overrides)t.set(n.index,n);return t}function uy(e,t){let n=us(e);return ls(e).map((o,r)=>{let i=n.get(r),a=as(i),s=Au(e,r,i),c={...e.commercial,...i?.commercial};return{index:r,x:o.x+(i?.dx??0),y:o.y+(i?.dy??0),label:s,displayLabel:ts(e,r,t,i),categoryKey:i?.categoryKey??e.categoryKey,skipped:!!i?.skip,accessible:a.length>0,accessibility:a,wheelchairSpaceType:i?.wheelchairSpaceType,commercial:Object.values(c).some(l=>l!==void 0&&l!==!1&&l!=="")?c:void 0,glyph:i?.glyph,viewUrl:i?.viewFromSeatUrl??e.viewFromSeatUrl,viewMeta:i?.viewFromSeatUrl?i.viewFromSeatMeta:e.viewFromSeatMeta,labelStyle:i?.labelStyle??e.seatLabelStyle}})}function my(e){let t=[];for(let n of uy(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 hy(e){if(e.seatCountsBySide)return{...e.seatCountsBySide};let t=e.sides&&e.sides.length?e.sides:["top","bottom"],n=["top","bottom","left","right"].filter(i=>t.includes(i)),o={top:0,bottom:0,left:0,right:0};if(!n.length)return o;let r=Math.max(0,Math.round(e.seatCount));for(let i=0;i<r;i++)o[n[i%n.length]]+=1;return o}function fy(e){let t=[],n=Math.max(0,Math.round(e.seatCount));if(n===0)return t;let o=new Map((e.overrides??[]).map(u=>[u.index,u])),r=(u,m,h,f)=>{let d=o.get(u),p=as(d),b=d?.label??Ru(e,u);return{index:u,label:b,displayLabel:d?.displayLabel??Eu(e,u),x:m+(d?.dx??0),y:h+(d?.dy??0),categoryKey:d?.categoryKey??e.categoryKey,skipped:!!d?.skip,accessible:p.length>0,accessibility:p,wheelchairSpaceType:d?.wheelchairSpaceType,commercial:d?.commercial,glyph:d?.glyph,viewUrl:d?.viewFromSeatUrl,viewMeta:d?.viewFromSeatUrl?d.viewFromSeatMeta:void 0,labelStyle:d?.labelStyle,...f?{side:f}:{}}};if(e.shape==="round"){let u=(e.radius??40)+sr,m=e.rotation*yi,h=Math.max(0,Math.min(360,e.seatArc??360));if(h>=360||n===1){for(let b=0;b<n;b++){let y=m+b/n*2*Math.PI;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let f=h*yi,d=(2*Math.PI-f)/2,p=m+d;for(let b=0;b<n;b++){let y=p+b/(n-1)*f;t.push(r(b,e.center.x+u*Math.cos(y),e.center.y+u*Math.sin(y)))}return t}let i=e.width??80,a=e.height??50,s=hy(e),c=["top","bottom","left","right"],l=0;for(let u of c){let m=s[u];for(let h=0;h<m;h++){let f,d;u==="top"?(f=-i/2+(h+.5)*i/m,d=-a/2-sr):u==="bottom"?(f=-i/2+(h+.5)*i/m,d=a/2+sr):u==="left"?(f=-i/2-sr,d=-a/2+(h+.5)*a/m):(f=i/2+sr,d=-a/2+(h+.5)*a/m);let p=ss(f,d,e.rotation,e.center);t.push(r(l++,p.x,p.y,u))}}return t}function dy(e){return fy(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 py(e){return[{id:`${e.id}:0`,label:e.label,...e.displayLabel&&e.displayLabel!==e.label?{displayLabel:e.displayLabel}:{},x:e.center.x,y:e.center.y,rowId:e.id,categoryKey:e.categoryKey,kind:"booth",...e.commercial?.note?{commercial:{note:e.commercial.note}}:{}}]}function cs(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o].x,a=t[o].y,s=t[r].x,c=t[r].y;a>e.y!=c>e.y&&e.x<(s-i)*(e.y-a)/(c-a)+i&&(n=!n)}return n}function zu(e,t){return t.some((n,o)=>{let r=t[(o+1)%t.length],i=(e.y-n.y)*(r.x-n.x)-(e.x-n.x)*(r.y-n.y);if(Math.abs(i)>1e-7)return!1;let a=(e.x-n.x)*(r.x-n.x)+(e.y-n.y)*(r.y-n.y),s=(r.x-n.x)**2+(r.y-n.y)**2;return a>=-1e-7&&a<=s+1e-7})}function cr(e){return Array.isArray(e)?e.filter(t=>Array.isArray(t)&&t.length>=3):[]}function mt(e,t,n){return cs(e,t)&&!cr(n).some(o=>cs(e,o)||zu(e,o))}function gi(e){if(!e.length)return{x:0,y:0};let t=0,n=0;for(let o of e)t+=o.x,n+=o.y;return{x:t/e.length,y:n/e.length}}function Uu(e){switch(e.type){case"row":{let t=ls(e),n=us(e),o=0,r=0,i=0;for(let a=0;a<t.length;a++){let s=n.get(a);s?.skip||(o+=t[a].x+(s?.dx??0),r+=t[a].y+(s?.dy??0),i++)}return i?{x:o/i,y:r/i}:{x:e.origin.x,y:e.origin.y}}case"table":case"booth":return{x:e.center.x,y:e.center.y};case"gaArea":return gi(e.points);case"section":return gi(e.outline);case"text":return{x:e.position.x,y:e.position.y};case"shape":return e.points&&e.points.length?gi(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 Hu(e,t){return e.length===t.length&&e.every((n,o)=>n.x===t[o].x&&n.y===t[o].y)}function by(e,t){if(e.type!=="gaArea"||!Hu(e.points,t.outline))return!1;let n=cr(e.holes),o=cr(t.holes);return n.length===o.length&&n.every((r,i)=>Hu(r,o[i]))}function gy(e,t,n=e.filter(r=>r.type==="section"),o=Uu(t)){let r="referenceInventorySource"in t?t.referenceInventorySource?.logicalSectionId:void 0;return(r?n.find(a=>(a.logicalSectionId??a.id)===r&&(by(t,a)||mt(o,a.outline,a.holes))):void 0)??n.find(a=>mt(o,a.outline,a.holes))??(t.type==="row"&&yy(t)?xy(t,n):void 0)}function yy(e){return(e.overrides??[]).some(t=>t.skip===!0)}function xy(e,t){let n=ls(e),o=us(e),r,i=0;for(let a of t){let s=0;for(let c=0;c<n.length;c++){let l=o.get(c);if(l?.skip)continue;let u={x:n[c].x+(l?.dx??0),y:n[c].y+(l?.dy??0)};mt(u,a.outline,a.holes)&&s++}s>i&&(r=a,i=s)}return r}function Bu(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 Gu(e,t,n,o,r,i,a,s,c){let l=[],u=e.filter(p=>p.type==="section"),m=wu(e),h=p=>!p?.eventConfigurationId||p.eventConfigurationId===o&&(p.eventConfigurationVersion===void 0||p.eventConfigurationVersion===c),f=p=>Cu(p,{activeConfigurationId:o,activeConfigurationVersion:c,activeBasisSha256:r,now:s}),d=(p,b)=>f(p)?{...p,coverage:b}:void 0;for(let p of e){let b=[];if(p.type==="row"?b=my(p):p.type==="table"?b=dy(p):p.type==="booth"&&(b=py(p)),!b.length)continue;for(let w of b)w.viewUrl&&!h(w.viewMeta)&&(w.viewUrl=void 0,w.viewMeta=void 0);if(p.type==="row"){let w=m.get(p.id);if(w){let x=new Map((p.overrides??[]).map(S=>[S.index,S]));for(let S of b){let A=Number(S.id.slice(S.id.lastIndexOf(":")+1));if(!Number.isInteger(A))continue;S.logicalRowId=w.groupId,S.logicalSeatIndex=w.adjacencyOffset+A,x.get(A)?.displayLabel||(S.displayLabel=ts(p,A,w)),!S.viewUrl&&w.viewFromSeatUrl&&h(w.viewFromSeatMeta)&&(S.viewUrl=w.viewFromSeatUrl,S.viewMeta=w.viewFromSeatMeta);let M=x.get(A)?.confidenceEvidence;S.confidenceEvidence=d(M,"exact-seat")??d(p.confidenceEvidence,"row-representative")??d(w.confidenceEvidence,"row-representative")}}}let y=gy(e,p,u,p.type==="row"?gi(b):Uu(p)),g=y?.viewFromSeatUrl,P=(y?.zone?t?.find(w=>w.id===y.zone):void 0)?.focalPoint??n;for(let w of b){if(!w.confidenceEvidence){let x=Number(w.id.slice(w.id.lastIndexOf(":")+1)),S=(p.type==="row"||p.type==="table")&&Number.isInteger(x)?p.overrides?.find(A=>A.index===x)?.confidenceEvidence:void 0;w.confidenceEvidence=d(S,"exact-seat")??(p.type==="row"?d(p.confidenceEvidence,"row-representative"):void 0)}w.confidenceEvidence??=d(y?.confidenceEvidence,"section-representative")??(a?d(a.evidence,a.coverage):void 0),!w.viewUrl&&g&&h(y?.viewFromSeatMeta)&&(w.viewUrl=g,w.viewMeta=y?.viewFromSeatMeta),!w.viewUrl&&i&&h(i.meta)&&(w.viewUrl=i.url,w.viewMeta=i.meta),y&&(w.sectionId=y.logicalSectionId??y.id),y?.zone&&(w.zoneId=y.zone),P&&(w.focalPoint={...P})}l.push(...b)}return l}function fo(e,t={}){if(e.floors?.length){let o=[];for(let r of e.floors){let i=r.focalPoint??e.focalPoint,a=r.viewFromSeatUrl?{url:r.viewFromSeatUrl,meta:r.viewFromSeatMeta}:e.viewFromSeatUrl?{url:e.viewFromSeatUrl,meta:e.viewFromSeatMeta}:void 0,s=r.confidenceEvidence?{evidence:r.confidenceEvidence,coverage:"floor-representative"}:e.confidenceEvidence?{evidence:e.confidenceEvidence,coverage:"venue-representative"}:void 0,c=Gu(r.objects,e.zones,i,e.eventConfigurationId,e.confidenceBasisSha256,a,s,t.now,t.eventConfigurationVersion??e.eventConfigurationVersion);t.resolveEyeHeights!==!1&&Vu(r.objects,r.focalPoint??e.focalPoint,r.baseHeightM??0,c);for(let l of c)l.floorId=r.id;for(let l of c)o.push(l)}return o}let n=Gu(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&&Vu(e.objects,e.focalPoint,t.floorBaseHeightM??0,n),My(e,n,t)}function My(e,t,n){return!n.deriveRestrictedView||e.derivedRestrictedView===!1||n.resolveEyeHeights===!1||Nu(t,Du(t,Fu(e))),t}function Vu(e,t,n,o){let r=e.filter(m=>m.type==="section"),i=n>0||r.some(m=>m.height!==void 0||m.rake!==void 0||(m.elevation??0)>0);if(!r.length||!i||!t){for(let m of o)m.eyeHeightM=n+Yt;return}let a=new Array(o.length),s=new Map;for(let m of r)s.has(m.id)||s.set(m.id,m);let c=new Map,l=new Map;for(let m=0;m<o.length;m++){let h=o[m],d=(h.sectionId?s.get(h.sectionId)??r.find(b=>b.logicalSectionId===h.sectionId&&mt({x:h.x,y:h.y},b.outline,b.holes)):void 0)??r.find(b=>mt({x:h.x,y:h.y},b.outline,b.holes))??null;if(a[m]=d,!d)continue;c.has(d.id)||c.set(d.id,bn(d,{floorBaseHeightM:n}));let p=l.get(d.id);p?p.push(m):l.set(d.id,[m])}let u=new Array(o.length).fill(void 0);for(let[m,h]of l){let f=c.get(m);if(!f)continue;let d=f.rake>0?Math.tan(f.rake*Math.PI/180):0,p=pi(m,o,h,t);for(let b of p.rows){let y=b.blockDepth*Me*d,g=f.height+y;for(let v of b.seatIndices)u[v]=g}}for(let m=0;m<o.length;m++){let h=o[m],f=a[m];if(!f){h.eyeHeightM=n+Yt;continue}let d=c.get(f.id);h.eyeHeightM=(u[m]??d.height)+Yt}}function vy(e){let t=e.points??[];if(e.kind!=="polygon"||t.length<3||!Array.isArray(e.edgeCurvature))return[];let n=t.map((o,r)=>{let i=e.edgeCurvature[r];return Number.isFinite(i)?Math.min(100,Math.max(-100,i)):0});return n.some(o=>Math.abs(o)>.5)?n:[]}function Sy(e){let t=vy(e);return t.length?Mu(e.points,{edgeCurvature:t}):null}function bi(e,t=2){let n=Sy(e);return n?xu(n,t):e.points??[]}function Wu(e){return e.kind==="polygon"?cr(e.holes):[]}function ju(e){let t=1/0,n=1/0,o=-1/0,r=-1/0,i=!1;for(let a of e)!Number.isFinite(a.x)||!Number.isFinite(a.y)||(i=!0,a.x<t&&(t=a.x),a.y<n&&(n=a.y),a.x>o&&(o=a.x),a.y>r&&(r=a.y));return i?{minX:t,minY:n,maxX:o,maxY:r}:null}function po(e,t){return e.minX<=t.maxX&&t.minX<=e.maxX&&e.minY<=t.maxY&&t.minY<=e.maxY}var hm=jt(require("polygon-clipping"),1);var se={top:1,wallBottom:.58,bottomCap:.4};function Bn(e,t){if(!e)return t;let n=oe(Xt(e,.4),.62);return we(t,n,.22)}function Xu(e,t){return e?we(t,oe(Xt(e,.25),.74),.62):t}var lr={full:[.72,.48],value:.8,spread:.52,paleLuma:.6},ms=[.24,.46,.82];function Ku(e){if(!e)return ms;let t=we(oe(e,1.42),ms,.08),n=Math.max(...t),o=n-Math.min(...t);if(n>=lr.full[0]&&o>=lr.full[1]||.2126*e[0]+.7152*e[1]+.0722*e[2]>=lr.paleLuma)return t;let r=Math.max(...e),i=Math.min(...e);if(r-i<.04)return ms;let a=s=>lr.value-lr.spread*(1-(s-i)/(r-i));return[a(e[0]),a(e[1]),a(e[2])]}function Yu(e,t){let n=Ln(Kt({tierTop:t}));return e?kn(e,n.sectionDeck,Math.min(n.sectionDeckChromaShare*Yo(e),n.sectionDeckChromaCap)):kn(t,n.deck,Math.min(Yo(t),$r))}function $u(e,t){let n=new Map;for(let i of e.categories??[])n.set(i.key,i.color);let o=new Map;for(let i of t){if(!i.sectionId)continue;let a=o.get(i.sectionId);a||(a=new Map,o.set(i.sectionId,a)),a.set(i.categoryKey,(a.get(i.categoryKey)??0)+1)}let r=new Map;for(let[i,a]of o){let s=0,c=0,l=0,u=0;for(let[m,h]of a){let f=Ie(n.get(m));f&&(s+=f[0]*h,c+=f[1]*h,l+=f[2]*h,u+=h)}u>0&&r.set(i,[s/u,c/u,l/u])}return r}function Zu(e,t){return Ie(e.color)??t.get(e.logicalSectionId??e.id)??null}var ps=jt(require("polygon-clipping"),1);var ds=jt(require("polygon-clipping"),1);var qu=e=>Math.round(e*1e6)/1e6+0;function bo(e){let t=e.map(r=>({x:qu(r.x),y:qu(r.y)})).sort((r,i)=>r.x-i.x||r.y-i.y).filter((r,i,a)=>i===0||r.x!==a[i-1].x||r.y!==a[i-1].y);if(t.length<3)return t;let n=(r,i,a)=>{let s=i.x-r.x,c=i.y-r.y,l=a.x-r.x,u=a.y-r.y;return s*u-c*l>1e-6*Math.hypot(s,c)*Math.hypot(l,u)},o=r=>{let i=[];for(let a of r){for(;i.length>=2&&!n(i[i.length-2],i[i.length-1],a);)i.pop();i.push(a)}return i.pop(),i};return[...o(t),...o([...t].reverse())]}var tm=jt(require("earcut"),1);var wy=.58,Qu=.01,Ot=cn*1.5*kt,Py=.5,Ay=.6;function Ry(e,t){let n=e.length,o=[];for(let a=0;a<n;a++){let s=e[Math.max(0,a-1)],c=e[Math.min(n-1,a+1)],l=c.x-s.x,u=c.y-s.y,m=Math.hypot(l,u);if(m<1e-9){o.push([0,0]);continue}l/=m,u/=m,o.push([-u,l])}let r=0;for(let a=0;a<n;a++)r+=(e[a].x-t.x)*o[a][0]+(e[a].y-t.y)*o[a][1];return r<0?o.map(([a,s])=>[-a,-s]):o}function Ey(e,t){if(e.length<2||t<=0)return[...e];let n=[...e],o=(a,s)=>{let c=s.x-a.x,l=s.y-a.y,u=Math.hypot(c,l)||1;return{x:c/u,y:l/u}},r=o(n[1],n[0]),i=o(n[n.length-2],n[n.length-1]);return n.unshift({x:n[0].x+r.x*t,y:n[0].y+r.y*t}),n.push({x:n[n.length-1].x+i.x*t,y:n[n.length-1].y+i.y*t}),n}var Ju=Math.PI/12;function Iy(e){if(e.length<3)return[...e];let t=bo(e);return t.length>=3?t:[...e]}function nm(e,t){if(!e.length||!(t>0))return[];let n=Iy(e),o=(s,c,l,u)=>{let m=l-c;for(;m<0;)m+=Math.PI*2;for(;m>Math.PI*2;)m-=Math.PI*2;let h=Math.max(1,Math.ceil(m/Ju)),f=t/Math.cos(m/h/2);for(let d=0;d<=h;d++){let p=c+m*d/h;u.push({x:s.x+Math.cos(p)*f,y:s.y+Math.sin(p)*f})}};if(n.length<3){let s=0,c=0;for(let f of n)s+=f.x,c+=f.y;s/=n.length||1,c/=n.length||1;let l=0;for(let f of n)l=Math.max(l,Math.hypot(f.x-s,f.y-c));let u=[],m=Math.max(3,Math.ceil(Math.PI*2/Ju)),h=(l+t)/Math.cos(Math.PI/m);for(let f=0;f<m;f++){let d=f/m*Math.PI*2;u.push({x:s+Math.cos(d)*h,y:c+Math.sin(d)*h})}return u}let r=n.length,i=[];for(let s=0;s<r;s++){let c=n[s],l=n[(s+1)%r];i.push(Math.atan2(-(l.x-c.x),l.y-c.y))}let a=[];for(let s=0;s<r;s++)o(n[s],i[(s+r-1)%r],i[s],a);return sm(a)}function _y(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u<0?u=0:u>1&&(u=1);let m=Math.hypot(t-(i.x+u*s),n-(i.y+u*c));m<o&&(o=m)}return o}function xi(e){let t=e.map(r=>{let i=0,a=0;for(let l of r.pts)i+=l.x,a+=l.y;let s=r.pts.length||1;i/=s,a/=s;let c=0;for(let l of r.pts){let u=Math.hypot(l.x-i,l.y-a);u>c&&(c=u)}return{cx:i,cy:a,rad:c}}),n=r=>{let i=r.length;return i<=2?[...r]:[r[Math.floor(i*.25)],r[Math.floor(i*.5)],r[Math.floor(i*.75)]]},o=[];for(let r=0;r<e.length;r++){let i=n(e[r].pts),a=[],s=1/0,c=null;for(let u of i){let m=1/0;for(let h=0;h<e.length;h++){if(h===r||Math.abs(e[h].y-e[r].y)<.001)continue;let f=t[h],d=Math.hypot(u.x-f.cx,u.y-f.cy)-f.rad;if(d>=m&&d>=s)continue;let p=_y(e[h].pts,u.x,u.y);p<m&&(m=p),e[h].depth<e[r].depth&&p<s&&(s=p,c=e[h].y)}Number.isFinite(m)&&m>0&&a.push(m)}a.sort((u,m)=>u-m);let l=a.length?a[Math.floor(a.length/2)]:1;o.push({pitch:l,belowY:c})}return o}function om(e,t,n,o){let r=e[t],i=r.pts.length>=2?[...r.pts]:r.pts.length===1?(()=>{let u=r.pts[0],m=u.x-o.x,h=u.y-o.y,f=Math.hypot(m,h)||1;m/=f,h/=f;let d=Math.max(n[t].pitch,.001)*.5;return[{x:u.x+h*d,y:u.y-m*d},{x:u.x-h*d,y:u.y+m*d}]})():[];if(i.length<2)return null;let a=0,s=0;for(let u=1;u<i.length;u++){let m=Math.hypot(i[u].x-i[u-1].x,i[u].y-i[u-1].y);m>1e-6&&(a+=m,s++)}let c=s>0?a/s:0,l=Ey(i,Math.max(c*Ay,Ot));return{pts:l,nrm:Ry(l,o),front:Math.max(n[t].pitch*wy,Ot),back:Math.max(n[t].pitch*Py,Ot)}}var go=1.5,rm=.3;function hs(e,t){if(e.length<3)return e;let n=e[0],o=e[e.length-1],r=o.x-n.x,i=o.y-n.y,a=Math.hypot(r,i),s=-1,c=-1;for(let m=1;m<e.length-1;m++){let h=e[m],f=a>1e-12?Math.abs((h.x-n.x)*i-(h.y-n.y)*r)/a:Math.hypot(h.x-n.x,h.y-n.y);f>s&&(s=f,c=m)}if(s<=t||c<0)return[n,o];let l=hs(e.slice(0,c+1),t),u=hs(e.slice(c),t);return[...l.slice(0,-1),...u]}function im(e,t){if(e.length<4)return e;let n=hs([...e,e[0]],t);return n.pop(),n.length>=3?n:e}function Cy(e){let t=e.map((o,r)=>{let i=e[(r+1)%e.length];return{a:o,b:i,i:r,minX:Math.min(o.x,i.x),maxX:Math.max(o.x,i.x),minY:Math.min(o.y,i.y),maxY:Math.max(o.y,i.y)}}).sort((o,r)=>o.minX-r.minX),n=(o,r,i)=>(r.x-o.x)*(i.y-o.y)-(r.y-o.y)*(i.x-o.x);for(let o=0;o<t.length;o++){let r=t[o];for(let i=o+1;i<t.length&&t[i].minX<=r.maxX;i++){let a=t[i];if(!(Math.abs(r.i-a.i)===1||Math.abs(r.i-a.i)===e.length-1||r.maxY<a.minY||a.maxY<r.minY)&&n(r.a,r.b,a.a)*n(r.a,r.b,a.b)<=0&&n(a.a,a.b,r.a)*n(a.a,a.b,r.b)<=0)return!0}}return!1}function am(e,t,n){if(e.length<2)return[];let o=n??xi(e),r=new Map;for(let a=0;a<e.length;a++){let s=r.get(e[a].blockId);s?s.push(a):r.set(e[a].blockId,[a])}let i=[];for(let[,a]of r){let s=[];for(let g of a){let v=e[g].patch;v&&v.length>=3?i.push({outline:[...v],holes:[],topY:e[g].y}):s.push(g)}if(!s.length)continue;s.sort((g,v)=>e[g].depth-e[v].depth);let l=s.map(g=>om(e,g,o,t)).filter(g=>g!==null);if(!l.length)continue;let u=(g,v)=>({x:g.pts[v].x-g.nrm[v][0]*(g.front+go),y:g.pts[v].y-g.nrm[v][1]*(g.front+go)}),m=(g,v)=>({x:g.pts[v].x+g.nrm[v][0]*(g.back+go),y:g.pts[v].y+g.nrm[v][1]*(g.back+go)}),h=l[0],f=l[l.length-1],d=[];for(let g=0;g<h.pts.length;g++)d.push(u(h,g));for(let g of l)d.push(m(g,g.pts.length-1));for(let g=f.pts.length-1;g>=0;g--)d.push(m(f,g));for(let g=l.length-1;g>=0;g--)d.push(u(l[g],0));let p=sm(d),b=1/0;for(let g of s)e[g].y<b&&(b=e[g].y);if(!Number.isFinite(b))continue;if(p.length>=3&&Math.abs(Rt(p))>1e-6&&l.every(g=>{let v=g.pts[Math.floor(g.pts.length/2)];return Ye(p,v.x,v.y)})&&!Cy(p)){i.push({outline:im(p,rm),holes:[],topY:b});continue}for(let g of Ty(l))i.push({outline:g,holes:[],topY:b})}return i}function Ty(e){let t=[];for(let n of e){let o=[],r=[],i=n.front+go,a=n.back+go;for(let c=0;c<n.pts.length;c++){let l=n.pts[c],u=n.nrm[c];o.push([l.x-u[0]*i,l.y-u[1]*i]),r.push([l.x+u[0]*a,l.y+u[1]*a])}let s=[...o,...r.reverse()];s.length<3||(s.push(s[0]),t.push([s]))}if(!t.length)return[];try{let n=ds.default.union(t[0],...t.slice(1)),o=[];for(let r of n){if(!r.length||r[0].length<4)continue;let i=r[0].map(([c,l])=>({x:c,y:l})),a=i[0],s=i[i.length-1];i.length>1&&Math.abs(a.x-s.x)<1e-9&&Math.abs(a.y-s.y)<1e-9&&i.pop(),i.length>=3&&o.push(im(i,rm))}return o}catch{return[]}}function sm(e){let t=[];for(let n of e){let o=t[t.length-1];o&&Math.hypot(n.x-o.x,n.y-o.y)<1e-9||t.push(n)}for(;t.length>2&&Math.hypot(t[0].x-t[t.length-1].x,t[0].y-t[t.length-1].y)<1e-9;)t.pop();return t}var fs=class{constructor(t){this.minX=1/0;this.minY=1/0;this.maxX=-1/0;this.maxY=-1/0;this.rings=t;for(let n of t)for(let o of n)o.x<this.minX&&(this.minX=o.x),o.y<this.minY&&(this.minY=o.y),o.x>this.maxX&&(this.maxX=o.x),o.y>this.maxY&&(this.maxY=o.y)}containsAll(t){for(let n of t)if(n.x<this.minX||n.x>this.maxX||n.y<this.minY||n.y>this.maxY)return!1;for(let n of this.rings){let o=!0;for(let r of t)if(!Ye(n,r.x,r.y)){o=!1;break}if(o)return!0}return!1}};function em(e,t,n,o,r,i){if(o.length<3)return;if(n.containsAll(o)){let l=[0,1,0],u=o[0];for(let m=1;m+1<o.length;m++){let h=o[m],f=o[m+1];e.tri([u.x*I,r,u.y*I],[h.x*I,r,h.y*I],[f.x*I,r,f.y*I],l,i)}return}let a=o.map(l=>[l.x,l.y]);a.push(a[0]);let s;try{s=ds.default.intersection([a],t)}catch{return}let c=[0,1,0];for(let l of s){if(!l.length||l[0].length<4)continue;let u=l[0],m=[],h=[];for(let d=0;d<u.length-1;d++)m.push(u[d][0],u[d][1]),h.push([u[d][0],u[d][1]]);if(h.length<3)continue;let f=(0,tm.default)(m,void 0,2);for(let d=0;d<f.length;d+=3){let p=h[f[d]],b=h[f[d+1]],y=h[f[d+2]];e.tri([p[0]*I,r,p[1]*I],[b[0]*I,r,b[1]*I],[y[0]*I,r,y[1]*I],c,i)}}}function cm(e,t,n,o,r,i,a){if(t.length<2)return;let s=a??xi(t),c=[0,1,0],l=i&&i.length>=3?[[...i.map(f=>[f.x,f.y]),[i[0].x,i[0].y]]]:null,u=i&&i.length>=3?new fs([[...i]]):null,m=f=>{e.setMaterial(2),f(),e.setMaterial(0)},h=f=>{e.setMaterial(3),f(),e.setMaterial(0)};for(let f=0;f<t.length;f++){let d=t[f];if(d.patch&&d.patch.length>=3){let w=[...d.patch],x=s[f].belowY??o;if(h(()=>{if(l&&u)em(e,l,u,w,d.y,r.tread);else{let S=w[0];for(let A=1;A+1<w.length;A++){let M=w[A],E=w[A+1];e.tri([S.x*I,d.y,S.y*I],[M.x*I,d.y,M.y*I],[E.x*I,d.y,E.y*I],c,r.tread)}}}),d.y>x+Qu){let S=0,A=0;for(let M of w)S+=M.x,A+=M.y;S/=w.length,A/=w.length,m(()=>{for(let M=0;M<w.length;M++){let E=w[M],T=w[(M+1)%w.length],k=T.x-E.x,_=T.y-E.y,R=Math.hypot(k,_);if(R<1e-6)continue;let C=_/R,O=-k/R;(E.x-S)*C+(E.y-A)*O<0&&(C=-C,O=-O);let B=[C,0,O],F=[E.x*I,d.y,E.y*I],N=[T.x*I,d.y,T.y*I],V=[E.x*I,x,E.y*I],H=[T.x*I,x,T.y*I];e.tri(F,N,H,B,r.riser),e.tri(F,H,V,B,r.riser)}})}continue}let p=om(t,f,s,n);if(!p)continue;let{pts:b,nrm:y,front:g,back:v}=p,P=s[f].belowY??o;for(let w=0;w+1<b.length;w++){let x=b[w],S=b[w+1],A=y[w],M=y[w+1];if(Math.hypot(S.x-x.x,S.y-x.y)<1e-6||A[0]===0&&A[1]===0||M[0]===0&&M[1]===0)continue;let E=[(x.x-A[0]*g)*I,d.y,(x.y-A[1]*g)*I],T=[(S.x-M[0]*g)*I,d.y,(S.y-M[1]*g)*I],k=[(x.x+A[0]*v)*I,d.y,(x.y+A[1]*v)*I],_=[(S.x+M[0]*v)*I,d.y,(S.y+M[1]*v)*I];if(h(()=>{l&&u?em(e,l,u,[{x:x.x-A[0]*g,y:x.y-A[1]*g},{x:S.x-M[0]*g,y:S.y-M[1]*g},{x:S.x+M[0]*v,y:S.y+M[1]*v},{x:x.x+A[0]*v,y:x.y+A[1]*v}],d.y,r.tread):(e.tri(E,T,_,c,r.tread),e.tri(E,_,k,c,r.tread))}),d.y>P+Qu){let R=[E[0],P,E[2]],C=[T[0],P,T[2]],O=[-A[0],0,-A[1]];m(()=>{e.tri(E,T,C,O,r.riser),e.tri(E,C,R,O,r.riser)})}}}}function ky(e,t){let n=e.eventConfigurationIds;return!n?.length||!!t&&n.includes(t)}function lm(e,t){return e.filter(n=>n.type!=="shape"||ky(n,t))}function ur(e,t){let n=e.focalPoint??{x:0,y:0};return e.floors?.length?e.floors.map((o,r)=>({objects:lm(o.objects,t),focal:{x:(o.focalPoint??n).x,y:(o.focalPoint??n).y},baseHeightM:o.baseHeightM??0,index:r})):[{objects:lm(e.objects,t),focal:n,baseHeightM:0,index:0}]}var Ly={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};function ln(e){return ju(e)??Ly}function um(e,t){let n=Zt(e.outline,Ot),o=ln(n),r=t.filter(a=>a!==e&&a.outline&&a.outline.length>=3&&po(o,ln(a.outline)));if(!r.length)return[n];let i=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s};try{let a=ps.default.difference([i(n)],...r.map(c=>[i(c.outline)])),s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s.length?s:[n]}catch{return[n]}}function mm(e,t){if(!t.length)return e;let n=i=>{let a=i.map(s=>[s.x,s.y]);return a.push(a[0]),a},o=t.map(i=>[n(i)]),r=[];for(let i of e){let a;try{a=ps.default.intersection([n(i.outline)],o.flat())}catch{r.push(i);continue}for(let s of a){if(!s.length)continue;let c=s[0].map(([l,u])=>({x:l,y:u}));if(c.length>1){let l=c[0],u=c[c.length-1];Math.abs(l.x-u.x)<1e-9&&Math.abs(l.y-u.y)<1e-9&&c.pop()}c.length>=3&&r.push({outline:c,holes:[],topY:i.topY})}}return r.length?r:e}function Oy(e,t){return e===void 0||t===void 0?!0:Math.abs(e-t)<.001}var Mi=class{constructor(){this.rings=[];this.boxes=[];this.levels=[]}subtract(t,n){let o=t.map(c=>[c.x,c.y]);if(o.length<3)return[];o.push(o[0]);let r=ln(t),i=this.rings.filter((c,l)=>po(r,this.boxes[l])&&Oy(n,this.levels[l])),a=[[o]];if(i.length)try{a=hm.default.difference([o],...i).map(l=>l.map(u=>u.map(([m,h])=>[m,h])))}catch{a=[[o]]}this.rings.push([o]),this.boxes.push(r),this.levels.push(n);let s=[];for(let c of a){if(!c.length)continue;let l=c[0].map(([u,m])=>({x:u,y:m}));if(l.length>1){let u=l[0],m=l[l.length-1];Math.abs(u.x-m.x)<1e-9&&Math.abs(u.y-m.y)<1e-9&&l.pop()}l.length>=3&&s.push(l)}return s}};function yo(e,t,n=e){if(!t)return e;let o=1/0,r=-1/0,i=1/0,a=-1/0;for(let h of n)o=Math.min(o,h.x),r=Math.max(r,h.x),i=Math.min(i,h.y),a=Math.max(a,h.y);let s=(o+r)/2,c=(i+a)/2,l=t*Math.PI/180,u=Math.cos(l),m=Math.sin(l);return e.map(h=>{let f=h.x-s,d=h.y-c;return{x:s+f*u-d*m,y:c+f*m+d*u}})}function fm(e){let t=Wu(e);return!t.length||!e.points?.length?[]:t.map(n=>yo(n,e.rotation,e.points))}function Pe(e){let t=null;if(e.kind==="polygon"&&e.points&&e.points.length>=3)return yo(bi(e,4),e.rotation,e.points);if(e.kind==="rect"&&e.width&&e.height&&(t=tr(e.x??0,e.y??0,e.width,e.height)),e.kind==="ellipse"&&e.width&&e.height){let n=(e.x??0)+e.width/2,o=(e.y??0)+e.height/2;t=mi(n,o,e.width/2,e.height/2)}return t?yo(t,e.rotation):null}function Gt(e){let t=e.role??"",o=t==="stage"?{kind:"stage",heightM:du(e.stageKind)}:{stage:{kind:"stage",heightM:1},entrance:{kind:"portal",heightM:2.7},exit:{kind:"portal",heightM:2.7},screen:{kind:"solid",heightM:6},wall:{kind:"solid",heightM:2.8},rail:{kind:"solid",heightM:1.1},suite:{kind:"suite",heightM:3},obstruction:{kind:"solid",heightM:4.5},sound:{kind:"solid",heightM:1.45},restroom:{kind:"solid",heightM:2.4},bar:{kind:"solid",heightM:1.1},concession:{kind:"solid",heightM:1.1},coat:{kind:"solid",heightM:1.1},goal:{kind:"portal",heightM:1.8}}[t]??{kind:"plate",heightM:.25};return{...o,heightM:e.heightM??o.heightM}}var Fy=.08,Dy=30,Ny=.015;function By(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function dm(e,t){let n=Pe(e)??(e.points?.length?yo(e.points,e.rotation):null),o=Gt(e),i=!e.role&&o.kind==="plate"&&e.heightM===void 0&&!!n&&Math.abs(Rt(n))*Me**2>=Dy?Ny:o.heightM;if(!n)return{topOffsetM:i,supportOffsetM:0};if(o.kind!=="plate"&&o.kind!=="stage")return{topOffsetM:i,supportOffsetM:0};let a=1/0,s=1/0,c=-1/0,l=-1/0;for(let f of n)a=Math.min(a,f.x),s=Math.min(s,f.y),c=Math.max(c,f.x),l=Math.max(l,f.y);let u=i,m=0,h=1e-6*Math.max(1,c-a,l-s);for(let f of t)c>f.minX&&a<f.maxX&&l>f.minY&&s<f.maxY&&u<=f.topOffsetM+1e-6&&(u=f.topOffsetM+Fy),a>=f.minX-h&&c<=f.maxX+h&&s>=f.minY-h&&l<=f.maxY+h&&(!f.poly||n.every(b=>By(b,f.poly)||Hy(b,f.poly,h)))&&(m=Math.max(m,f.topOffsetM));return e.fill&&e.fill!=="none"&&e.fill!=="transparent"&&t.push({minX:a,minY:s,maxX:c,maxY:l,topOffsetM:u,poly:n}),{topOffsetM:u,supportOffsetM:Math.min(m,u)}}function Hy(e,t,n){for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0;if(Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c))<=n)return!0}return!1}function yn(e,t,n){return{x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n}}function It(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 gt(e,t,n){return[yn(e[0],e[1],t),yn(e[0],e[1],n),yn(e[3],e[2],n),yn(e[3],e[2],t)]}function mr(e,t,n){return[yn(e[0],e[3],t),yn(e[1],e[2],t),yn(e[1],e[2],n),yn(e[0],e[3],n)]}function _e(e,t,n,o,r,i,a){ue(e,t,a?.length?a:void 0,()=>n,o,r,i,se)}var xo=12,Gy=1500,Vy=240,zy=.25;function Mo(e,t){if(!t.length)return!1;let n=0,o=0,r=0,i=new Set;for(let s of t)n+=s.x,o+=s.y,r+=Math.hypot(s.x-e.x,s.y-e.y),i.add(Math.floor(Math.atan2(s.y-e.y,s.x-e.x)*180/Math.PI/10));let a=Math.hypot(e.x-n/t.length,e.y-o/t.length);return i.size*10>Vy&&a<zy*(r/t.length)}function pm(e,t,n,o){let r=1/0,i=0;for(let a=0;a<e.length;a++){let s=e[a],c=e[(a+1)%e.length],l=c.x-s.x,u=c.y-s.y,m=n*u-o*l;if(Math.abs(m)<1e-12)continue;let h=((s.x-t.x)*u-(s.y-t.y)*l)/m,f=((s.x-t.x)*o-(s.y-t.y)*n)/m;h>0&&f>=0&&f<1&&(i+=1,r=Math.min(r,h))}return i%2===1?r:0}function bm(e,t){let n=e.stageKind??"";if(Et(n)||n==="round"||!t.length)return null;let o=Pe(e);if(!o||o.length<3)return null;let r={x:o.reduce((x,S)=>x+S.x,0)/o.length,y:o.reduce((x,S)=>x+S.y,0)/o.length},i=0,a=0;for(let x of t)i+=x.x,a+=x.y;let s=r.x-i/t.length,c=r.y-a/t.length,l=Math.hypot(s,c);if(l<1e-6||Mo(r,t))return null;let u=s/l,m=c/l,h=-m,f=u,d=-1/0,p=1/0,b=1/0,y=-1/0;for(let x of o){let S=(x.x-r.x)*u+(x.y-r.y)*m,A=(x.x-r.x)*h+(x.y-r.y)*f;d=Math.max(d,S),p=Math.min(p,S),b=Math.min(b,A),y=Math.max(y,A)}let g=(y-b)*I,v=(d-p)*I;if(g<3||v<1.5||g*v>Gy)return null;let P=(x,S)=>({x:r.x+u*x+h*S,y:r.y+m*x+f*S});return{poly:o,centre:r,ux:u,uy:m,vx:h,vy:f,back:d,front:p,left:b,right:y,widthM:g,depthM:v,at:P,box:(x,S,A,M)=>[P(x,A),P(x,M),P(S,M),P(S,A)]}}function xm(e){return e===pu}var Uy={heightShare:.6,heightMin:4.6,heightMax:10.5,heightFloor:2.6,ceilingClear:.5,pierShare:.075,pierMin:.45,pierMax:1.2,headerShare:.17,headerMin:.7,headerMax:1.6,riseShare:.1,riseMaxShare:.2,moulding:.11,cornice:.14,plinth:.4,fold:.34,foldsMin:10,foldsMax:56,swag:2.2,swagsMin:3,swagsMax:9,dropShare:.11,dropMin:.45,dropMax:1.1,fringe:.1,board:.28,boardsMax:96,boardEdge:.04,boardLift:.02,curtainClear:.12,fringeClear:.18,valanceClear:.24,valanceFringeClear:.3,archClear:.36,mouldingClear:.44},Wy=.18,jy=.2,Xy=.02,Ky=2.4,vi=[.2,.165,.145],gm=[.12,.1,.1],Si=[.5,.055,.075],wi=[.15,.012,.028],Yy=[.4,.04,.06],$y=[.13,.01,.024],Ft=[.8,.6,.24],Dt=[.46,.33,.12],Pi=[.36,.295,.225],vo=[.2,.165,.13],bs=[1,.62,.34],Zy=[.37,.25,.15],qy=[1,.87,.64];function Qy(e){let t=Math.sin(e*12.9898+4.1414)*43758.5453;return t-Math.floor(t)}function ym(e,t){let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length];i.across>t!=a.across>t&&n.push(i.along+(t-i.across)/(a.across-i.across)*(a.along-i.along))}n.sort((r,i)=>r-i);let o=[];for(let r=0;r+1<n.length;r+=2)o.push([n[r],n[r+1]]);return o}function Mm(e,t,n,o={}){let{poly:r,centre:i,ux:a,uy:s,vx:c,vy:l,back:u,front:m,left:h,right:f,widthM:d,at:p,box:b}=t,y=Uy,g=Wy/I,v=jy/I,P=o.maxTopY===void 0?1/0:o.maxTopY-y.ceilingClear-n,w=Math.max(y.heightFloor,Math.min(P,Math.max(y.heightMin,Math.min(y.heightMax,d*y.heightShare)))),x=n+w,S=Xy/I,A=u-2*g,M=u-g,E=h+g+v,T=f-g-v;for(let[ee,pe]of[[h+g,E],[T,f-g]])ue(e,b(A,M,ee,pe),void 0,()=>x,n,vi,vi,se);ue(e,b(A,M,E,T),void 0,()=>x,x-.3,vi,vi,se),ue(e,b(A+S,M-S,E,T),void 0,()=>n+Math.min(Ky,w-1),n,gm,gm,se);let k=r.map(ee=>({along:(ee.x-i.x)*a+(ee.y-i.y)*s,across:(ee.x-i.x)*c+(ee.y-i.y)*l})),_=(ee,pe)=>[ee.x*I,pe,ee.y*I],R=[0,1,0],C=n+y.boardLift,O=y.boardEdge/I,B=Math.min(y.boardsMax,Math.max(4,Math.round(d/y.board))),F=f-h-2*O,N=(m+A)/2,V=Math.max(1e-6,(A-m)/2),H=(h+f)/2,L=Math.max(1e-6,(f-h)/2),G=(ee,pe,de)=>{let Te=Math.hypot((pe-N)/V,(de-H)/L);return we(ee,qy,.42*Math.pow(Math.max(0,1-Te),1.3))},j=3;for(let ee=0;ee<B;ee++){let pe=h+O+F*ee/B,de=h+O+F*(ee+1)/B,Te=ym(k,pe+F*1e-4),Oe=ym(k,de-F*1e-4);if(!Te.length||Te.length!==Oe.length)continue;let Ue=oe(Zy,.84+.3*Qy(ee));for(let We=0;We<Te.length;We++){let at=Te[We][0]+O,Ze=Oe[We][0]+O,st=Math.min(Te[We][1]-O,A-O),Bt=Math.min(Oe[We][1]-O,A-O);if(!(st<=at||Bt<=Ze))for(let Ct=0;Ct<j;Ct++){let Ut=Ct/j,fn=(Ct+1)/j,_n=at+(st-at)*Ut,$n=at+(st-at)*fn,Zn=Ze+(Bt-Ze)*Ut,qn=Ze+(Bt-Ze)*fn,zo=_(p(_n,pe),C),ya=_(p($n,pe),C),Uo=_(p(Zn,de),C),Qn=_(p(qn,de),C),Jn=G(Ue,_n,pe),xa=G(Ue,$n,pe),an=G(Ue,Zn,de),Hr=G(Ue,qn,de);e.tri(zo,Uo,Qn,R,Jn,an,Hr),e.tri(zo,Qn,ya,R,Jn,Hr,xa)}}}let D=(T-E)*I,U=Math.max(y.pierMin,Math.min(y.pierMax,d*y.pierShare)),$=h+g+U/I,Z=f-g-U/I,te=(Z-$)*I;if(te<1||D<1)return;let X=Math.max(y.headerMin,Math.min(y.headerMax,w*y.headerShare)),me=w-X,re=Math.min(te*y.riseShare,me*y.riseMaxShare),ce=ee=>me-re*(1-Math.sqrt(Math.max(0,1-ee*ee))),J=[-a,0,-s],ae=(ee,pe,de)=>_(p(A-de/I,ee),n+pe),ie=(ee,pe,de,Te,Oe,Ue,We,at,Ze,st,Bt)=>{let Ct=ae(pe,Te,ee),Ut=ae(de,Oe,ee),fn=ae(de,We,ee),_n=ae(pe,Ue,ee);e.tri(Ct,Ut,fn,J,at,Ze,Bt),e.tri(Ct,fn,_n,J,at,Bt,st)};e.setMaterial(xo);let ge=Math.max(y.foldsMin,Math.min(y.foldsMax,Math.round(D/y.fold))),Ae=[0,.07,.22,.5,1],be=(ee,pe,de,Te)=>{let Oe=ee/(ge*2)*2-1,Ue=oe(ee%2?de:Te,(1-.3*Oe*Oe)*(1-.42*pe)),We=Math.pow(1-pe,5)*(1-.5*Oe*Oe);return[Math.min(1,Ue[0]*(1+1.3*We)+bs[0]*.06*We),Math.min(1,Ue[1]*(1+1.3*We)+bs[1]*.06*We),Math.min(1,Ue[2]*(1+1.3*We)+bs[2]*.06*We)]};for(let ee=0;ee<ge*2;ee++){let pe=E+(T-E)*ee/(ge*2),de=E+(T-E)*(ee+1)/(ge*2);for(let Te=0;Te+1<Ae.length;Te++){let Oe=Ae[Te],Ue=Ae[Te+1];ie(y.curtainClear,pe,de,w*Oe,w*Oe,w*Ue,w*Ue,be(ee,Oe,Si,wi),be(ee+1,Oe,Si,wi),be(ee,Ue,Si,wi),be(ee+1,Ue,Si,wi))}}ie(y.fringeClear,$,Z,0,0,y.fringe,y.fringe,Dt,Dt,Ft,Ft);let ke=Math.max(y.swagsMin,Math.min(y.swagsMax,Math.round(te/y.swag))),Ke=Math.max(y.dropMin,Math.min(y.dropMax,w*y.dropShare)),Be=ke*8,Fe=ee=>{let pe=ee/Be*2-1,de=Math.sin(Math.PI*(ee%8/8));return{x:$+(Z-$)*ee/Be,low:ce(pe)-Ke*(.42+.58*de),high:ce(pe)+.2,tone:.55+.45*de}};for(let ee=0;ee<Be;ee++){let pe=Fe(ee),de=Fe(ee+1),Te=(Oe,Ue)=>oe(we($y,Yy,Oe),1-.3*Ue);ie(y.valanceClear,pe.x,de.x,pe.low,de.low,pe.high,de.high,Te(pe.tone,0),Te(de.tone,0),Te(pe.tone,1),Te(de.tone,1)),ie(y.valanceFringeClear,pe.x,de.x,pe.low-y.fringe*.4,de.low-y.fringe*.4,pe.low+y.fringe*.6,de.low+y.fringe*.6,Dt,Dt,Ft,Ft)}let Ge=ee=>we(Pi,vo,Math.min(1,ee/w)),ne=h+g,W=f-g;for(let[ee,pe]of[[ne,$],[Z,W]]){let de=oe(Pi,.62);ie(y.archClear,ee,pe,0,0,y.plinth,y.plinth,de,de,de,de),ie(y.archClear,ee,pe,y.plinth,y.plinth,w,w,Ge(y.plinth),Ge(y.plinth),Ge(w),Ge(w))}let K=28;for(let ee=0;ee<K;ee++){let pe=ee/K*2-1,de=(ee+1)/K*2-1,Te=$+(Z-$)*ee/K,Oe=$+(Z-$)*(ee+1)/K;ie(y.archClear,Te,Oe,ce(pe),ce(de),w,w,Ge(ce(pe)),Ge(ce(de)),Ge(w),Ge(w)),ie(y.mouldingClear,Te,Oe,ce(pe),ce(de),ce(pe)+y.moulding,ce(de)+y.moulding,Ft,Ft,Dt,Dt)}let Q=y.moulding/I;ie(y.mouldingClear,$-Q,$,y.plinth,y.plinth,ce(-1)+y.moulding,ce(-1)+y.moulding,Dt,Ft,Dt,Ft),ie(y.mouldingClear,Z,Z+Q,y.plinth,y.plinth,ce(1)+y.moulding,ce(1)+y.moulding,Ft,Dt,Ft,Dt),ie(y.mouldingClear,ne,W,w-y.cornice,w-y.cornice,w,w,Dt,Dt,Ft,Ft);let ve=[c,0,l],Ee=(ee,pe,de,Te,Oe,Ue,We,at,Ze)=>{let st=ae(Te,Oe,pe),Bt=ae(Te,Oe,de),Ct=ae(Ue,We,pe),Ut=ae(Ue,We,de);e.tri(st,Ct,Ut,ee,at,Ze,Ze),e.tri(st,Ut,Bt,ee,at,Ze,at)},Ve=oe(Pi,.66),ze=oe(vo,.66);Ee([-ve[0],0,-ve[2]],0,y.archClear,ne,0,ne,w,Ve,ze),Ee(ve,0,y.archClear,W,0,W,w,Ve,ze),Ee(R,0,y.archClear,ne,w,W,w,oe(vo,.9),oe(vo,.9));let ye=oe(Pi,.8),Pt=oe(vo,.8);Ee(ve,y.curtainClear,y.archClear,$,0,$,ce(-1),ye,Pt),Ee([-ve[0],0,-ve[2]],y.curtainClear,y.archClear,Z,0,Z,ce(1),ye,Pt);let fe=oe(vo,.62),Ce=[0,-1,0];for(let ee=0;ee<K;ee++){let pe=ee/K*2-1,de=(ee+1)/K*2-1;Ee(Ce,y.curtainClear,y.archClear,$+(Z-$)*ee/K,ce(pe),$+(Z-$)*(ee+1)/K,ce(de),fe,fe)}e.setMaterial(0)}var vm=[.13,.14,.17],So=[.4,.43,.47],Jy=.18,e1=.02,t1=2.4,n1=[.055,.06,.075],o1=[.46,.33,.22],r1=[1,.96,.84],i1=[.98,.66,.28],a1=[.5,.31,.15],s1=[1,.87,.64],ht={lampEvery:1.8,lampsMin:3,lampsMax:14,lampDrop:.45,lampRadius:[.11,.2],poolShare:.44,poolEdge:.9,poolStrength:.5,washByDay:.35,drapeClear:.12,glowClear:.06,coreClear:.12,poolLift:.02};function Sm(e,t,n,o,r={}){let i=bm(t,o);if(!i)return null;if(xm(t.stageKind))return Mm(e,i,n,r.theatre),"theatre";let{poly:a,ux:s,uy:c,vx:l,vy:u,back:m,front:h,left:f,right:d,widthM:p,depthM:b,at:y,box:g}=i,v=Jy/I,P=n+Math.max(3.5,Math.min(8,p*.35)),w=n+Math.min(t1,P-n-1),x=.2/I,S=h+Math.min(b*.25,1.5)/I,A=e1/I;ue(e,g(m-2*v+A,m-v-A,f+v+x,d-v-x),void 0,()=>w,n,vm,vm,se);for(let[J,ae]of[[f+v,f+v+x],[d-v-x,d-v]])ue(e,g(m-2*v,m-v,J,ae),void 0,()=>P+.3,n,So,So,se),ue(e,g(S+x,m-2*v,J,ae),void 0,()=>P+.3,P,So,So,se);ue(e,g(S,S+x,f+v,d-v),void 0,()=>P+.3,P,So,So,se);let M=(J,ae)=>[J.x*I,ae,J.y*I],E=[-s,0,-c],T=f+v+x,k=d-v-x,_=m-2*v-ht.drapeClear/I,R=P-n,C=r.night===!1?ht.washByDay:1,O=(J,ae)=>we(n1,o1,C*(1-J*J)*Math.pow(Math.max(0,1-ae),1.6)),B=(J,ae,ie=0)=>M(y(_-ie/I,(T+k)/2+J*(k-T)/2),n+R*ae);e.setMaterial(xo);let F=8,N=5;for(let J=0;J<F;J++)for(let ae=0;ae<N;ae++){let ie=J/F*2-1,ge=(J+1)/F*2-1,Ae=ae/N,be=(ae+1)/N;e.tri(B(ie,Ae),B(ge,Ae),B(ge,be),E,O(ie,Ae),O(ge,Ae),O(ge,be)),e.tri(B(ie,Ae),B(ge,be),B(ie,be),E,O(ie,Ae),O(ge,be),O(ie,be))}let V=Math.max(ht.lampsMin,Math.min(ht.lampsMax,Math.round(p/ht.lampEvery))),H=Math.max(ht.lampRadius[0],Math.min(ht.lampRadius[1],p*.012)),L=(k-T)*I,G=1-ht.lampDrop/R,j=(J,ae,ie,ge,Ae)=>{let ke=ae/L*2,Ke=ae/R;for(let Be=0;Be<10;Be++){let Fe=2*Math.PI*Be/10,Ge=2*Math.PI*(Be+1)/10,ne=[Math.cos(Fe)*ke,Math.sin(Fe)*Ke],W=[Math.cos(Ge)*ke,Math.sin(Ge)*Ke];e.tri(B(J,G,ie),B(J+ne[0],G+ne[1],ie),B(J+W[0],G+W[1],ie),E,ge,Ae(ne[0],ne[1]),Ae(W[0],W[1]))}};for(let J=0;J<V;J++){let ae=(J+.5)/V*2-1;j(ae,H*3,ht.glowClear,we(O(ae,G),a1,.85),(ie,ge)=>O(ae+ie,G+ge)),j(ae,H,ht.coreClear,r1,()=>i1)}if(e.setMaterial(0),!r.night||!r.deck)return"rig";let D=r.deck,U=y((h+m-2*v)/2,(f+d)/2),$=n+ht.poolLift,Z=[0,1,0],te=[{r:.4,k:.72},{r:.72,k:.28},{r:1,k:0}],X=28,me=[];for(let J=0;J<X;J++){let ae=2*Math.PI*J/X,ie=Math.cos(ae)*(m-2*v-h)*ht.poolShare,ge=Math.sin(ae)*(d-f)*ht.poolShare,Ae=Math.hypot(ie,ge),be=(s*ie+l*ge)/Ae,ke=(c*ie+u*ge)/Ae;me.push(Math.min(Ae,pm(a,U,be,ke)*ht.poolEdge))}if(me.some(J=>!(J>0)))return"rig";let re=(J,ae)=>{let ie=2*Math.PI*(J%X)/X,ge=Math.cos(ie)*(m-2*v-h)*ht.poolShare,Ae=Math.sin(ie)*(d-f)*ht.poolShare,be=Math.hypot(ge,Ae),ke=me[J%X]*ae/be;return M({x:U.x+(s*ge+l*Ae)*ke,y:U.y+(c*ge+u*Ae)*ke},$)},ce=J=>we(D,s1,ht.poolStrength*J);for(let J=0;J<X;J++){e.tri(M(U,$),re(J,te[0].r),re(J+1,te[0].r),Z,ce(1),ce(te[0].k),ce(te[0].k));for(let ae=0;ae+1<te.length;ae++){let ie=te[ae],ge=te[ae+1];e.tri(re(J,ie.r),re(J,ge.r),re(J+1,ge.r),Z,ce(ie.k),ce(ge.k),ce(ge.k)),e.tri(re(J,ie.r),re(J+1,ge.r),re(J+1,ie.r),Z,ce(ie.k),ce(ge.k),ce(ie.k))}}return"rig"}function wm(e,t){let n={openField:!1,openAir:!1,court:!1,indoorCourt:!1,inTheRound:!1,stage:!1,standing:0,seatCount:t.length};for(let o of e)for(let r of o.objects){if(r.type==="gaArea"&&(n.standing+=r.capacity),r.type!=="shape")continue;let i=r.stageKind;if(hi(i)){n.openField=!0;continue}if(co(i)&&(n.openAir=!0),Et(i)){n.court=!0,fu(i)&&(n.indoorCourt=!0);continue}if(r.role!=="stage")continue;if(n.stage=!0,i==="round"){n.inTheRound=!0;continue}let a=Pe(r);if(!a||a.length<3)continue;let s={x:a.reduce((c,l)=>c+l.x,0)/a.length,y:a.reduce((c,l)=>c+l.y,0)/a.length};Mo(s,t)&&(n.inTheRound=!0)}return n}var Im=10,Hn=11,wo=[.93,.94,.95],c1=[.93,.8,.22],l1=[.82,.14,.16],u1=[.78,.1,.12],gs=[.74,.77,.8],ys={width:7.32,height:2.44,depth:2},Ai={width:1.83,height:1.22,depth:1,fromEndBoards:3.35},m1=1.5,h1=1.8,xs=2.4,yt=(e,t)=>[e[0]-t[0],e[1]-t[1],e[2]-t[2]],fr=(e,t)=>[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]],un=e=>{let t=Math.hypot(e[0],e[1],e[2])||1;return[e[0]/t,e[1]/t,e[2]/t]};function Nt(e,t,n,o,r){let i=un(yt(n,t)),a=un(fr(i,Math.abs(i[1])<.9?[0,1,0]:[1,0,0])),s=fr(a,i),c=(l,u)=>{let m=u===0||u===3?-o:o,h=u<2?-o:o;return[l[0]+a[0]*m+s[0]*h,l[1]+a[1]*m+s[1]*h,l[2]+a[2]*m+s[2]*h]};for(let l=0;l<4;l++){let u=(l+1)%4,m=c(t,l),h=c(t,u),f=c(n,l),d=c(n,u),p=un(fr(yt(h,m),yt(f,m))),b=yt([(m[0]+h[0])/2,(m[1]+h[1])/2,(m[2]+h[2])/2],t);p[0]*b[0]+p[1]*b[1]+p[2]*b[2]<0&&(p=[-p[0],-p[1],-p[2]]);let y=oe(r,.86+.14*Math.max(0,p[1]));e.tri(m,h,d,p,y),e.tri(m,d,f,p,y)}}function hr(e,t,n,o,r){let i=Math.hypot(...yt(n,t)),a=Math.hypot(...yt(r,t)),s=un(fr(yt(n,t),yt(r,t)));e.tri(t,n,o,s,[0,0,0],[i,0,0],[i,a,0]),e.tri(t,o,r,s,[0,0,0],[i,a,0],[0,a,0])}function vs(e,t,n,o,r,i,a,s,c){let l=(g,v)=>[g[0],g[1]+v,g[2]],u=g=>[g[0]+o[0]*i,g[1],g[2]+o[2]*i],m=l(t,r),h=l(n,r),f=u(t),d=u(n),p=u(m),b=u(h);e.setMaterial(c),Nt(e,t,m,a,s),Nt(e,n,h,a,s),Nt(e,m,h,a,s),e.setMaterial(Hn);let y=Math.min(a,.03);for(let[g,v]of[[f,p],[d,b],[m,p],[h,b],[p,b],[t,f],[n,d],[f,d]])Nt(e,g,v,y,oe(s,.92));e.setMaterial(Im),hr(e,f,d,b,p),hr(e,m,h,b,p),hr(e,t,f,p,m),hr(e,n,d,b,h),e.setMaterial(0)}var Ms={height:.711,width:.2286,pitchLength:20.12},f1=[.88,.8,.6];function _m(e,t,n){if(t.length!==4)return;let o=a=>Math.hypot(t[(a+1)%4].x-t[a].x,t[(a+1)%4].y-t[a].y),r=o(0)<=o(1)?0:1,i=Math.max(o(0),o(1))*I/Ms.pitchLength;if(i>.2){e.setMaterial(Hn);for(let a of[r,r+2]){let s=t[a%4],c=t[(a+1)%4],l=o(a%4)||1,u={x:(s.x+c.x)/2,y:(s.y+c.y)/2},m=(c.x-s.x)/l,h=(c.y-s.y)/l;for(let f of[-1,0,1]){let d=f*Ms.width*i/2/I,p=$e({x:u.x+m*d,y:u.y+h*d},n);Nt(e,p,[p[0],p[1]+Ms.height*i,p[2]],.019*i,f1)}}e.setMaterial(0)}}var $e=(e,t)=>[e.x*I,t,e.y*I];function Cm(e){if(e.length<3)return null;let t=0,n=0;for(let y of e)t+=y.x,n+=y.y;t/=e.length,n/=e.length;let o=0,r=0,i=0;for(let y of e){let g=y.x-t,v=y.y-n;o+=g*g,r+=v*v,i+=g*v}let a=.5*Math.atan2(2*i,o-r),s=Math.cos(a),c=Math.sin(a),l=1/0,u=-1/0,m=1/0,h=-1/0;for(let y of e){let g=(y.x-t)*s+(y.y-n)*c,v=-(y.x-t)*c+(y.y-n)*s;l=Math.min(l,g),u=Math.max(u,g),m=Math.min(m,v),h=Math.max(h,v)}let f=(u-l)*I,d=(h-m)*I;if(!(f>4)||!(d>2))return null;let p={a:(l+u)/2,b:(m+h)/2};return{at:(y,g)=>{let v=p.a+y/I,P=p.b+g/I;return{x:t+s*v-c*P,y:n+c*v+s*P}},lengthM:f,widthM:d}}function Tm(e,t,n,o,r,i){let a=t.map(c=>$e(c,n)),s=t.map(c=>$e(c,n+o));e.setMaterial(0);for(let c=0;c<t.length;c++)Nt(e,a[c],s[c],r,i);e.setMaterial(Hn);for(let c=0;c+1<t.length;c++)Nt(e,s[c],s[c+1],.025,i);e.setMaterial(Im);for(let c=0;c+1<t.length;c++)hr(e,a[c],a[c+1],s[c+1],s[c]);e.setMaterial(0)}var Pm=[.66,.29,.22],d1=[.87,.79,.58],Am=[.17,.36,.63],km=[.56,.59,.63],p1=[.7,.7,.68],b1={length:176.9,trackWidth:9.76,longJump:{runway:40,runwayWidth:1.22,pit:9,pitWidth:2.75,fromKerb:3,start:-25},highJump:{matLength:3,matWidth:5,matHeight:.7,apron:15,intoBend:3.5,bar:2},cage:{radius:3.5,height:7,intoBend:10,pad:1.07,sectorDeg:34.92,sector:60,openDeg:120}};function Lm(e,t,n){let o=Cm(t);if(!o)return;let{at:r,lengthM:i,widthM:a}=o,s=b1,c=Math.min(1.2,Math.max(.5,i/s.length)),l=a/2,u=i/2-l,m=l-s.trackWidth;if(!(u>30*c)||!(m>22*c))return;let h=n+.03,f=(k,_,R=0)=>{ue(e,k,void 0,()=>h+R,h+R-.004,_,_,se)},d=(k,_,R,C)=>[r(k,R),r(_,R),r(_,C),r(k,C)];e.setMaterial(0),f(d(u-.08,u+.08,-l+.2,-m-.2),wo);let p=s.longJump,b=m-p.fromKerb*c,y=(p.start+p.runway)*c;f(d(p.start*c,y,b-p.runwayWidth*c/2,b+p.runwayWidth*c/2),Pm),f(d(y,y+p.pit*c,b-p.pitWidth*c/2,b+p.pitWidth*c/2),d1);let g=s.highJump,v=-(u+g.intoBend*c),P=[];for(let k=0;k<=16;k++){let _=-Math.PI/2+Math.PI*k/16;P.push(r(v-.3*c+Math.cos(_)*g.apron*c,Math.sin(_)*g.apron*c))}f(P,Pm),ue(e,d(v-g.matLength*c,v,-(g.matWidth*c)/2,g.matWidth*c/2),void 0,()=>n+g.matHeight*c,n,Am,oe(Am,.82),se),e.setMaterial(Hn);let w=[-1,1].map(k=>r(v+.25*c,k*(g.bar+.1)*c));for(let k of w)Nt(e,$e(k,n),$e(k,n+(g.bar+.3)*c),.02,wo);Nt(e,$e(w[0],n+g.bar*c),$e(w[1],n+g.bar*c),.015,wo),e.setMaterial(0);let x=s.cage,S=u+x.intoBend*c;f(((k,_)=>Array.from({length:_},(R,C)=>{let O=2*Math.PI*C/_;return r(S+Math.cos(O)*k,Math.sin(O)*k)}))(x.pad*c,16),p1);let M=x.sectorDeg/2*Math.PI/180;for(let k of[-1,1]){let _=x.sector*c,R=-Math.cos(M),C=k*Math.sin(M);f([r(S+C*.15,-R*.15),r(S+R*_+C*.15,C*_-R*.15),r(S+R*_-C*.15,C*_+R*.15),r(S-C*.15,R*.15)],wo,.006)}let E=x.openDeg/2*Math.PI/180,T=[];for(let k=0;k<=6;k++){let _=E+(2*Math.PI-2*E)*k/6;T.push(r(S-Math.cos(_)*x.radius*c,Math.sin(_)*x.radius*c))}Tm(e,T,n,x.height*c,.05,km)}var g1=[.95,.8,.16],Rm=[.13,.17,.2],Em=[.78,.8,.83],y1={backY:70,backHalf:25,pole:{x:70,y:-18},net:{height:9,inset:.5,wing:15},poleHeight:12,dugout:{length:18,depth:2.4,height:1,along:.32,inset:1.9}};function Om(e,t,n,o,r,i){let a=y1,s={x:a.pole.x-a.backHalf,y:a.pole.y-a.backY},c=Math.hypot(s.x,s.y),l=s.x/c,u=s.y/c,m=(v,P,w)=>t(v*(a.backHalf+l*P+u*w),a.backY+u*P-l*w),h=a.net,f=a.backY-h.inset,d=a.backHalf-h.inset,p=[m(-1,h.wing,h.inset)];for(let v of[-d,-d/2,d/2,d])p.push(t(v,f));p.push(m(1,h.wing,h.inset)),Tm(e,p,n,h.height*o,.05,km),e.setMaterial(0);for(let v of[-1,1]){let P=$e(t(v*(a.pole.x-.4),a.pole.y+.4),n);Nt(e,P,[P[0],P[1]+a.poleHeight*o,P[2]],.09,g1)}if(!i)return;let b=a.dugout,y=b.along*c-b.length/2,g=y+b.length;for(let v of[-1,1]){let P=[m(v,y,b.inset-b.depth/2),m(v,g,b.inset-b.depth/2)],w=[m(v,y,b.inset+b.depth/2),m(v,g,b.inset+b.depth/2)],x=Math.ceil(b.length),S=!0;for(let T=0;S&&T<=x;T++){let k=T/x;S=r({x:P[0].x+(P[1].x-P[0].x)*k,y:P[0].y+(P[1].y-P[0].y)*k})}if(!S)continue;let A=[P[0],P[1],w[1],w[0]];ue(e,A,void 0,()=>n+(b.height-.1)*o,n,Rm,oe(Rm,.85),se);let M=(T,k)=>({x:T.x+(T.x-k.x)*.04,y:T.y+(T.y-k.y)*.04}),E=[M(P[0],w[1]),M(P[1],w[0]),M(w[1],P[0]),M(w[0],P[1])];ue(e,E,void 0,()=>n+b.height*o,n+(b.height-.14)*o,Em,oe(Em,.9),se)}}function Fm(e,t,n,o,r,i){let a=t.lengthM/2,s=t.widthM/2;if(i){let c=ys.width/2*o,l=ys.depth*o;for(let u of[-1,1]){let m=t.at(u*(a+l),-c),h=t.at(u*(a+l),c);if(!r(m)||!r(h))continue;let f=$e(t.at(u*a,-c),n),d=$e(t.at(u*a,c),n),p=$e(t.at(u*(a+1),0),n),b=$e(t.at(u*a,0),n);vs(e,f,d,un(yt(p,b)),ys.height*o,l,.06,wo,0)}}e.setMaterial(Hn);for(let c of[-1,1])for(let l of[-1,1]){if(!r(t.at(c*a,l*s)))continue;let u=$e(t.at(c*a,l*s),n),m=[u[0],u[1]+m1*o,u[2]];Nt(e,u,m,.02,c1);let h=un(yt($e(t.at(c*(a+1),l*(s+1)),n),u)),f=[m[0]+h[0]*.4*o,m[1]-.14*o,m[2]+h[2]*.4*o],d=[m[0],m[1]-.28*o,m[2]];e.tri(m,f,d,un(fr(yt(f,m),yt(d,m))),l1)}e.setMaterial(0)}function Dm(e,t,n,o,r){let i=Cm(t);if(!i)return;let{at:a,lengthM:s}=i,c=Math.min(1.2,Math.max(.5,s/60)),l=s/2-Ai.fromEndBoards*c,u=Ai.width/2*c;for(let b of[-1,1]){let y=$e(a(b*l,-u),n),g=$e(a(b*l,u),n),v=$e(a(b*(l+1),0),n),P=$e(a(b*l,0),n);vs(e,y,g,un(yt(v,P)),Ai.height*c,Ai.depth*c,.03,u1,Hn)}let m=Lt(t,r/2/I);if(m.length<3)return;let h=o+h1;e.setMaterial(Hn);let f=xs;for(let b=0;b<m.length;b++){let y=m[b],g=m[(b+1)%m.length],v=Math.hypot(g.x-y.x,g.y-y.y)*I,P=0;for(;f+(v-P)>=xs;){P+=xs-f,f=0;let w=v>0?P/v:0,x={x:y.x+(g.x-y.x)*w,y:y.y+(g.y-y.y)*w};Nt(e,$e(x,o),$e(x,h),.025,gs)}f+=v-P}let d=Lt(t,(r/2-.03)/I),p=Lt(t,(r/2+.03)/I);d.length>=3&&p.length>=3&&ue(e,d,[p.slice().reverse()],()=>h,h-.05,gs,oe(gs,.9),se),e.setMaterial(0)}function Nm(e,t,n,o,r){if(t.length!==4||!(r-o>.2))return;let i=(d,p)=>({x:(d.x+p.x)/2,y:(d.y+p.y)/2}),a=d=>Math.hypot(d.x-n.x,d.y-n.y),s=a(i(t[0],t[1]))<=a(i(t[3],t[2])),[c,l,u]=s?[t[0],t[1],t[3]]:[t[3],t[2],t[0]],m=Math.hypot(u.x-c.x,u.y-c.y)*I;if(!(m>.05))return;let h=$e(c,o),f=$e(l,o);vs(e,h,f,un(yt($e(u,o),h)),r-o,m,.06,wo,0)}var x1=[.12,.38,.16],M1=[.72,.62,.45],v1=[.88,.93,.96],Bm=[.95,.95,.94],S1=[.66,.29,.22],Ss={length:20.12,width:3.05},w1=.14,P1=9.76,Vt=[.93,.94,.95],Ri=[.1,.11,.13],A1=[.45,.85,1.25],R1=1.45,Hm=.012,Gm=.004,Vm=1.07,Ei=.15,zm=[.93,.76,.18],ws={height:.2,proud:.02,buried:.03};function Gn(e,t,n,o,r,i){e.setMaterial(i),ue(e,t,n?[n.slice().reverse()]:void 0,()=>o,o-.004,r,r,se)}var Po=(e,t)=>Lt(e,t/I);function Wm(e,t,n){let o=t.x-e.x,r=t.y-e.y,i=Math.hypot(o,r);if(i<1e-9)return null;let a=-r/i*n,s=o/i*n;return[{x:e.x+a,y:e.y+s},{x:t.x+a,y:t.y+s},{x:t.x-a,y:t.y-s},{x:e.x-a,y:e.y-s}]}function E1(e,t,n,o){let r=t.map(i=>[i.x*I,n,i.y*I]);e.tri(r[0],r[1],r[2],[0,1,0],o),e.tri(r[0],r[2],r[3],[0,1,0],o)}function Ao(e,t,n,o,r,i){let a=n/I,s=[{x:t.x-a,y:t.y-a},{x:t.x+a,y:t.y-a},{x:t.x+a,y:t.y+a},{x:t.x-a,y:t.y+a}];ue(e,s,void 0,()=>r,o,i,oe(i,.85),se)}function xt(e,t,n,o,r,i,a){let s=Wm(t,n,o/I);s&&ue(e,s,void 0,()=>i,r,a,oe(a,.85),se)}function gr(e){let t=It(e),n={x:(t[0].x+t[2].x)/2,y:(t[0].y+t[2].y)/2},o=Math.hypot(t[1].x-t[0].x,t[1].y-t[0].y)||1,r=Math.hypot(t[3].x-t[0].x,t[3].y-t[0].y)||1,i={x:(t[1].x-t[0].x)/o,y:(t[1].y-t[0].y)/o},a={x:(t[3].x-t[0].x)/r,y:(t[3].y-t[0].y)/r};return{at:(c,l)=>({x:n.x+(i.x*c+a.x*l)/I,y:n.y+(i.y*c+a.y*l)/I}),lengthM:o*I,widthM:r*I}}function Ps(e){let t=1/0,n=-1/0,o=1/0,r=-1/0;for(let h of e.points??[])t=Math.min(t,h.x),n=Math.max(n,h.x),o=Math.min(o,h.y),r=Math.max(r,h.y);let i=(e.rotation??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=(t+n)/2,l=(o+r)/2,u=h=>i?{x:c+(h.x-c)*a-(h.y-l)*s,y:l+(h.x-c)*s+(h.y-l)*a}:h,m=(h,f,d,p)=>u({x:c+h/d*(n-t),y:l+f/p*(r-o)});return{turn:u,shortSideM:Math.min(n-t,r-o)*I,local:m,widthU:n-t}}function I1(e){let t=Qa(e).find(n=>n.closed&&!n.fill&&n.points.length===4);return t?t.points.map(Ps(e).turn):null}function jm(e,t,n){let o=Qa(t);if(!o.length)return;let{turn:r,shortSideM:i}=Ps(t),a=Math.max(.04,Math.min(.3,i*.004))/I,s=0;e.setMaterial(0);for(let u of o){if(!u.fill)continue;let m=u.points.map(r);Gn(e,m,null,n+Hm+s*Gm,Ie(u.fill)??Vt,0),s++}let c=o.filter(u=>!(u.fill&&u.ink===u.fill)),l=[...new Set(c.map(u=>u.ink??fi))];for(let u of l){let m=n+Hm+s++*Gm,h=Ie(u)??Vt;for(let f of c){if((f.ink??fi)!==u)continue;let d=f.points.map(r),p=f.closed?d.length:d.length-1;for(let b=0;b<p;b++){let y=Wm(d[b],d[(b+1)%d.length],a);y&&E1(e,y,m,h)}}}}function Xm(e,t,n,o,r,i){if(t.length<3)return!1;let a=o+.006,s=r??x1;if(n==="oval-cricket"){let c=t.reduce((x,S)=>x+S.x,0)/t.length,l=t.reduce((x,S)=>x+S.y,0)/t.length,u=x=>t.map(S=>({x:c+(S.x-c)*x,y:l+(S.y-l)*x})),m=8;for(let x=0;x<m;x++){let S=u(1-x/m),A=x===m-1?null:u(1-(x+1)/m);Gn(e,S,A,a,oe(s,x%2?1.04:.96),4)}let h=t[0];for(let x of t)Math.hypot(x.x-c,x.y-l)>Math.hypot(h.x-c,h.y-l)&&(h=x);let f=Math.hypot(h.x-c,h.y-l)||1,d=(h.x-c)/f,p=(h.y-l)/f,b=-p,y=d,g=Math.min(1,2*f*I*w1/Ss.length),v=Ss.length*g/2/I,P=Ss.width*g/2/I,w=(i&&I1(i))??[[-v,-P],[v,-P],[v,P],[-v,P]].map(([x,S])=>({x:c+d*x+b*S,y:l+p*x+y*S}));return Gn(e,w,null,a+.004,M1,0),_m(e,w,a+.004),e.setMaterial(0),!0}if(n==="rink-hockey"){let c=Po(t,Ei);Gn(e,c,null,a,v1,0),e.setMaterial(0),ue(e,t,[c.slice().reverse()],()=>o+Vm,o,Bm,oe(Bm,.9),se);let l=Po(t,Ei-ws.buried),u=Po(t,Ei+ws.proud);return l.length>=3&&u.length>=3&&ue(e,l,[u.slice().reverse()],()=>o+ws.height,o,zm,oe(zm,.92),se),Dm(e,t,a,o+Vm,Ei),!0}if(n==="ring-boxing"&&t.length===4){let{at:c}=gr(t),l=[c(-3.05,-3.05),c(3.05,-3.05),c(3.05,3.05),c(-3.05,3.05)],u=[[.77,.19,.19],Vt,[.17,.42,.69],Vt];e.setMaterial(0),l.forEach((m,h)=>Ao(e,m,.07,o,o+R1,u[h]));for(let m of A1)for(let h=0;h<4;h++)xt(e,l[h],l[(h+1)%4],.025,o+m-.025,o+m+.025,Vt);return!0}if(n==="court-tennis"&&t.length===4){let{at:c}=gr(t);e.setMaterial(0),xt(e,c(0,-6.4),c(0,6.4),.015,o,o+.95,Ri),xt(e,c(0,-6.4),c(0,6.4),.03,o+.95,o+1,Vt);for(let l of[-1,1])Ao(e,c(0,l*6.4),.05,o,o+1.07,Ri);return!0}if(n==="court-basketball"&&t.length===4){let{at:c,lengthM:l}=gr(t),u=Math.min(14,l/2-.5);e.setMaterial(0);for(let m of[-1,1]){let h=c(m*(u+1.2),0),f=c(m*(u-1.2),0);Ao(e,h,.12,o,o+3.4,Ri),xt(e,h,f,.06,o+3.25,o+3.4,Ri),xt(e,c(m*(u-1.2),-.9),c(m*(u-1.2),.9),.03,o+2.9,o+3.95,Vt)}return!0}if(n==="pitch-rugby"&&t.length===4){let{at:c,lengthM:l}=gr(t),u=l*(50/120);e.setMaterial(0);for(let m of[-1,1]){for(let h of[-2.8,2.8])Ao(e,c(m*u,h),.07,o,o+12,Vt);xt(e,c(m*u,-2.8),c(m*u,2.8),.06,o+2.94,o+3.06,Vt)}return!0}if(n==="track-athletics"){let c=Po(t,P1);return c.length<3?!1:(Gn(e,t,c,a,S1,0),Gn(e,c,null,a,s,4),e.setMaterial(0),Lm(e,t,o),!0)}return!1}var dr=140,Um=1.6,pr=[.9,.91,.93],Ii=[.15,.19,.3],br=[.14,.15,.18],_1=[.1,.24,.18],_i=.9,C1=6,T1={"pitch-football":105,"pitch-rugby":120,"court-tennis":23.77,"court-basketball":32},k1={sidelineShare:15/19,fromSideline:1.35,tableHalfLength:4.5,tableHalfDepth:.38,tableHeight:.76,benchFrom:6,benchTo:12.5,benchHalfDepth:.25,benchHeight:.45,benchBackHeight:.85},L1=[.13,.15,.2],O1=[.82,.84,.87];function Km(e,t,n,o,r,i=!1,a=!1){let s=t.stageKind;if(!s||n.length<3)return;if(e.setMaterial(0),s==="diamond-baseball"){let{local:M,widthU:E}=Ps(t);if(!(E>0))return;let T=M(0,0,dr,dr),k=r.filter(R=>Math.hypot(R.x-T.x,R.y-T.y)<=E),_=Math.min(1.2,Math.max(.5,E*I/dr));Om(e,(R,C)=>M(R,C,dr,dr),o,_,R=>k.every(C=>Math.hypot(C.x-R.x,C.y-R.y)*I>=Um),!a),e.setMaterial(0);return}if(s==="oval-cricket"){let M=Po(n,2.85),E=Po(n,3.1);M.length>=3&&E.length>=3&&Gn(e,M,E,o+.03,Vt,0),e.setMaterial(0);return}let c=T1[s];if(!c||n.length!==4)return;let{at:l,lengthM:u,widthM:m}=gr(n),h=Math.min(1.2,Math.max(.5,u/c)),f=u/2,d=m/2,p=Math.max(f,d)+14,b=l(0,0),y=r.filter(M=>Math.hypot(M.x-b.x,M.y-b.y)*I<p),g=M=>y.every(E=>Math.hypot(E.x-M.x,E.y-M.y)*I>=Um),v=(M,E)=>{let T=Math.max(1,Math.ceil(Math.hypot(E.x-M.x,E.y-M.y)*I));for(let k=0;k<=T;k++)if(!g({x:M.x+(E.x-M.x)*(k/T),y:M.y+(E.y-M.y)*(k/T)}))return!1;return!0},P=(M,E,T,k,_)=>{let R=Math.hypot(E[0]-M[0],E[1]-M[1]),C=Math.max(1,Math.round(R/C1));for(let O=0;O<C;O++){let B=O/C+.012,F=(O+1)/C-.012,N=l(M[0]+(E[0]-M[0])*B,M[1]+(E[1]-M[1])*B),V=l(M[0]+(E[0]-M[0])*F,M[1]+(E[1]-M[1])*F);v(N,V)&&xt(e,N,V,.06,o,o+_,k&&O%2?k:T)}};if(s==="court-basketball"){let M=k1;for(let E of[-1,1]){let T=E*(d*M.sidelineShare+M.fromSideline*h),k=T+E*M.tableHalfDepth*h,_=(B,F)=>v(l(B,T),l(F,T))&&v(l(B,k),l(F,k)),R=M.tableHalfLength*h;if(!_(-R,R))continue;let C=l(-R,T),O=l(R,T);xt(e,C,O,M.tableHalfDepth*h,o,o+M.tableHeight-.04,L1),xt(e,C,O,M.tableHalfDepth*h+.04,o+M.tableHeight-.06,o+M.tableHeight,O1);for(let B of[-1,1]){let F=B*M.benchFrom*h,N=B*M.benchTo*h;if(!_(F,N))continue;xt(e,l(F,T),l(N,T),M.benchHalfDepth,o,o+M.benchHeight,br);let V=T+E*(M.benchHalfDepth+.04);xt(e,l(F,V),l(N,V),.03,o,o+M.benchBackHeight,br)}break}return}if(s==="court-tennis"){let M=f+6.4*h,E=d+3.66*h;for(let k of[-1,1])P([k*M,-E],[k*M,E],_1,null,1);let T=l(0,d+1.2*h);g(T)&&(Ao(e,T,.3,o,o+1.5,br),Ao(e,T,.36,o+1.5,o+1.62,Vt));return}Fm(e,{at:l,lengthM:u,widthM:m},o,h,g,s==="pitch-football"&&!i);let w=d+3.2*h,x=f+4*h,S=3*h,A=15*h;P([-f+S,w],[f-S,w],pr,Ii,_i),P([-f+S,-w],[-A,-w],pr,Ii,_i),P([A,-w],[f-S,-w],pr,Ii,_i);for(let M of[-1,1])P([M*x,-d+S],[M*x,d-S],pr,Ii,_i);for(let M of a?[]:[-1,1]){let E=M*2.5*h,T=M*10.5*h,k=-(d+4.4*h),_=l(E,k),R=l(T,k);!v(_,R)||!v(l(E,k-.75*h),l(T,k-.75*h))||(xt(e,_,R,.35,o,o+.45,br),xt(e,l(E,k-.75*h),l(T,k-.75*h),.05,o,o+1.9,br),xt(e,l(E,k-.2*h),l(T,k-.2*h),.62,o+1.9,o+1.98,pr))}}var xn=72,F1=1.2,D1=5,N1=30,B1=4;function H1(e,t,n,o){let r=0;for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length],c=s.x-a.x,l=s.y-a.y,u=n*l-o*c;if(Math.abs(u)<1e-12)continue;let m=((a.x-t.x)*l-(a.y-t.y)*c)/u,h=((a.x-t.x)*o-(a.y-t.y)*n)/u;m>r&&h>=-1e-9&&h<=1+1e-9&&(r=m)}return r}function G1(e,t){if(e.length<3)return null;let n={x:e.reduce((s,c)=>s+c.x,0)/e.length,y:e.reduce((s,c)=>s+c.y,0)/e.length},o=2*Math.PI/xn,r=new Float64Array(xn);for(let s=0;s<xn;s++)if(r[s]=H1(e,n,Math.cos(s*o),Math.sin(s*o)),!(r[s]>0))return null;let i=new Float64Array(xn).fill(1/0);for(let s of t){let c=s.x-n.x,l=s.y-n.y,u=Math.hypot(c,l),m=(Math.round(Math.atan2(l,c)/o)%xn+xn)%xn;u>r[m]&&u<i[m]&&(i[m]=u)}let a=[];for(let s=0;s<xn;s++){let l=Number.isFinite(i[s])&&i[s]-r[s]<=N1/I?i[s]+F1/I:r[s]+D1/I;a.push({x:n.x+Math.cos(s*o)*l,y:n.y+Math.sin(s*o)*l})}return a}function V1(e){return we(oe(e,.84),[.33,.36,.31],.22)}function Ym(e,t,n,o,r){let i=G1(t,o);if(!i)return;let a=n-.015;e.setMaterial(B1);let s=V1(r);ue(e,i,void 0,()=>a,a-.004,s,s,se),e.setMaterial(0)}function $m(e){let t=1/0,n=1/0,o=-1/0,r=-1/0;for(let i of e)t=Math.min(t,i.x),o=Math.max(o,i.x),n=Math.min(n,i.y),r=Math.max(r,i.y);return{x:(t+o)/2,y:(n+r)/2}}function z1(e,t){let n=$m(e),o=$m(t);return Ye(t,n.x,n.y)||Ye(e,o.x,o.y)}function Ci(e){let t=new Set;if(e.length<2)return t;let n=[...e].sort((r,i)=>r.baseHeightM-i.baseHeightM||r.index-i.index),o=[];for(let r of n){let i=[];for(let a of r.objects){if(a.type!=="shape"||a.role!=="stage")continue;let s=Pe(a);!s||s.length<3||(o.some(c=>z1(s,c))?t.add(a):i.push(s))}o.push(...i)}return t}var Zm="#ffffff";var U1={wheelchair:"M7.8 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM8 7L10.5 7L10.5 15L8 15ZM8 12.5L18 12.5L18 15L8 15ZM16 15L18 15L18 18L16 18ZM5.5 16a5.5 5.5 0 1 0 11 0a5.5 5.5 0 1 0 -11 0zM8 16a3 3 0 1 1 6 0a3 3 0 1 1 -6 0z",companion:"M5.5 6.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM4.5 18.5L6 11.5L11 11.5L12.5 18.5ZM12.5 7.5a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM11.5 19L13 12.5L18 12.5L19.5 19Z","semi-ambulatory":"M8.3 3.8a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM9 6.2L12 6.6L11 13.5L8.6 13L9 6.2ZM8.6 13L11 13L9.5 21L7 21ZM10.4 13L12.6 13L13.6 21L11.2 21ZM11.2 7.2L14 8L14.6 9.6L11.9 8.9ZM14.4 6.8L15.9 6.8L16.4 21L14.8 21Z","designated-aisle":"M3 5L6 5L6 14L3 14ZM3 12L13 12L13 15L3 15ZM5 15L7 15L7 20L5 20ZM11 15L13 15L13 20L11 20ZM13 7L20 7L17 4L19 4L23 8.5L19 13L17 13L20 10L13 10Z","step-free":"M4 4.5a2.2 2.2 0 1 0 4.4 0a2.2 2.2 0 1 0 -4.4 0zM4.4 7L7.5 7L7.5 13L11 15L9.5 17L5 14L4.4 7ZM2 19L8 19L17 10L22 10L22 13L18 13L10 21L2 21Z",hearing:"M15.5 3.5C9 2.2 5.5 6 5.5 11.5C5.5 16 8 19.5 10.5 21C13.2 22.6 16.4 20.8 15.4 18C14.8 16.4 12.9 16.1 13 14C13.1 11.9 15.8 11.4 15.8 8.5C15.8 5.4 13 4 15.5 3.5Z",cart:"M5.5 6L18.5 6a2.5 2.5 0 0 1 2.5 2.5L21 15.5a2.5 2.5 0 0 1 -2.5 2.5L11 18L7 20.5L7.5 18L5.5 18a2.5 2.5 0 0 1 -2.5 -2.5L3 8.5a2.5 2.5 0 0 1 2.5 -2.5zM6.5 11L17.5 11L17.5 12.6L6.5 12.6zM6.5 14L17.5 14L17.5 15.6L6.5 15.6z","sign-language":"M7 11L17 11L17 18a2 2 0 0 1 -2 2L9 20a2 2 0 0 1 -2 -2zM7.6 5L9.4 5L9.4 12L7.6 12zM9.9 3.5L11.7 3.5L11.7 12L9.9 12zM12.3 3.5L14.1 3.5L14.1 12L12.3 12zM14.6 5L16.4 5L16.4 12L14.6 12zM7.2 12.5L5 10.2L6.4 8.9L8.6 11.2Z","low-vision":"M2.5 12C6 6 18 6 21.5 12C18 18 6 18 2.5 12ZM9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0zM17.5 3L19 3L19 6L17.5 6ZM19 4L22 4L22 5.5L19 5.5Z","sensory-friendly":"M4 11C4 5 7 2.5 12 2.5S20 5 20 11L17 11C17 7 15.5 5.5 12 5.5S7 7 7 11ZM3 10L8 10L8 19L5 19a2 2 0 0 1 -2 -2ZM16 10L21 10L21 17a2 2 0 0 1 -2 2L16 19ZM9 12L15 12L15 14L9 14ZM10 16L14 16L14 18L10 18Z","plus-size":"M9.4 4.3a2.6 2.6 0 1 0 5.2 0a2.6 2.6 0 1 0 -5.2 0zM5 20L4 13C4 10.5 7 9.5 12 9.5C17 9.5 20 10.5 20 13L19 20Z","lift-armrest":"M5 6L8 6L8 19L5 19zM5 16L18 16L18 19L5 19zM8 12L17 12L17 14.5L8 14.5zM14 7L16 7L16 12L14 12zM12 7L18 7L15 3Z"},vR=U1.wheelchair;var Ti=["#e69f00","#56b4e9","#009e73","#f0e442","#0072b2","#d55e00","#cc79a7"],qm="#a4508b";var As={facilities:qm,"food-drink":Ti[5],navigation:Ti[2],accessibility:Ti[4]},Oi=Zm,Rs={minDiameterPx:12,glyphScale:.66,ringRatio:1/14,largeFromPx:24};var Qe=e=>{let t=Math.round(e*100)/100;return Object.is(t,-0)?"0":String(t)},_o=e=>`${Qe(e[0])} ${Qe(e[1])}`,Io=(e,t,n,o)=>[e+n*Math.cos(o*Math.PI/180),t+n*Math.sin(o*Math.PI/180)];function uh(e){let t=`M${_o(e.from)}`;for(let n of e.segs)t+=n.arc?`A${Qe(n.arc.r)} ${Qe(n.arc.r)} 0 ${n.arc.large} ${n.arc.sweep} ${_o(n.to)}`:`L${_o(n.to)}`;return`${t}Z`}function Je(e){let t=[e.from,...e.segs.map(o=>o.to)],n=[];for(let o=e.segs.length-1;o>=0;o--){let r=e.segs[o].arc;n.push({to:t[o],arc:r&&{...r,sweep:r.sweep?0:1}})}return{from:t[t.length-1],segs:n}}function et(e,t,n){let o={r:n,large:0,sweep:1};return{from:[e-n,t],segs:[{to:[e+n,t],arc:o},{to:[e-n,t],arc:o}]}}function Se(e,t,n,o,r){let i=Math.min(r,n/2,o/2),a={r:i,large:0,sweep:1};return i<=0?rt([[e,t],[e+n,t],[e+n,t+o],[e,t+o]]):{from:[e+i,t],segs:[{to:[e+n-i,t]},{to:[e+n,t+i],arc:a},{to:[e+n,t+o-i]},{to:[e+n-i,t+o],arc:a},{to:[e+i,t+o]},{to:[e,t+o-i],arc:a},{to:[e,t+i]},{to:[e+i,t],arc:a}]}}function rt(e){let t=0;for(let o=0;o<e.length;o++){let[r,i]=e[o],[a,s]=e[(o+1)%e.length];t+=r*s-a*i}let n=t>0?e:[...e].reverse();return{from:n[0],segs:[...n.slice(1).map(o=>({to:o})),{to:n[0]}]}}function je(e,t,n){let o=n/2,r=t[0]-e[0],i=t[1]-e[1],a=Math.hypot(r,i);if(a<1e-6)return et(e[0],e[1],o);let s=[i/a*o,-r/a*o],c={r:o,large:0,sweep:1},l=[e[0]+s[0],e[1]+s[1]];return{from:l,segs:[{to:[t[0]+s[0],t[1]+s[1]]},{to:[t[0]-s[0],t[1]-s[1]],arc:c},{to:[e[0]-s[0],e[1]-s[1]]},{to:l,arc:c}]}}function ot(e,t,n=!1){let o=[],r=n?e.length:e.length-1;for(let i=0;i<r;i++)o.push(je(e[i],e[(i+1)%e.length],t));return o}function zt(e,t,n,o,r,i){let a=i/2,s=r-o>180?1:0,c={r:a,large:0,sweep:1},l=Io(e,t,n+a,o);return{from:l,segs:[{to:Io(e,t,n+a,r),arc:{r:n+a,large:s,sweep:1}},{to:Io(e,t,n-a,r),arc:c},{to:Io(e,t,n-a,o),arc:{r:n-a,large:s,sweep:0}},{to:l,arc:c}]}}var Re=(...e)=>e.flat().map(uh).join(" "),Mt=(e,t,n)=>`M${Qe(e-n)} ${Qe(t)}a${Qe(n)} ${Qe(n)} 0 1 0 ${Qe(2*n)} 0a${Qe(n)} ${Qe(n)} 0 1 0 ${Qe(-2*n)} 0`,Qt=(e,t,n,o,r)=>uh(Se(e,t,n,o,r)),Li=e=>`M${e.map(_o).join("L")}`,ki=(e,t,n,o,r)=>`M${_o(Io(e,t,n,o))}A${Qe(n)} ${Qe(n)} 0 ${r-o>180?1:0} 1 ${_o(Io(e,t,n,r))}`;function Ro(e,t,n,o=1){let r=i=>[i[0]*o+t,i[1]*o+n];return{head:[e.head[0]*o+t,e.head[1]*o+n,e.head[2]*o],limbs:e.limbs.map(i=>i.map(r)),arcs:e.arcs?.map(([i,a,s,c,l])=>[i*o+t,a*o+n,s*o,c,l])}}function yr(e){return[Mt(e.head[0],e.head[1],e.head[2]),...e.limbs.map(Li),...(e.arcs??[]).map(([t,n,o,r,i])=>ki(t,n,o,r,i))].join(" ")}function Eo(e,t=2.6){return[et(e.head[0],e.head[1],e.head[2]+1),...e.limbs.flatMap(n=>ot(n,t)),...(e.arcs??[]).map(([n,o,r,i,a])=>zt(n,o,r,i,a,t-.2))]}var Vn={head:[10,4,2],limbs:[[[10,8.2],[10,14],[15.5,14],[18,19.5],[20.5,19.5]],[[10,10.6],[14.5,10.6]]],arcs:[[9.5,16,5.5,35,235]]},Qm={head:[10.6,3.9,1.9],limbs:[[[9.6,7.8],[7.6,12]],[[5.4,8.2],[9.4,8.4],[12.8,10]],[[4,15.6],[7.6,12],[11,13.6],[10.6,16.4]]]},Jm={cx:12,hr:1.9,arm:5,leg:3,r:2},eh={cx:12,hr:1.9,sh:2.2,hem:6,leg:3},th={cx:6.2,hr:1.8,arm:3.6,leg:2.2,r:1.4},nh={cx:17.8,hr:1.8,sh:1.4,hem:4.1,leg:2.2};function oh({cx:e,hr:t,arm:n,leg:o,r}){return[Mt(e,2+t,t),`M${Qe(e-n+r)} 8.5H${Qe(e+n-r)}a${r} ${r} 0 0 1 ${r} ${r}V15H${Qe(e+o)}V22H${Qe(e-o)}V15H${Qe(e-n)}V${Qe(8.5+r)}a${r} ${r} 0 0 1 ${r} ${-r}Z`,`M${Qe(e)} 15V22`].join(" ")}function rh({cx:e,hr:t,arm:n,leg:o,r}){return[et(e,2+t,t+1),Se(e-n-.5,7.8,2*n+1,7.7,r+.5),Se(e-o-.5,13,o,9.5,1),Se(e+.5,13,o,9.5,1)]}function ih({cx:e,hr:t,sh:n,hem:o,leg:r}){return[Mt(e,2+t,t),Li([[e-n,8.5],[e+n,8.5],[e+o,16],[e+r,16],[e+r,22],[e-r,22],[e-r,16],[e-o,16]])+"Z",`M${Qe(e)} 16V22`].join(" ")}function ah({cx:e,hr:t,sh:n,hem:o,leg:r}){return[et(e,2+t,t+1),rt([[e-n-.6,7.8],[e+n+.6,7.8],[e+o+.9,16.8],[e-o-.9,16.8]]),Se(e-r-.1,15,r-.4,7.5,.9),Se(e+.5,15,r-.4,7.5,.9)]}var W1=[[14.6,1.5],[5.2,13.6],[11,13.6],[9.4,22.5],[18.8,10.4],[13,10.4]],j1="M8.5 3.5 4 5.5l-1.5 5 3 1 1-2v11h11v-11l1 2 3-1-1.5-5-4.5-2c-.5 1.5-1.8 2.5-3.5 2.5s-3-1-3.5-2.5Z",X1="M12 2.5S5 9.5 5 14.5a7 7 0 0 0 14 0c0-5-7-12-7-12Z",K1="M2.5 21.5h19V3h-6v6.2H9.2v6.2H2.5Z",sh=[[9,3],[15,3],[15,9],[21,9],[21,15],[15,15],[15,21],[9,21],[9,15],[3,15],[3,9],[9,9]],Y1={from:[3.8,5.2],segs:[{to:[20.2,5.2]},{to:[22,7],arc:{r:1.8,large:0,sweep:1}},{to:[22,9.7]},{to:[22,14.3],arc:{r:2.3,large:0,sweep:0}},{to:[22,17]},{to:[20.2,18.8],arc:{r:1.8,large:0,sweep:1}},{to:[3.8,18.8]},{to:[2,17],arc:{r:1.8,large:0,sweep:1}},{to:[2,14.3]},{to:[2,9.7],arc:{r:2.3,large:0,sweep:0}},{to:[2,7]},{to:[3.8,5.2],arc:{r:1.8,large:0,sweep:1}}]},$1={from:[12,1.6],segs:[{to:[20.4,4.9]},{to:[20.4,11.2]},{to:[12,22.4],arc:{r:13,large:0,sweep:1}},{to:[3.6,11.2],arc:{r:13,large:0,sweep:1}},{to:[3.6,4.9]},{to:[12,1.6]}]};function ch(e,t,n){return{from:[e-n,t],segs:[{to:[e+n,t],arc:{r:n,large:0,sweep:1}},{to:[e-n,t]}]}}var lh={head:[13.2,4.3,2.2],limbs:[[[12.6,8.6],[11.2,15],[17.8,18.4],[9.4,18.4]],[[12.4,9.8],[16,14.4]]]},Z1=[[6,10.5],[15,10.5],[16.5,7],[18.5,5.5],[20,6.5],[21.5,8.5],[19.5,10],[18,12],[18,19],[16.5,19],[15.5,14],[9.5,14],[8.5,19],[7,19],[6.5,13]],q1=[[5.4,9.8],[14.6,9.8],[16.1,6.4],[18.4,4.6],[20.5,5.9],[22.4,8.6],[19.9,10.6],[18.8,12.3],[18.8,19.8],[15.8,19.8],[15,14.8],[10.1,14.8],[9.2,19.8],[6.2,19.8],[5.6,13.2]],Es=[{key:"restroom-men",label:"Men's restroom",group:"facilities",path:oh(Jm),solid:Re(rh(Jm))},{key:"restroom-women",label:"Women's restroom",group:"facilities",path:ih(eh),solid:Re(ah(eh))},{key:"restroom-accessible",label:"Accessible restroom",group:"facilities",path:[Qt(2.5,2.5,19,19,3.5),yr(Ro(Vn,4.6,4.3,.66))].join(" "),solid:Re(Eo(Vn)),solidLarge:Re(Se(1.5,1.5,21,21,4.5),Je(Se(3.9,3.9,16.2,16.2,2.6)),Eo(Ro(Vn,4.9,4.7,.62),2.2))},{key:"first-aid",label:"First aid",group:"facilities",path:Li(sh)+"Z",solid:Re(rt(sh.map(([e,t])=>[e+(e-12)*.08,t+(t-12)*.08])))},{key:"coat-check",label:"Coat check",group:"facilities",path:"M10 6.5a2 2 0 1 1 2 2V10 M12 10 3.4 16.9a1.4 1.4 0 0 0 .9 2.6h15.4a1.4 1.4 0 0 0 .9-2.6Z",solid:Re(zt(12,6.2,2.2,180,450,2.3),je([12,8.4],[12,10.5],2.3),ot([[12,10.2],[3.2,18.8],[20.8,18.8]],2.8,!0))},{key:"atm",label:"ATM / cash",group:"facilities",path:[Qt(2,6,20,12,2),Mt(12,12,2.75),"M6 12h.01 M18 12h.01"].join(" "),solid:Re(Se(1.5,5.5,21,13,2.4),Je(et(12,12,3.2)))},{key:"info",label:"Info point",group:"facilities",path:[Mt(12,12,9.5),"M10.8 11H12v5.8 M12 7.6h.01"].join(" "),solid:Re(et(12,4.9,2.4),Se(10.3,9.2,3.4,12.3,1),Se(8.2,9.2,4,3,1),Se(8.2,18.5,7.6,3,1))},{key:"lost-found",label:"Lost & found",group:"facilities",path:[Mt(10.5,10.5,7.5),"M16 16l5.5 5.5","M8.4 8.4a2.1 2.1 0 1 1 3 1.9c-.6.4-.9.8-.9 1.6 M10.5 14.6h.01"].join(" "),solid:Re(zt(12,7.6,4.2,180,405,3.4),ot([[14.97,10.57],[12,13],[12,15]],3.4),et(12,20,2.1))},{key:"restrooms",label:"Toilets",group:"facilities",path:[oh(th),ih(nh)].join(" "),solid:Re(rh(th),ah(nh))},{key:"charging",label:"Charging point",group:"facilities",path:[Qt(6,2,12,20,2.5),"M13.2 6.2 9.6 12h4.8l-3.6 5.8"].join(" "),solid:Re(rt(W1))},{key:"smoking",label:"Smoking area",group:"facilities",path:[Qt(2,14.5,14.5,4,1),"M6.5 14.5v4","M15.5 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4 M19 11.5c0-1.4 1.5-1.9 1.5-3.4s-1.5-2-1.5-3.4"].join(" "),solid:Re(Se(1.5,14,4.2,5,1.2),Se(6.8,14,10.4,5,1.2),ot([[15.9,11.4],[17.3,8.9],[15.9,6.4],[17.1,3.9]],2.2),ot([[19.6,11.4],[21,8.9],[19.6,6.4],[20.8,3.9]],2.2))},{key:"no-smoking",label:"No smoking",group:"facilities",path:[Mt(12,12,9.5),"M5.3 5.3l13.4 13.4","M5.5 10.5h13v3h-13Z"].join(" "),solid:Re(et(12,12,10.6),Je(et(12,12,8)),je([6,6],[18,18],2.8),Se(5,10.4,3,3.2,.6),Se(16,10.4,3,3.2,.6))},{key:"food",label:"Food",group:"food-drink",path:"M5 2.5V8a2.5 2.5 0 0 0 5 0V2.5 M7.5 2.5v19 M18.5 13.5h-2c-1.3 0-2-1-2-2.5 0-4 1.5-7 4-8.5v19",solid:Re(ot([[4.9,2.6],[4.9,8]],2.2),ot([[10.1,2.6],[10.1,8]],2.2),ot([[7.5,2.6],[7.5,8]],2.2),zt(7.5,8,2.6,0,180,2.2),je([7.5,10],[7.5,21.4],3),rt([[19.4,2.2],[19.4,14.2],[16.2,14.2],[14.1,12],[14.1,9.4],[15.2,5.8],[17.3,3.3]]),je([18,13],[18,21.4],3))},{key:"bar",label:"Bar",group:"food-drink",path:"M3.5 3.5h17L12 13Z M6.2 6.5h11.6 M12 13v7.5 M8 20.5h8",solid:Re(rt([[2.8,3],[21.2,3],[12,13.6]]),je([12,12],[12,20.6],2.8),je([7.4,21],[16.6,21],2.8))},{key:"coffee",label:"Caf\xE9 / coffee",group:"food-drink",path:"M4 9h12v4.5a5.5 5.5 0 0 1-5.5 5.5h-1A5.5 5.5 0 0 1 4 13.5Z M16 10.5h1.2a2.75 2.75 0 0 1 0 5.5H16 M8 3v3 M12 3v3 M3 21.5h14",solid:Re({from:[3.4,8.4],segs:[{to:[16.6,8.4]},{to:[16.6,13.4]},{to:[11,19.4],arc:{r:5.8,large:0,sweep:1}},{to:[9,19.4]},{to:[3.4,13.4],arc:{r:5.8,large:0,sweep:1}},{to:[3.4,8.4]}]},zt(17.2,13.25,2.5,270,450,2.4),je([7.8,2.6],[7.8,5.6],2.4),je([12.2,2.6],[12.2,5.6],2.4),je([2.6,21.6],[17.4,21.6],2.6))},{key:"water",label:"Water / drinks",group:"food-drink",path:X1,solid:"M12 1.2S4 8.9 4 14.5a8 8 0 0 0 16 0c0-5.6-8-13.3-8-13.3Z"},{key:"merch",label:"Merch / shop",group:"food-drink",path:j1,solid:"M8.4 2.8 3.5 5l-1.9 6 4.2 1.4.4-.8v9.4h11.6v-9.4l.4.8 4.2-1.4-1.9-6-4.9-2.2c-.4 1.5-1.8 2.6-3.6 2.6s-3.2-1.1-3.6-2.6Z"},{key:"screen",label:"Screen",group:"facilities",path:[Qt(2,3.5,20,13.5,2),"M12 17v3.5 M8 20.5h8","M10 7.8v5.9l5-2.95Z"].join(" "),solid:Re(Se(1.5,3,21,14.4,2.4),Je(rt([[9.6,6.7],[16,10.2],[9.6,13.7]])),Se(10.6,16.5,2.8,4,0),je([7.4,21],[16.6,21],2.8))},{key:"sound-booth",label:"Sound booth",group:"facilities",path:["M6 3v9 M6 16v5 M12 3v3 M12 10v11 M18 3v10 M18 17v4",Mt(6,14,2),Mt(12,8,2),Mt(18,15,2)].join(" "),solid:Re(je([6,2.8],[6,21.2],1.8),je([12,2.8],[12,21.2],1.8),je([18,2.8],[18,21.2],1.8),Se(3.2,11.6,5.6,4.8,1.4),Se(9.2,5.6,5.6,4.8,1.4),Se(15.2,12.6,5.6,4.8,1.4))},{key:"entrance",label:"Entrance",group:"navigation",path:"M11 7V3.5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v17a1 1 0 0 1-1 1h-8a1 1 0 0 1-1-1V17 M2.5 12h13.5 M12.5 8.5 16 12l-3.5 3.5",solid:Re(ot([[11,6.5],[11,2.6],[21,2.6],[21,21.4],[11,21.4],[11,17.5]],2.6),je([2.8,12],[13.5,12],3.2),rt([[12.6,7.8],[18,12],[12.6,16.2]]))},{key:"exit",label:"Exit",group:"navigation",path:"M13 7V3.5a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v17a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V17 M8 12h13.5 M18 8.5l3.5 3.5-3.5 3.5",solid:Re(ot([[13,6.5],[13,2.6],[3,2.6],[3,21.4],[13,21.4],[13,17.5]],2.6),je([7.2,12],[17,12],3.2),rt([[16.2,7.8],[21.6,12],[16.2,16.2]]))},{key:"emergency-exit",label:"Emergency exit",group:"navigation",path:[yr(Ro(Qm,-2,1.4,1.15)),"M15.5 13h6 M19 10.5l2.5 2.5-2.5 2.5"].join(" "),solid:Re(Eo(Ro(Qm,-2,1.4,1.15),2.7),je([15.6,13],[19.5,13],2.8),rt([[18.4,9.4],[22.4,13],[18.4,16.6]]))},{key:"stairs",label:"Stairs",group:"navigation",path:K1,solid:"M1.5 22.5h21V2h-7.8v6.4H8.4v6.4H1.5Z"},{key:"elevator",label:"Elevator",group:"navigation",path:[Qt(3.5,2.5,17,19,2.5),"M8.5 9.5 12 5.5l3.5 4Z M8.5 14.5l3.5 4 3.5-4Z"].join(" "),solid:Re(rt([[12,1.6],[19.6,10.2],[4.4,10.2]]),rt([[4.4,13.8],[19.6,13.8],[12,22.4]]))},{key:"parking",label:"Parking",group:"navigation",path:[Qt(3,3,18,18,3),"M9.5 17V7h3.75a3 3 0 0 1 0 6H9.5"].join(" "),solid:"M6.5 21V3H12a5.5 5.5 0 0 1 0 11h-1.9v7Z M10.1 6.6v3.8H12a1.9 1.9 0 0 0 0-3.8Z"},{key:"wheelchair",label:"Wheelchair access",group:"accessibility",path:yr(Vn),solid:Re(Eo(Vn))},{key:"hearing",label:"Hearing assistance",group:"accessibility",path:["M4 9a6 6 0 1 1 12 0c0 3-1.8 4.3-3 5.2-1.1.8-1.6 1.7-1.6 3.1a3.6 3.6 0 0 1-6.2 2.1","M7.5 9a2.5 2.5 0 0 1 5 0c0 1.2-.7 1.9-1.6 2.5","M18.5 5.5a6.5 6.5 0 0 1 0 8"].join(" "),solid:Re(zt(10,9,6,180,380,3),ot([[15.64,11.05],[12.8,14.3],[11.5,17.2]],3),zt(8.2,17.2,3.3,0,150,3),zt(10,9,2.2,180,400,2.4),zt(13.38,9.5,6.5,322,398,2.6))},{key:"box-office",label:"Box office / tickets",group:"navigation",path:"M3 7.5A1.5 1.5 0 0 1 4.5 6h15A1.5 1.5 0 0 1 21 7.5V10a2 2 0 0 0 0 4v2.5a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 16.5V14a2 2 0 0 0 0-4Z M15 6v2 M15 11v2 M15 16v2",solid:Re(Y1,Je(Se(14.1,7,1.8,2.2,.9)),Je(Se(14.1,10.9,1.8,2.2,.9)),Je(Se(14.1,14.8,1.8,2.2,.9)))},{key:"escalator",label:"Escalator",group:"navigation",path:"M2.5 17H7l9-9h5.5v4h-4l-9 9h-6Z M11 4.5h.01 M11 8.2v3.3",solid:Re(rt([[2,16.4],[6.8,16.4],[15.8,7.4],[22,7.4],[22,12.6],[17.8,12.6],[8.8,21.6],[2,21.6]]),et(11,4.3,2.3),je([11,8],[11,11],2.6))},{key:"ramp",label:"Ramp",group:"navigation",path:"M2.5 19.5h19v-10Z M4.5 13.2 14 8.2 M10.53 7.76 14 8.2l-1.6 3.11",solid:Re(rt([[1.6,20.4],[22.4,20.4],[22.4,8.6]]),je([4.2,13.4],[13.2,8.6],2.6),rt([[15.4,7.5],[13.16,11.84],[10.56,6.88]]))},{key:"taxi",label:"Taxi / rideshare",group:"navigation",path:["M9.5 2.5h5V5h-5Z M6.5 11 8 7h8l1.5 4",Qt(3.5,11,17,6,2),"M6.5 17v2.5 M17.5 17v2.5 M7 14h.01 M17 14h.01"].join(" "),solid:Re(Se(9,1.8,6,3.4,.8),rt([[6,11.4],[7.6,6.4],[16.4,6.4],[18,11.4]]),Se(2.8,10.6,18.4,7,2.2),Je(et(6.8,14,1.3)),Je(et(17.2,14,1.3)),Se(4.8,16,3.6,5.2,1.2),Se(15.6,16,3.6,5.2,1.2))},{key:"transit",label:"Bus / transit",group:"navigation",path:[Qt(4.5,2.5,15,16,3),"M4.5 10.5h15 M9 5.5h6 M7.5 18.5V21 M16.5 18.5V21 M8 14.5h.01 M16 14.5h.01"].join(" "),solid:Re(Se(4,2,16,17,3.2),Je(Se(6.2,5.8,11.6,5,1)),Je(et(8,14.5,1.3)),Je(et(16,14.5,1.3)),Se(6,17,3.4,5,1.2),Se(14.6,17,3.4,5,1.2))},{key:"bike-parking",label:"Bike parking",group:"navigation",path:[Mt(6,14.5,4),Mt(18,14.5,4),"M6 14.5 9 7.5h6.5L18 14.5 M9 7.5l2.5 7H6 M11.5 14.5l4-7 M7.5 6h3 M15.5 7.5 15 5.5h2"].join(" "),solid:Re(et(6,14.5,4.9),Je(et(6,14.5,2.7)),et(18,14.5,4.9),Je(et(18,14.5,2.7)),ot([[6,14.5],[9,7.5],[15.5,7.5],[18,14.5]],2.2),ot([[9,7.5],[11.5,14.5],[15.5,7.5]],2.2),je([6,14.5],[11.5,14.5],2.2),je([7.2,5.8],[10.6,5.8],2.2),ot([[15.4,7.3],[15,5.4],[17.2,5.4]],2.2))},{key:"meeting-point",label:"Meeting point",group:"navigation",path:["M9.5 2.5 12 5l2.5-2.5 M9.5 21.5 12 19l2.5 2.5 M2.5 9.5 5 12l-2.5 2.5 M21.5 9.5 19 12l2.5 2.5",Mt(10,9.6,1.5),Mt(14,9.6,1.5),"M7.5 15.5a2.5 2.5 0 0 1 5 0 M11.5 15.5a2.5 2.5 0 0 1 5 0"].join(" "),solid:Re(ot([[9.4,2.4],[12,5],[14.6,2.4]],2.6),ot([[9.4,21.6],[12,19],[14.6,21.6]],2.6),ot([[2.4,9.4],[5,12],[2.4,14.6]],2.6),ot([[21.6,9.4],[19,12],[21.6,14.6]],2.6),et(9.7,9.3,2.2),et(14.3,9.3,2.2),ch(9.7,16,3),ch(14.3,16,3))},{key:"security",label:"Security / bag check",group:"facilities",path:"M12 2.5 19.5 5.5v6c0 4.6-3.2 8.4-7.5 10-4.3-1.6-7.5-5.4-7.5-10v-6Z M8.5 12l2.5 2.5 4.5-5",solid:Re($1,Je(rt([[7.4,12.2],[9,10.6],[10.9,12.5],[15,8.4],[16.6,10],[10.9,15.7]])))},{key:"lockers",label:"Lockers",group:"facilities",path:[Qt(3.5,2.5,17,19,1.5),"M12 2.5v19 M6 6h3 M15 6h3 M9.5 11.5v2.5 M14.5 11.5v2.5"].join(" "),solid:Re(Se(3,2,8.4,20,1.4),Je(Se(5,5,4.4,1.7,.8)),Je(Se(8.6,10.8,1.5,3.8,.7)),Se(12.6,2,8.4,20,1.4),Je(Se(14.6,5,4.4,1.7,.8)),Je(Se(13.9,10.8,1.5,3.8,.7)))},{key:"baby-change",label:"Baby change",group:"facilities",path:"M10 6.5l.8-3.3a1.2 1.2 0 0 1 2.4 0l.8 3.3 M8.5 6.5h7 M9.5 6.5l-.9 2.2a3 3 0 0 0-.1.9V19a2.5 2.5 0 0 0 2.5 2.5h2a2.5 2.5 0 0 0 2.5-2.5V9.6a3 3 0 0 0-.1-.9l-.9-2.2 M8.5 12.5h3 M8.5 16h3",solid:Re(rt([[9.6,6.2],[10.6,1.8],[13.4,1.8],[14.4,6.2]]),Se(7.6,5.4,8.8,2.6,1),Se(7.8,7.4,8.4,15,2.6),Je(Se(7.8,11.8,3.4,1.5,0)),Je(Se(7.8,15.4,3.4,1.5,0)))},{key:"prayer-room",label:"Prayer room",group:"facilities",path:[yr(lh),"M3 21.5h18"].join(" "),solid:Re(Eo(lh),Se(2.4,20.2,19.2,2.6,1.3))},{key:"quiet-room",label:"Quiet room",group:"facilities",path:"M4 9h3.5l5-4v14l-5-4H4Z M15.5 9.5l5 5 M20.5 9.5l-5 5",solid:Re(rt([[2.6,8.4],[7.2,8.4],[13,3.6],[13,20.4],[7.2,15.6],[2.6,15.6]]),je([15.4,9.2],[20.8,14.8],2.8),je([20.8,9.2],[15.4,14.8],2.8))},{key:"wifi",label:"Wi-Fi",group:"facilities",path:[ki(12,19,11.5,218,322),ki(12,19,7.5,218,322),ki(12,19,3.5,218,322),"M12 19h.01"].join(" "),solid:Re(zt(12,19.2,11,218,322,2.8),zt(12,19.2,6.9,218,322,2.8),et(12,19.2,2.2))},{key:"vip-lounge",label:"VIP lounge",group:"facilities",path:["M6.5 11V7a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4","M3.5 11.5a1.5 1.5 0 0 1 3 0V14h11v-2.5a1.5 1.5 0 0 1 3 0v6h-17Z","M5.5 17.5V20 M18.5 17.5V20"].join(" "),solid:Re(Se(6,4,12,8.5,2.2),Se(2.4,9.6,4.6,9,2.2),Se(17,9.6,4.6,9,2.2),Se(6,13.2,12,5.4,.6),je([5,18],[5,20.6],2.4),je([19,18],[19,20.6],2.4))},{key:"accessible-entrance",label:"Accessible entrance",group:"accessibility",path:[yr(Ro(Vn,.3,5,.62)),"M12.5 3.5H20a1 1 0 0 1 1 1v15a1 1 0 0 1-1 1h-7.5"].join(" "),solid:Re(Eo(Ro(Vn,.3,5,.62),2.2),ot([[13,2.8],[21.2,2.8],[21.2,21.2],[13,21.2]],2.6))},{key:"assistance-dog",label:"Assistance-dog area",group:"accessibility",path:[Li(Z1)+"Z","M6 10.8 3.5 7.5","M10.5 10.5V6h4.5l1 2.5"].join(" "),solid:Re(rt(q1),je([6.2,11],[3.2,7.2],2.4),ot([[10.5,11],[10.5,5.6],[15.2,5.6],[16.2,8.2]],2.2))}],RR=new Map(Es.map(e=>[e.key,e]));var mh=Es;var Q1=new Map(mh.map(e=>[e.key,e]));function xr(e){return e?Q1.get(e):void 0}var CR=mh.map(e=>e.key);function Mr(e){if(e.length<3)return e.map(n=>({...n}));let t=bo(e);return t.length>=3?t:[...e].sort((n,o)=>n.x-o.x||n.y-o.y).map(n=>({...n}))}var J1=.8,ex=.6,tx=2;function Mn(e,t){if(!t.length)return null;let n=[],o=0;for(let a of e.objects){if(a.type!=="shape"||a.role!=="wall")continue;let s=Pe(a)??[],c=hh(s)/2;!(c>0)||rx(s)/c*I>tx||(n.push(...s),o+=c)}if(n.length<3)return null;let r=Mr(n);if(r.length<3||o<hh(r)*ex)return null;let i=0;for(let a of t)ix(a,r)&&(i+=1);return i>=t.length*J1?r:null}var Fi=6,nx=5,ox=8;function fh(e){return Math.max(ox,(Number.isFinite(e)?e:0)+nx)}function Co(e){let t=0,n=0,o=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length],s=i.x*a.y-a.x*i.y;t+=s,n+=(i.x+a.x)*s,o+=(i.y+a.y)*s}if(Math.abs(t)<1e-9){let r=0,i=0;for(let a of e)r+=a.x,i+=a.y;return{x:r/Math.max(1,e.length),y:i/Math.max(1,e.length)}}return{x:n/(3*t),y:o/(3*t)}}function rx(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2}function hh(e){let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=Math.hypot(r.x-o.x,r.y-o.y)}return t}function ix(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function dh(e,t,n,o=[],r){if(t<1)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0,l=-1/0,u=(v,P)=>{v<i&&(i=v),v>a&&(a=v),P<s&&(s=P),P>c&&(c=P)};for(let v=0;v<t;v++)u(e[v*3],e[v*3+2]),e[v*3+1]>l&&(l=e[v*3+1]);for(let[v,P]of o)u(v,P);if(!Number.isFinite(i)||!Number.isFinite(l))return null;let m=(i+a)/2,h=(s+c)/2,f=Math.max(4,(a-i)/2),d=Math.max(4,(c-s)/2),p=1,b=(v,P)=>{let w=Math.hypot((v-m)/f,(P-h)/d);w>p&&(p=w)};for(let v=0;v<t;v++)b(e[v*3],e[v*3+2]);for(let[v,P]of o)b(v,P);let y=Math.min(9,Math.max(5,2*Math.max(f,d)*.1)),g=Math.max(n+8,l+y);return{centre:[m,h],radii:[f*p+6,d*p+6],floorY:n,ceilingY:r===void 0?g:Math.max(r,l+5)}}function ax(e){return{kind:"radial",rowCount:0,rows:[],nearestRow:()=>-1,depthAt:(t,n)=>Math.hypot(t-e.x,n-e.y),gradientAt:(t,n)=>{let o=t-e.x,r=n-e.y,i=Math.hypot(o,r);return i<1e-9?[0,0]:[o/i,r/i]}}}function sx(e,t){if(!e.length)return null;let n=0,o=0,r=0;for(let f of e)n+=f.x,o+=f.y,r+=Math.hypot(f.x-t.x,f.y-t.y);let i=e.length;n/=i,o/=i,r/=i;let a=e[0],s=-1;for(let f of e){let d=Math.hypot(f.x-n,f.y-o);d>s&&(s=d,a=f)}let c=a.x-n,l=a.y-o,u=Math.hypot(c,l);u>1e-9?(c/=u,l/=u):(c=1,l=0);let m=[...e].sort((f,d)=>(f.x-n)*c+(f.y-o)*l-((d.x-n)*c+(d.y-o)*l)),h=0;for(let f of m){let d=Math.hypot(f.x-n,f.y-o);d>h&&(h=d)}return{pts:m,cx:n,cy:o,radius:h,depth:r}}function ph(e,t,n){let o=e.pts;if(o.length===1)return Math.hypot(t-o[0].x,n-o[0].y);let r=1/0;for(let i=0;i+1<o.length;i++){let a=o[i],s=o[i+1],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>1e-12?((t-a.x)*c+(n-a.y)*l)/u:0;m<0?m=0:m>1&&(m=1);let h=Math.hypot(t-(a.x+m*c),n-(a.y+m*l));h<r&&(r=h)}return r}var Di=8;function cx(e,t,n){let o=new Array(Di).fill(1/0),r=new Array(Di).fill(-1);for(let u=0;u<e.length;u++){let m=e[u],h=Math.hypot(t-m.cx,n-m.cy)-m.radius;for(let f=0;f<Di;f++)if(h<o[f]){for(let d=Di-1;d>f;d--)o[d]=o[d-1],r[d]=r[d-1];o[f]=h,r[f]=u;break}}let i=new Array(3).fill(1/0),a=new Array(3).fill(-1);for(let u of r){if(u<0)continue;let m=ph(e[u],t,n);for(let h=0;h<3;h++)if(m<i[h]){for(let f=2;f>h;f--)i[f]=i[f-1],a[f]=a[f-1];i[h]=m,a[h]=u;break}}if(a[0]<0)return 0;if(i[0]<1e-6)return e[a[0]].depth;let s=i[0]*2.2,c=0,l=0;for(let u=0;u<3;u++){let m=a[u];if(m<0||i[u]>s)continue;let h=1/(i[u]*i[u]);c+=h*e[m].depth,l+=h}return l>0?c/l:e[a[0]].depth}function lx(e){let t=(o,r)=>cx(e,o,r),n=(o,r)=>{let i=1/0,a=-1;for(let s=0;s<e.length;s++){let c=e[s];if(Math.hypot(o-c.cx,r-c.cy)-c.radius>=i)continue;let l=ph(c,o,r);l<i&&(i=l,a=s)}return a};return{kind:"rows",rowCount:e.length,rows:e,nearestRow:n,depthAt:t,gradientAt:(o,r)=>{let i=(t(o+.5,r)-t(o-.5,r))/1,a=(t(o,r+.5)-t(o,r-.5))/(2*.5),s=Math.hypot(i,a);return s<1e-9?[0,0]:[i/s,a/s]}}}function bh(e,t){let n=[];for(let o of e){let r=sx(o.points,t);r&&n.push(r)}return n.length<2?ax(t):(n.sort((o,r)=>o.depth-r.depth),lx(n))}var vn=.06,ux=.05,yh=.05,gh=.15,Is=25;function xh(e,t,n){let o=new Map,r=new Array(t.length).fill(null),i=new Float64Array(t.length),a=new Array(t.length).fill(void 0),s=new Array(t.length).fill(void 0),c=new Map,l=[],u=new Set;for(let h=0;h<e.length;h+=1){let f=e[h];for(let d of f.objects){if(d.type==="table"&&u.add(d.id),d.type!=="section"||!d.outline||d.outline.length<3)continue;let p=Zt(d.outline,Ot);c.set(d.id,{section:d,unit:f,frontU:1/0,hasSeats:!1,rows:new Map,seatIndices:[]}),l.push({id:d.id,floorIndex:h,box:ln(p),section:d,unit:f,outline:p})}}let m=new Map;for(let h of l){let f=m.get(h.floorIndex);f?f.push(h):m.set(h.floorIndex,[h])}for(let h=0;h<t.length;h++){let f=t[h],d=n?m.get(n[h])??[]:l,p=f.sectionId?d.find(y=>y.id===f.sectionId)??d.find(y=>y.section.logicalSectionId===f.sectionId&&mt({x:f.x,y:f.y},y.outline,y.section.holes)):void 0,b=p?[p]:d;for(let y of b){if(n&&y.floorIndex!==n[h]||!p&&(f.x<y.box.minX||f.x>y.box.maxX||f.y<y.box.minY||f.y>y.box.maxY||!mt({x:f.x,y:f.y},y.outline,y.section.holes)))continue;r[h]=y.id;let g=c.get(y.id);g.hasSeats=!0;let v=f.focalPoint??y.unit.focal,P=Math.hypot(f.x-v.x,f.y-v.y);P<g.frontU&&(g.frontU=P),g.seatIndices.push(h);let w=f.rowId||`__seat-${h}`,x=g.rows.get(w);x?x.push({x:f.x,y:f.y}):g.rows.set(w,[{x:f.x,y:f.y}]);break}}for(let[h,f]of c){let d=bn(f.section,{floorBaseHeightM:f.unit.baseHeightM}),p=f.unit.baseHeightM,b=d.rake>0?Math.tan(d.rake*Math.PI/180):0,y=d.rake<=.01&&d.height<=p+.001,g=f.section.surfaceKind,v=g==="flat"?!0:g==="rakedRows"&&d.rake>.01?!1:y,P=f.hasSeats?pi(h,t,f.seatIndices,f.unit.focal):{sectionId:h,rows:[],blockCount:0},x=P.rows.length<2?bh([...f.rows.values()].map(F=>({points:F})),f.unit.focal):null,S=1/0;if(x){if(f.hasSeats)for(let F of f.rows.values())for(let N of F){let V=x.depthAt(N.x,N.y);V<S&&(S=V)}if(!f.hasSeats||!Number.isFinite(S)){S=1/0;for(let F of f.section.outline){let N=x.depthAt(F.x,F.y);N<S&&(S=N)}}}let A=p+ux,M=Math.max(A,d.height),E=F=>{let N=Math.max(0,F-S)*Me,V=Math.min(N*b,Is);return Math.max(A,d.height+V)},T=F=>{let N=Math.max(0,F)*Me,V=Math.min(N*b,Is);return Math.max(A,d.height+V)},k=v?[]:P.rows.map(F=>({pts:F.pts,y:T(F.blockDepth),depth:F.blockDepth,blockId:F.blockId,...u.has(F.id)?{patch:nm(F.pts,Ot)}:{}})),_=k.length?k[0].y:M,R=k.map(F=>{let N=F.patch&&F.patch.length>=3?F.patch:F.pts,V=0,H=0;for(let j of N)V+=j.x,H+=j.y;let L=N.length||1;V/=L,H/=L;let G=0;for(let j of N){let D=Math.hypot(j.x-V,j.y-H);D>G&&(G=D)}return{cx:V,cy:H,rad:G}}),C=v?()=>M:k.length>=2?(F,N)=>{let V=1/0,H=_;for(let L=0;L<k.length;L++){let G=R[L];if(Math.hypot(F-G.cx,N-G.cy)-G.rad>=V)continue;let j=k[L].patch,D=j&&j.length>=3?Ye(j,F,N)?0:mo(j,F,N):mo(k[L].pts,F,N);D<V&&(V=D,H=k[L].y)}return H}:(F,N)=>x?E(x.depthAt(F,N)):M,O=[0,1,0],B=k.length>=2||v?()=>O:(F,N)=>{if(!x)return O;let V=x.depthAt(F,N);if(V<=S)return O;let H=(V-S)*Me;if(H*b>=Is||d.height+H*b<=A)return O;let[L,G]=x.gradientAt(F,N);if(L===0&&G===0)return O;let j=1/Math.hypot(b,1);return[-L*b*j,j,-G*b*j]};if(!v)for(let F of P.rows){let N=T(F.blockDepth);for(let V of F.seatIndices)a[V]=N}for(let F of P.rows){let N=[];for(let j=1;j<F.pts.length;j++){let D=Math.hypot(F.pts[j].x-F.pts[j-1].x,F.pts[j].y-F.pts[j-1].y);D>1e-6&&N.push(D)}N.sort((j,D)=>j-D);let V=N.length?N[Math.floor(N.length/2)]:1/0,H=1/0,L=F.pts[Math.floor(F.pts.length/2)];if(L)for(let j of P.rows){if(j===F||j.blockId!==F.blockId)continue;let D=mo(j.pts,L.x,L.y);D>1e-6&&D<H&&(H=D)}let G=Math.min(V,Math.max(H,V*.5));if(Number.isFinite(G)&&G>0)for(let j of F.seatIndices)s[j]=G}o.set(h,{sectionId:h,deckAt:C,normalAt:B,flat:v,bottomY:p,rowLevels:k,landingY:_})}for(let h=0;h<t.length;h++){let f=r[h],d=t[h];if(f){let y=a[h];i[h]=(y??o.get(f).deckAt(d.x,d.y))+gh;continue}let p=d.eyeHeightM,b=Number.isFinite(p)?Math.max(0,p-Yt):0;i[h]=d.kind==="booth"?b+vn+gh:b}return{bySection:o,seatOwner:r,seatDeckY:h=>i[h],seatPitchU:h=>s[h]}}function To(e,t,n){if(e.length!==4||n<=t)return null;let o=It(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*I,i=Math.hypot(o[3].x-o[0].x,o[3].y-o[0].y)*I;if(r<1e-6||i<1e-6)return null;let a=Math.min(.22/r,.16),s=Math.min(.28,(n-t)*.13),c=Math.min(.065/i,.2);return{quad:o,side:a,face:c,opening:gt(o,a,1-a),openingTop:n-s}}function _s(e,t,n){if(e.length!==4||n-t<=.2)return null;let o=It(e),r=Math.hypot(o[1].x-o[0].x,o[1].y-o[0].y)*I;if(r<=1e-6)return null;let i=Math.min(.14,(n-t)*.08,r*.08),a=i/r,s=gt(o,a,1-a);return{quad:o,side:a,trim:i,inner:s,panel:mr(s,.15,.85),bottom:t+i,top:n-i}}function Mh(e,t,n,o){let r=_s(e,t,n);if(!r)return;let{panel:i}=r,a=(g,v)=>({x:(g.x+v.x)/2,y:(g.y+v.y)/2}),s=a(i[0],i[1]),c=a(i[3],i[2]),l=Math.hypot(s.x-o.x,s.y-o.y)<=Math.hypot(c.x-o.x,c.y-o.y),[u,m]=l?[i[0],i[1]]:[i[3],i[2]],h=l?{x:s.x-c.x,y:s.y-c.y}:{x:c.x-s.x,y:c.y-s.y},f=Math.hypot(h.x,h.y);if(f<1e-6)return;-(m.y-u.y)*h.x+(m.x-u.x)*h.y<0&&([u,m]=[m,u]);let d=Math.min(.006,f*I*.05),p=h.x/f*d,b=h.y/f*d,y=(g,v)=>[g.x*I+p,v,g.y*I+b];return[y(u,r.bottom),y(m,r.bottom),y(u,r.top),y(m,r.top)]}var Sh=jt(require("polygon-clipping"),1);var vh=jt(require("polygon-clipping"),1);function mn(e,t,n,o,r,i,a,s={}){let c=ln(t),l=s.ao??se,u=r.flatMap(p=>{if(p.role!=="entrance"&&p.role!=="exit")return[];let b=Pe(p);if(!b||b.length!==4||!po(c,ln(b)))return[];let y=s.portalBase??n,g=To(b,y,y+Gt(p).heightM);if(!g)return[];let v=Math.min(o,g.openingTop);return v<=n?[]:[{poly:g.opening,height:v}]});if(!u.length)return!1;let m=p=>p.map(b=>[b.x,b.y]),h=[m(t),...(s.holes??[]).map(m)],f=[n,...new Set(u.map(p=>p.height)),o].sort((p,b)=>p-b),d=[];try{for(let p=1;p<f.length;p++){let b=f[p-1],y=f[p];if(y-b<1e-6)continue;let g=u.filter(P=>P.height>b+1e-6).map(P=>[m(P.poly)]),v=g.length?vh.default.difference(h,...g):[h];d.push({low:b,high:y,polys:v})}}catch{return!1}for(let p of d)for(let b of p.polys){let[y,...g]=b.map(P=>P.map(([w,x])=>({x:w,y:x}))),v=P=>l.wallBottom+(l.top-l.wallBottom)*(P-n)/(o-n);ue(e,y,g,()=>p.high,p.low,i,a,{...l,top:v(p.high),wallBottom:v(p.low)})}return!0}var Cs={depthM:1.6,thicknessM:.35,minWallM:6};function Ni(e,t,n,o,r,i,a,s,c){let l=o-n;if(l<=0)return;let u=s&&(c??l)>=Cs.minWallM?mx(t,s):null,m=u?o-Cs.thicknessM:o,h=m-n,f=h<1.5?[[n,m,1]]:u?[[n,n+Math.min(.9,h*.18),.82],[n+Math.min(.9,h*.18),m,1]]:[[n,n+Math.min(.9,h*.18),.82],[n+Math.min(.9,h*.18),m-.1,1],[m-.1,m,1.1]],d=p=>se.wallBottom+(se.top-se.wallBottom)*(p-n)/l;for(let[p,b,y]of f){let g={...se,top:d(b),wallBottom:d(p)},v=oe(i,y),P=oe(a,y);mn(e,t,p,b,r,v,P,{portalBase:n,ao:g})||ue(e,t,void 0,()=>b,p,v,P,g)}for(let[p,...b]of u??[])ue(e,p,b.length?b:void 0,()=>o,m,oe(i,1.12),oe(a,.78),se)}function mx(e,t){let n=Cs.depthM/I,o=e.map(a=>{let s=t.x-a.x,c=t.y-a.y,l=Math.hypot(s,c)||1;return{x:a.x+s/l*n,y:a.y+c/l*n}}),r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=[[r(e)],[r(o)]];for(let a=0;a<e.length;a++){let s=(a+1)%e.length;i.push([r([e[a],e[s],o[s],o[a]])])}try{let[a,...s]=i,c=Sh.default.union(a,...s);return c.length?c.map(l=>l.map(u=>u.slice(0,-1).map(([m,h])=>({x:m,y:h})))):null}catch{return null}}function wh(e){return e.route?.stepFree===!0&&(e.kind==="line"||e.kind==="polyline")}function Ph(e){let t=Number.isFinite(e)&&e>0?e:4;return[Math.max(6,t*2.6),Math.max(4,t*1.7)]}function Ah(e,t,n){let o=[];if(e.length<2||!(t>0)||!(n>=0))return o;let r=!0,i=t;for(let a=0;a<e.length-1;a+=1){let s=e[a],c=e[a+1],l=Math.hypot(c.x-s.x,c.y-s.y);if(l<1e-9)continue;let u=(c.x-s.x)/l,m=(c.y-s.y)/l,h=0;for(;h<l-1e-9;){let f=Math.min(i,l-h);r&&o.push([{x:s.x+u*h,y:s.y+m*h},{x:s.x+u*(h+f),y:s.y+m*(h+f)}]),h+=f,i-=f,i<=1e-9&&(r=!r,i=r?t:n)}}return o}function vr(e,t,n){let o=Ie(t.stroke?.color),r=t.stroke?.width??0;if(!o||!Number.isFinite(r)||r<=0)return;let i=t.kind==="line"||t.kind==="polyline",a=i?yo(t.points??[],t.rotation):Pe(t);if(!a||a.length<2)return;let s=r*.5,c=wh(t)?Ah(a,...Ph(r)):Array.from({length:i?a.length-1:a.length},(l,u)=>[a[u],a[(u+1)%a.length]]);for(let[l,u]of c){let m=Math.hypot(u.x-l.x,u.y-l.y);if(m<1e-6)continue;let h=-(u.y-l.y)/m*s,f=(u.x-l.x)/m*s,d=[(l.x+h)*I,n,(l.y+f)*I],p=[(u.x+h)*I,n,(u.y+f)*I],b=[(u.x-h)*I,n,(u.y-f)*I],y=[(l.x-h)*I,n,(l.y-f)*I];e.tri(d,p,b,[0,1,0],o),e.tri(d,b,y,[0,1,0],o)}}function Rh(e){return e==="bar"||e==="concession"||e==="coat"||e==="restroom"}var ko=(e,t,n)=>({x:e.x+(t.x-e.x)*n,y:e.y+(t.y-e.y)*n});function Bi(e,t,n,o){let[r,i,a,s]=t?e:[e[3],e[2],e[1],e[0]];return[ko(r,s,n),ko(i,a,n),ko(i,a,o),ko(r,s,o)]}function Eh(e,t,n,o,r,i,a,s,c=!1){if(n.length!==4||r-o<.4)return!1;let l=A=>c?Math.min(A,r):A,u=It(n),m=Math.hypot(u[3].x-u[0].x,u[3].y-u[0].y)*I;if(m<.4)return!1;let h=ko(u[0],u[1],.5),f=ko(u[3],u[2],.5),d=Math.hypot(h.x-s.x,h.y-s.y)<=Math.hypot(f.x-s.x,f.y-s.y),p=we(a,[.92,.9,.86],.35),b=oe(i,.72),y=r-o;if(t==="restroom"){let A=Math.min(.18,y*.08);return _e(e,u,r-A,o,a,i),_e(e,u,r,r-A,p,p),!0}let g=o+Math.min(1.1,y),v=t==="coat"?1:Math.min(.5,.75/m),P=Bi(u,d,0,v);if(_e(e,P,g-.05,o,b,i),_e(e,P,g,g-.05,p,p),t==="coat"||m<1.2)return!0;if(t==="bar"){let A=Bi(u,d,Math.max(v+.2,1-.45/m),1),M=l(o+Math.max(Math.min(2.2,y*2),g-o+.6));return _e(e,A,M,o,a,b),!0}let w=Bi(u,d,Math.max(v+.25,.55),1),x=l(o+Math.max(2.6,g-o+1.4));if(x-.14<=g)return!0;_e(e,w,x-.14,o,a,i),_e(e,u,x,x-.14,p,b);let S=Math.min(.08,.1/Math.max(.1,Math.hypot(u[1].x-u[0].x,u[1].y-u[0].y)*I));for(let[A,M]of[[0,S],[1-S,1]])_e(e,Bi(gt(u,A,M),d,0,Math.min(.08,.1/m)),x-.14,g,b,b);return!0}var Vi=[.19,.4,.15],hx=.012,Lo=2.4,fx=1,dx=.75,px=.15;function _t(e){if(e.points&&e.points.length>=3)return e.points;let{center:t,width:n,height:o,rotation:r}=e;if(!n||!o)return null;let i=(r??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=n/2,l=o/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:t.x+u*a-m*s,y:t.y+u*s+m*a}))}function kh(e,t,n,o,r,i,a=!1){let s=_t(t);if(s){if(a){let c=Bn(o,r.boothTop),l=$t([...s]);ue(e,Zt(l,bx/I),[l.slice().reverse()],()=>n+.03,n,c,oe(c,.8),se);return}if(!(!t.points&&i&&yx(e,s,n,o,i))){if(!t.points&&i&&s.length===4){gx(e,s,n,o,i);return}ue(e,s,void 0,()=>n+Lo,n,Bn(o,r.boothTop),r.boothWall,se)}}}var Ts=1.1,Ih=[.9,.9,.88],bx=.1,Hi=[.87,.87,.85],_h=.08;function Lh(e,t){let n=c=>({x:(e[c].x+e[(c+1)%4].x)/2,y:(e[c].y+e[(c+1)%4].y)/2}),o=0,r=1/0;for(let c=0;c<4;c++){let l=n(c),u=Math.hypot(l.x-t.x,l.y-t.y);u<r&&(r=u,o=c)}let i=[0,1,2,3].map(c=>e[(o+c)%4]),a=(c,l,u)=>({x:c.x+(l.x-c.x)*u,y:c.y+(l.y-c.y)*u});return{q:i,part:(c,l,u,m)=>{let h=a(i[0],i[1],c),f=a(i[0],i[1],l),d=a(i[3],i[2],c),p=a(i[3],i[2],l);return[a(h,d,u),a(f,p,u),a(f,p,m),a(h,d,m)]},depthM:Math.hypot(i[3].x-i[0].x,i[3].y-i[0].y)*I,widthM:Math.hypot(i[1].x-i[0].x,i[1].y-i[0].y)*I}}function gx(e,t,n,o,r){let{q:i,part:a}=Lh(t,r),s=o??[.35,.42,.55],c=we(s,[.78,.78,.77],.62),l=we(s,[.95,.95,.94],.45);_e(e,i,n+vn,n,c,oe(c,.8)),_e(e,a(.05,.95,.72,.98),n+Ts-.05,n+vn,l,oe(l,.8)),_e(e,a(.03,.97,.7,1),n+Ts,n+Ts-.05,Ih,oe(Ih,.9))}function yx(e,t,n,o,r){if(t.length!==4)return!1;let{q:i,part:a,depthM:s,widthM:c}=Lh(t,r);if(s<1||c<1)return!1;let l=o??[.35,.42,.55],u=we(l,[.78,.78,.77],.62),m=n+Lo,h=_h/c,f=_h/s;_e(e,i,n+vn,n,u,oe(u,.8)),_e(e,a(0,1,1-f,1),m,n+vn,Hi,oe(Hi,.9));for(let[b,y]of[[0,h],[1-h,1]])_e(e,a(b,y,0,1-f),m,n+vn,Hi,oe(Hi,.9));_e(e,a(h,1-h,0,Math.min(.5,.06/s)),m,m-.3,l,oe(l,.85));let d=Math.min(.4,.6/c),p=Math.min(.12,.3/s);return _e(e,a(.5-d,.5+d,.72-p,.72+p),n+fx,n+vn,we(l,[.95,.95,.94],.7),oe(l,.75)),!0}function Ui(e){if(e.shape==="round"){let u=e.radius;return u?mi(e.center.x,e.center.y,u,u,24):null}let{width:t,height:n,rotation:o,center:r}=e;if(!t||!n)return null;let i=(o??0)*Math.PI/180,a=Math.cos(i),s=Math.sin(i),c=t/2,l=n/2;return[[-c,-l],[c,-l],[c,l],[-c,l]].map(([u,m])=>({x:r.x+u*a-m*s,y:r.y+u*s+m*a}))}function Oh(e,t,n,o,r,i=!0){let a=Ui(t);if(!a)return;let s=a.reduce((d,p)=>d+p.x,0)/a.length,c=a.reduce((d,p)=>d+p.y,0)/a.length,l=d=>a.map(p=>({x:s+(p.x-s)*d,y:c+(p.y-c)*d})),u=Kt(r)?1:vx,m=i&&o?Bn(o,r.tableTop):oe(xx,u),h=oe(Mx,u),f=n+dx;ue(e,a,void 0,()=>f,n+Sx,m,oe(m,.86),se),ue(e,l(.12),void 0,()=>f+.12,f,h,oe(h,.8),se)}var xx=[.93,.92,.89],Mx=[.78,.66,.42],vx=.62,Sx=.25,Sr={armM:1.1,widthM:.28,insideM:1.4,low:.043,high:.048};function wx(e,t,n){let o=e.reduce((y,g)=>y+g.x,0)/4,r=e.reduce((y,g)=>y+g.y,0)/4,i=e[3].x-e[0].x,a=e[3].y-e[0].y,s=Math.hypot(i,a)||1;i/=s,a/=s,i*(t.x-o)+a*(t.y-r)<0&&(i=-i,a=-a);let c=-a,l=i,u=Sr.armM/I,m=Sr.widthM/I,h=s/2+Sr.insideM/I,f=n?-1:1,d=o+i*(h+(n?0:u)),p=r+a*(h+(n?0:u)),b=(y,g)=>({x:d+i*y*f+c*g,y:p+a*y*f+l*g});return[b(0,0),b(-u,u),b(-u-m,u),b(-m,0),b(-u-m,-u),b(-u,-u)]}function Px(e,t,n,o,r){let i=[.94,.95,.96];ue(e,wx(t,o,r),void 0,()=>n+Sr.high,n+Sr.low,i,i,se)}function zi(e,t){let n=Ie(e);return n?{top:oe(Xt(n,.12),.95),wall:oe(Xt(n,.12),.85)}:{top:t.tierTop,wall:t.tierWall}}function Fh(e,t,n,o,r,i,a,s,c=[]){let l=Pe(t),u=fm(t);if(!t.role&&(!t.fill||t.fill==="none"||t.fill==="transparent")||!l){vr(e,t,n+o+hx);return}let h=s?s.kind==="stage":t.role==="stage",f=s?s.kind==="screen":t.role==="screen",d=s?{kind:h?"stage":"solid",heightM:s.topY-s.baseY}:Gt(t),p=s?.baseY??n,b=s?.topY??n+o,y=null;if(h&&a){let _=1/0,R=-1/0,C=1/0,O=-1/0;for(let B of l)B.x<_&&(_=B.x),B.x>R&&(R=B.x),B.y<C&&(C=B.y),B.y>O&&(O=B.y);y={cx:(_+R)/2*I,cz:(C+O)/2*I,y:b,halfX:Math.max((R-_)/2*I,.5),halfZ:Math.max((O-C)/2*I,.5)},a.push(y)}let g=Ie(t.fill),v=t.role==="wall"||t.role==="entrance"||t.role==="exit",P=v?zi(t.fill,r).top:h&&g?we(r.stageTop,oe(Xt(g,.18),.9),.9):!t.role&&g?g:Bn(g,h?r.stageTop:r.decorTop),x=v?zi(t.fill,r).wall:h?g?we(r.stageWall,oe(g,.58),.82):r.stageWall:f?Ku(f?g:null):Bn(Ie(t.fill),r.decorWall),S=h&&Kt(r)?Ln(!0):null,A=S?Th(P,S.stageTop):P,M=S?Th(x,S.stageWall):x;if(y&&(y.top=A),t.role==="wall"&&!s){Ni(e,l,p,b,c,A,M,i),vr(e,t,b+.012);return}if(f&&l.length===4&&b-p>.2){let _=_s(l,p,b);if(!_)return;let{quad:R,side:C,trim:O,inner:B,panel:F}=_,N=[.12,.15,.18];for(let[V,H]of[[0,C],[1-C,1]])_e(e,gt(R,V,H),b,p,N,N);_e(e,B,p+O,p,N,N),_e(e,B,b,b-O,N,N),_e(e,F,b-O,p+O,M,M),vr(e,t,b+.012);return}let E=g?oe(Xt(g,.15),.82):M,T=g?oe(Xt(g,.1),1.02):A;if(Rh(t.role)&&!s&&Eh(e,t.role,l,p,b,E,T,i,t.heightM!==void 0))return;if((t.role==="sound"||s?.kind==="sound_desk")&&l.length===4&&b-p>.3){let _=It(l),R=Math.hypot(_[1].x-_[0].x,_[1].y-_[0].y)*I,C=Math.min(.12,.09/Math.max(R,.001)),O=[.18,.21,.24],B=b-Math.min(.12,(b-p)*.15);for(let[F,N]of[[0,C],[1-C,1]])_e(e,gt(_,F,N),B,p,O,O);_e(e,_,b,B,A,O);return}if(t.role==="rail"&&l.length===4&&b>p){let _=It(l),R=Math.hypot(_[1].x-_[0].x,_[1].y-_[0].y)*I,C=Math.max(1,Math.min(128,Math.ceil(R/1.4))),O=Math.min(.08,.055/Math.max(.055,R)),B=[.58,.64,.66];for(let F=0;F<=C;F++){let N=F/C,V=Math.min(1-O,Math.max(0,N-O/2));_e(e,gt(_,V,V+O),b,p,B,oe(B,.8))}for(let F of[.52,1]){let N=p+(b-p)*F;_e(e,_,N,Math.max(p,N-.055),B,oe(B,.8))}return}if(t.role==="goal"&&l.length===4){Nm(e,It(l),i,p,b),e.setMaterial(0);return}if(d.kind==="portal"&&l.length===4){let _=To(l,p,b);if(!_)return;let{quad:R,side:C,face:O,openingTop:B}=_;for(let[F,N,V]of[[0,O,1],[O,1-O,.67],[1-O,1,1]]){let H=mr(R,F,N),L=oe(A,V),G=oe(M,V);for(let[j,D]of[[0,C],[1-C,1]])_e(e,gt(H,j,D),B,p,L,G);_e(e,H,b,B,L,G)}(t.role==="entrance"||t.role==="exit")&&Px(e,R,p,i,t.role==="exit");return}if(d.kind==="suite"&&l.length===4){let _=l.map((O,B)=>{let F=l[(B+1)%4],N=(O.x+F.x)/2,V=(O.y+F.y)/2;return Math.hypot(N-i.x,V-i.y)}),R=_.indexOf(Math.min(..._)),C=[0,1,2,3].map(O=>l[(R+O)%4]);_e(e,gt(C,0,.08),b,p,A,M),_e(e,gt(C,.92,1),b,p,A,M),_e(e,mr(C,.88,1),b,p,A,M),_e(e,C,b,Math.max(p,b-.18),A,M);return}if(h&&!t.stageKind?.startsWith("pitch-")&&b-p>.12){let _=b-Math.min(.06,(b-p)*.15);_e(e,l,_,p,A,M,u),_e(e,l,b,_,A,we(A,M,.2),u)}else _e(e,l,b,p,A,M,u);if((t.stageKind==="pitch-football"||t.stageKind==="pitch-rugby")&&l.length===4){e.setMaterial(4);let _=It(l),R=we(g??Vi,Vi,g?.45:0);for(let C=0;C<12;C++){let O=gt(_,C/12,(C+1)/12),B=oe(R,C%2?1.09:.91),F=O.map(N=>[N.x*I,b+.006,N.y*I]);e.tri(F[0],F[1],F[2],[0,1,0],B),e.tri(F[0],F[2],F[3],[0,1,0],B)}}t.stageKind&&t.stageKind!=="pitch-football"&&Xm(e,l,t.stageKind,b,g,t),h&&Et(t.stageKind)&&jm(e,t,b),e.setMaterial(f?1:0),vr(e,t,b+.012)}function Wi(e){let{x:t,y:n,width:o,height:r}=e;if(!o||!r)return null;let i=t+o/2,a=n+r/2,s=(e.rotation??0)*Math.PI/180,c=Math.cos(s),l=Math.sin(s),u=o/2,m=r/2;return[[-u,-m],[u,-m],[u,m],[-u,m]].map(([h,f])=>({x:i+h*c-f*l,y:a+h*l+f*c}))}function Ax(e){if(!e||!e.startsWith("data:image/svg+xml"))return null;let t=e.slice(e.indexOf(",")+1);if(/;base64/i.test(e.slice(0,e.indexOf(","))))try{t=atob(t)}catch{return null}else try{t=decodeURIComponent(t)}catch{}let n=t.match(/<(?:rect|path)\b[^>]*\bfill="([^"]+)"/i);if(!n)return null;let o=n[1].trim();if(o==="none"||o==="transparent")return null;let r=o.match(/^url\(#([^)]+)\)$/);if(!r)return Ie(o);let i=t.match(new RegExp(`<(?:linear|radial)Gradient\\b[^>]*\\bid="${r[1]}"[^>]*>([\\s\\S]*?)</(?:linear|radial)Gradient>`,"i"));if(!i)return null;let a=[];for(let s of i[1].matchAll(/stop-color="([^"]+)"/gi)){let c=Ie(s[1].trim());c&&a.push(c)}return a.length?a.reduce((s,c,l)=>we(s,c,1/(l+1)),a[0]):null}function Dh(e,t,n,o){if(t.layer==="foreground")return;let r=Wi(t);if(!r)return;let i=n+px,a=Bn(Ax(t.href),o.decorTop),s=Math.max(0,Math.min(1,t.opacity??1));s<1&&(a=we(o.ground,a,s)),ue(e,r,void 0,()=>i,n,a,we(a,o.decorWall,.5),se)}function Nh(e,t,n,o,r){if(!t.points||t.points.length<3)return;let i=Xu(o,r.gaTop);e.setMaterial(Rx),ue(e,t.points,t.holes,()=>n+wr,n,i,r.gaWall,se),e.setMaterial(0),_x(e,t.points,n+wr)}var Rx=13,wr=.15,Gi=[.72,.74,.76],ks=1.1,Ch=.12,Ls=.05,Ex=.06,Ix=2.4;function _x(e,t,n){let o=$t([...t]),r=Lt(o,Ch/I),i=Lt(o,(Ch+Ls)/I);if(r.length<3||i.length<3)return;for(let s of[n+ks,n+ks*.5])ue(e,r,[i.slice().reverse()],()=>s,s-Ls,Gi,oe(Gi,.85),se);let a=Ex/2/I;for(let s=0;s<r.length;s++){let c=r[s],l=r[(s+1)%r.length],u=Math.hypot(l.x-c.x,l.y-c.y)*I,m=Math.max(1,Math.round(u/Ix));for(let h=0;h<m;h++){let f=h/m,d=c.x+(l.x-c.x)*f,p=c.y+(l.y-c.y)*f,b=[{x:d-a,y:p-a},{x:d+a,y:p-a},{x:d+a,y:p+a},{x:d-a,y:p+a}];ue(e,b,void 0,()=>n+ks-Ls,n,Gi,oe(Gi,.8),se)}}}function Th(e,t){return Kr(e)<t?kn(e,t):e}var Xe={stepM:.79,spacingM:.45,tries:8,edgeM:.35,heightM:[1.5,1.78],capDesktop:6e3,capSmall:2e3,smallCeiling:3e4,maxCellsPerArea:6e4,maxCellsPerVenue:24e4,behind:{levelM:.6,clearM:6,fullM:14,from:.3,sideM:4},clothes:8,skins:4,hairs:5};function zh(e,t,n=!0){if(!n)return 0;let o=t<=Xe.smallCeiling?Xe.capSmall:Xe.capDesktop;return Math.max(0,Math.min(o,Math.floor(t-e)))}function Xi(){let e=globalThis;return(e.navigator?.hardwareConcurrency??8)<=4||(e.navigator?.deviceMemory??8)<=4||(e.matchMedia?.("(pointer: coarse)").matches??!1)?Xe.smallCeiling:Xe.smallCeiling*2}var Bh=[[1,0],[.92388,.382683],[.707107,.707107],[.382683,.92388],[0,1],[-.382683,.92388],[-.707107,.707107],[-.92388,.382683],[-1,0],[-.92388,-.382683],[-.707107,-.707107],[-.382683,-.92388],[0,-1],[.382683,-.92388],[.707107,-.707107],[.92388,-.382683]],Cx=[[.939693,-.34202],[.954588,-.29793],[.967415,-.253195],[.978148,-.207912],[.986762,-.162178],[.993238,-.116093],[.997564,-.069756],[.999729,-.023269],[.999729,.023269],[.997564,.069756],[.993238,.116093],[.986762,.162178],[.978148,.207912],[.967415,.253195],[.954588,.29793],[.939693,.34202]];function hn(e,t,n,o){let r=Math.imul(e|0,2654435761)^Math.imul(t|0,2246822519)^Math.imul(n|0,3266489917)^Math.imul(o|0,668265263);return r^=r>>>15,r=Math.imul(r,739982445),r^=r>>>12,r=Math.imul(r,695872825),r^=r>>>15,r>>>0}var ji=e=>e/4294967296;function Hh(e,t,n){let o=!1;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i];a.y>n!=s.y>n&&t<(s.x-a.x)*(n-a.y)/(s.y-a.y)+a.x&&(o=!o)}return o}function Gh(e,t,n){let o=1/0;for(let r=0,i=e.length-1;r<e.length;i=r++){let a=e[r],s=e[i],c=s.x-a.x,l=s.y-a.y,u=c*c+l*l,m=u>0?Math.max(0,Math.min(1,((t-a.x)*c+(n-a.y)*l)/u)):0,h=t-(a.x+c*m),f=n-(a.y+l*m);o=Math.min(o,h*h+f*f)}return o}var Uh=(e,t)=>(e+32768)*65536+(t+32768);function Tx(e,t){let n=e.focal;if(!n)return null;let o=Math.sqrt(Xe.behind.fullM*Xe.behind.fullM+Xe.behind.sideM*Xe.behind.sideM)/I,r=1/0,i=1/0,a=-1/0,s=-1/0;for(let m of e.points)r=Math.min(r,m.x),a=Math.max(a,m.x),i=Math.min(i,m.y),s=Math.max(s,m.y);let c=4/I,l=new Map,u=[];for(let m of t){if(m.floorIndex!==e.floorIndex||m.x<r-o||m.x>a+o||m.y<i-o||m.y>s+o||Math.abs(m.deckY-e.floorY)>Xe.behind.levelM)continue;let h=n.x-m.x,f=n.y-m.y,d=Math.sqrt(h*h+f*f);if(!(d>0))continue;let p=Uh(Math.floor(m.x/c),Math.floor(m.y/c)),b=l.get(p);b||l.set(p,b=[]),b.push(u.length),u.push(m.x,m.y,h/d,f/d)}return u.length?{cell:c,cells:l,data:u}:null}function kx(e,t,n){let{clearM:o,fullM:r,from:i,sideM:a}=Xe.behind,s=Math.floor(t/e.cell),c=Math.floor(n/e.cell),l=1;for(let u=c-4;u<=c+4;u++)for(let m=s-4;m<=s+4;m++){let h=e.cells.get(Uh(m,u));if(h)for(let f of h){let d=(t-e.data[f])*I,p=(n-e.data[f+1])*I,b=e.data[f+2],y=e.data[f+3],g=d*b+p*y;if(!(g<=0||g>=r)&&!(Math.abs(d*y-p*b)>a)){if(g<o)return 0;l=Math.min(l,i+(1-i)*(g-o)/(r-o))}}}return l}function Vh(e,t,n,o,r){return(Math.ceil(t/r)-Math.floor(e/r)+1)*(Math.ceil(o/r)-Math.floor(n/r)+1)}function Lx(e,t,n,o,r){let i=Xe.stepM/I,a=Vh(e,t,n,o,i);if(a<=r)return i;let s=i*Math.sqrt(a/r);for(let c=0;c<400&&Vh(e,t,n,o,s)>r;c++)s*=1.05;return s}function Ox(e,t,n,o){if(e.points.length<3||!(e.capacity>0))return[];let r=Xe.edgeM/I,i=r*r,a=1/0,s=1/0,c=-1/0,l=-1/0;for(let w of e.points)a=Math.min(a,w.x),c=Math.max(c,w.x),s=Math.min(s,w.y),l=Math.max(l,w.y);if(!Number.isFinite(a+c+s+l))return[];let u=Lx(a,c,s,l,o),m=Tx(e,n),h=[],f=Xe.spacingM/I,d=f*f,p=Math.floor(s/u),b=Math.ceil(l/u),y=Math.floor(a/u),g=Math.ceil(c/u),v=g-y+1,P=new Int32Array(v*(b-p+1)).fill(-1);for(let w=p;w<=b;w++)for(let x=y;x<=g;x++)for(let S=0;S<Xe.tries;S++){let A=(x+ji(hn(x,w,t,10+S*2)))*u,M=(w+ji(hn(x,w,t,11+S*2)))*u;if(!Hh(e.points,A,M)||Gh(e.points,A,M)<i||e.holes?.some(k=>k.length>=3&&(Hh(k,A,M)||Gh(k,A,M)<i)))continue;let E=!0;for(let k=-1;k<=0&&E;k++)for(let _=-1;_<=1&&E&&!(k===0&&_>=0);_++){let R=x+_-y,C=w+k-p;if(R<0||R>=v||C<0)continue;let O=P[C*v+R];if(O<0)continue;let B=h[O].x-A,F=h[O].y-M;B*B+F*F<d&&(E=!1)}if(!E)continue;let T=m?kx(m,A,M):1;if(T<=0||T<1&&ji(hn(x,w,t,3))>=T)break;P[(w-p)*v+(x-y)]=h.length,h.push({x:A,y:M,i:x,j:w,order:hn(x,w,t,4),thinned:T<1});break}return h}function Fx(e,t,n=Xe.capDesktop){if(!(n>0)||!e.length)return null;let o=Math.max(64,Math.min(Xe.maxCellsPerArea,Math.floor(Xe.maxCellsPerVenue/e.length))),r=e.map((h,f)=>{let d=Ox(h,f,t,o);return d.sort((p,b)=>p.order-b.order||p.j-b.j||p.i-b.i),d.slice(0,Math.min(d.length,Math.floor(h.capacity)))}),i=r.reduce((h,f)=>h+f.length,0);if(!i)return null;let a=i>n?r.map(h=>h.slice(0,Math.floor(h.length*n/i))):r,s=a.reduce((h,f)=>h+f.length,0);if(!s)return null;let c={count:s,iPosition:new Float32Array(s*3),iFacing:new Float32Array(s*2),iHeight:new Float32Array(s),iTone:new Float32Array(s),iFloor:new Float32Array(s)},[l,u]=Xe.heightM,m=0;return a.forEach((h,f)=>{let d=e[f];for(let p of h){c.iPosition[m*3]=p.x*I,c.iPosition[m*3+1]=d.floorY,c.iPosition[m*3+2]=p.y*I;let b=ji(hn(p.i,p.j,f,5));c.iHeight[m]=l+b*(u-l)*(p.thinned?.5:1),c.iTone[m]=hn(p.i,p.j,f,9)%Xe.hairs*(Xe.clothes*Xe.skins)+hn(p.i,p.j,f,6)%Xe.clothes*Xe.skins+hn(p.i,p.j,f,7)%Xe.skins,c.iFloor[m]=d.floorIndex;let y=hn(p.i,p.j,f,8)&15,g=Bh[y][0],v=Bh[y][1];if(d.focal){let P=d.focal.x-p.x,w=d.focal.y-p.y,x=Math.sqrt(P*P+w*w);if(x>0){let[S,A]=Cx[y];g=(P*S-w*A)/x,v=(P*A+w*S)/x}}c.iFacing[m*2]=g,c.iFacing[m*2+1]=v,m++}}),c}function Wh(e,t,n){try{return Fx(e,t,n)}catch{return null}}var Os=.6,jh=3,Dx=.25,Nx=6;function Bx(e,t,n,o){let r=1/0;for(let i=0,a=o.length-1;i<o.length;a=i++){let s=o[a],c=o[i],l=c.x-s.x,u=c.y-s.y,m=t*u-n*l;if(Math.abs(m)<1e-12)continue;let h=((s.x-e.x)*u-(s.y-e.y)*l)/m,f=((s.x-e.x)*n-(s.y-e.y)*t)/m;h>1e-9&&f>=-1e-9&&f<=1+1e-9&&(r=Math.min(r,h))}return r}function Hx(e,t){if(Ye(t,e.x,e.y))return 0;let n=1/0;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[r],a=t[o],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c||1,u=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l));n=Math.min(n,Math.hypot(e.x-(i.x+u*s),e.y-(i.y+u*c)))}return n}function Xh(e,t){return new Map([...Fs(e,t)].map(([n,o])=>[n,o.toward]))}function Fs(e,t){let n=e.map(a=>({booth:a,ring:_t(a)})).filter(a=>!!a.ring&&a.ring.length===4&&!a.booth.points),o=n.map(({ring:a})=>({minX:Math.min(...a.map(s=>s.x)),maxX:Math.max(...a.map(s=>s.x)),minY:Math.min(...a.map(s=>s.y)),maxY:Math.max(...a.map(s=>s.y))})),r=(jh+Os)/I,i=new Map;return n.forEach(({booth:a,ring:s},c)=>{let l={x:s.reduce((d,p)=>d+p.x,0)/4,y:s.reduce((d,p)=>d+p.y,0)/4},u=[0,1,2,3].map(d=>{let p=s[d],b=s[(d+1)%4],y={x:(p.x+b.x)/2,y:(p.y+b.y)/2},g=y.x-l.x,v=y.y-l.y,P=Math.hypot(g,v)||1,w={x:y.x+g/P*Os/I,y:y.y+v/P*Os/I},x=jh/I;return o.forEach((S,A)=>{A===c||w.x<S.minX-r||w.x>S.maxX+r||w.y<S.minY-r||w.y>S.maxY+r||(x=Math.min(x,Hx(w,n[A].ring)))}),{open:x*I,toward:{x:y.x+g/P*10/I,y:y.y+v/P*10/I},focal:Math.hypot(y.x-t.x,y.y-t.y),normal:{x:g/P,y:v/P},halfDepthM:P*I,halfWidthM:Math.hypot(b.x-p.x,b.y-p.y)*I/2,mid:y}}),m=Math.max(...u.map(d=>d.open)),h=u.filter(d=>d.open>=m-Dx).sort((d,p)=>d.focal-p.focal)[0],f=Nx/I;n.forEach((d,p)=>{p!==c&&(f=Math.min(f,Bx(h.mid,h.normal.x,h.normal.y,d.ring)))}),i.set(a.id,{toward:h.toward,normal:h.normal,halfDepthM:h.halfDepthM,halfWidthM:h.halfWidthM,aisleM:f*I})}),i}var Kh=jt(require("polygon-clipping"),1);var Gx=.45,Vx=1500,zx=200;function Yh(e,t){if(e.role!=="stage"||Et(e.stageKind))return e;let n=Pe(e);if(!n||n.length<3||Math.abs(Rt(n))*I*I>Vx)return e;let o=t.filter(a=>Ye(n,a.x,a.y));if(!o.length||o.length>zx)return e;let r=Gx/I,i=o.map(a=>[[[a.x-r,a.y-r],[a.x+r,a.y-r],[a.x+r,a.y+r],[a.x-r,a.y+r],[a.x-r,a.y-r]]]);try{let a=Kh.default.difference([[...n.map(l=>[l.x,l.y]),[n[0].x,n[0].y]]],...i),s=null,c=0;for(let l of a){let u=l[0].slice(0,-1).map(([h,f])=>({x:h,y:f})),m=Math.abs(Rt(u));m>c&&(c=m,s=u)}return!s||s.length<3?e:{...e,kind:"polygon",points:s,rotation:0}}catch{return e}}var Ux=Math.PI/180,Ne=96,Wx=6,jx=60,Xx=150,$h=.2,Kx=.35;function Yx(e,t){let n=Math.atan2(t.x-e.x,t.y-e.y)/Ux;return n<0?n+360:n}function Ki(e){if(!e.length)return NaN;let t=[...e].sort((n,o)=>n-o);return t[Math.floor(t.length/2)]}function Yi(e,t,n=2){let o=e.length,r=new Float64Array(o);for(let i=0;i<o;i++){let a=0,s=0;for(let c=-n;c<=n;c++){let l=i+c;if(t)l=(l%o+o)%o;else if(l<0||l>=o)continue;a+=e[l],s++}r[i]=a/s}return r}function Zh(e,t){let n=e.filter(h=>h.rows.length>=1);if(n.length<1)return null;let o=[],r=0,i=0,a=0;for(let h of n)for(let f of h.rows){for(let d of f.pts)r+=d.x,i+=d.y,a++;if(f.pts.length>=4){let d=os(f.pts);d&&Number.isFinite(d.cx)&&Number.isFinite(d.cy)&&o.push({x:d.cx,y:d.cy})}}if(!a)return null;let s={x:r/a,y:i/a},c=s;if(o.length>=8){let h=Ki(o.map(y=>y.x)),f=Ki(o.map(y=>y.y)),d=0;for(let y of n)for(let g of y.rows)for(let v of g.pts){let P=Math.hypot(v.x-s.x,v.y-s.y);P>d&&(d=P)}let p=0,b=d*.2;for(let y of n)for(let g of y.rows)for(let v of g.pts)Math.hypot(v.x-h,v.y-f)<b&&p++;Math.hypot(h-s.x,f-s.y)<=d&&p/a<.01&&(c={x:h,y:f})}let l=[];for(let h of n){let f={sectionId:h.sectionId,rMin:1/0,rMax:-1/0,samples:[]};for(let d of h.rows)for(let p of d.pts){let b=Math.hypot(p.x-c.x,p.y-c.y),y=Math.min(Ne-1,Math.floor(Yx(c,p)/(360/Ne)));f.samples.push({r:b,bin:y,levelM:d.levelM}),b<f.rMin&&(f.rMin=b),b>f.rMax&&(f.rMax=b)}f.samples.length&&l.push(f)}if(!l.length)return null;l.sort((h,f)=>h.rMin+h.rMax-(f.rMin+f.rMax));let u=[];for(let h of l){let f=!1;for(let d of u){let p=Math.min(h.rMax,d.rMax)-Math.max(h.rMin,d.rMin),b=Math.min(h.rMax-h.rMin,d.rMax-d.rMin);if(b>1e-9&&p>=Kx*b){d.members.push(h),d.rMin=Math.min(d.rMin,h.rMin),d.rMax=Math.max(d.rMax,h.rMax),f=!0;break}}f||u.push({members:[h],rMin:h.rMin,rMax:h.rMax})}let m=[];for(let h of u){let f=new Array(Ne).fill(null);for(let _ of h.members)for(let R of _.samples){let C=f[R.bin];C||(C={samples:[]},f[R.bin]=C),C.samples.push({r:R.r,levelM:R.levelM})}let d=f.map(_=>!!_);if(!d.filter(Boolean).length)continue;let b=[],y=[];for(let _ of f){if(!_)continue;let R=1/0,C=-1/0;for(let O of _.samples)O.r<R&&(R=O.r),O.r>C&&(C=O.r);b.push(R),y.push(C)}let g=Ki(b),v=Ki(y);if(!(g>=$h*v)||!(v>0))continue;let P=[...b].sort((_,R)=>_-R);if(!(P[Math.floor(P.length*.1)]>=$h*v))continue;let x=f.map(_=>{if(!_)return null;let R=[..._.samples].sort((L,G)=>L.r-G.r),C=R[0].r,O=R[R.length-1].r,B=R[0].levelM,F=-1/0;for(let L of R)L.levelM>F&&(F=L.levelM);let N=[];for(let L of R){let G={r:L.r,l:L.levelM};for(;N.length&&Math.abs(N[N.length-1].r-G.r)<1e-9;){if(N[N.length-1].l<=G.l){G.skip=!0;break}N.pop()}if(!G.skip){for(;N.length>=2;){let j=N[N.length-2],D=N[N.length-1];if((D.r-j.r)*(G.l-j.l)-(D.l-j.l)*(G.r-j.r)<=0)N.pop();else break}N.push(G)}}let V=N.map(L=>L.r),H=N.map(L=>L.l);return{inner:C,outer:O,front:B,top:F,profile:{rs:V,ls:H}}}),S=d.slice();for(let _=0;_<Ne;_++){if(S[_])continue;let R=-1,C=-1,O=0;for(let U=1;U<=Ne;U++){let $=(_-U+Ne*2)%Ne;if(S[$]){R=$;break}}for(let U=1;U<=Ne;U++){let $=(_+U)%Ne;if(S[$]){C=$,O=U;break}}if(R<0||C<0)continue;let B=0;for(let U=1;U<=Ne;U++){let $=(_-U+Ne*2)%Ne;if(d[$]){B=U;break}}if(B-1+O>Wx)continue;let N=x[R],V=x[C],H=B/(B+O),L=N.inner+(V.inner-N.inner)*H,G=N.outer+(V.outer-N.outer)*H,j=N.front+(V.front-N.front)*H,D=N.top+(V.top-N.top)*H;x[_]={inner:L,outer:G,front:j,top:D,profile:{rs:[L,G],ls:[j,D]}}}for(let _=0;_<Ne;_++)x[_]&&(S[_]=!0);let A=360/Ne,M=[],E=S.filter(Boolean).length,T=[];if(E===Ne)T.push({start:0,len:Ne});else{let _=0;for(;S[_];)_=(_+1)%Ne;let R=-1;for(let C=0;C<=Ne;C++){let O=(_+C)%Ne,B=C<Ne&&S[O];if(B&&R<0)R=O;else if(!B&&R>=0){let F=(O-R+Ne)%Ne||Ne;T.push({start:R,len:F}),R=-1}}}for(let _ of T){if(_.len*A<jx&&_.len<Ne)continue;let R=_.len===Ne,C=new Float64Array(_.len),O=new Float64Array(_.len),B=new Float64Array(_.len),F=new Float64Array(_.len),N=[];for(let U=0;U<_.len;U++){let $=x[(_.start+U)%Ne];C[U]=$.inner,O[U]=$.outer,B[U]=$.front,F[U]=$.top,N.push($.profile??{rs:[$.inner,$.outer],ls:[$.front,$.top]})}let V=Yi(C,R),H=Yi(O,R),L=Yi(B,R),G=Yi(F,R);for(let U=0;U<_.len;U++)V[U]>C[U]&&(V[U]=C[U]),H[U]<O[U]&&(H[U]=O[U]),V[U]>H[U]-1e-6&&(V[U]=Math.max(0,H[U]-1e-6)),G[U]<L[U]&&(G[U]=L[U]);let j={startBin:_.start,binCount:_.len,closed:R,innerR:V,outerR:H,frontLevelM:L,topLevelM:G,profiles:N},D=(U,$,Z)=>{let te=N[U],X=te.rs,me=te.ls;if($<=X[0]){me[0]>Z&&(me[0]=Z);return}if($>=X[X.length-1]){me[me.length-1]>Z&&(me[me.length-1]=Z);return}for(let re=0;re+1<X.length;re++)if($<=X[re+1]){me[re]>Z&&(me[re]=Z),me[re+1]>Z&&(me[re+1]=Z);return}};for(let U=0;U<_.len;U++){let $=f[(_.start+U)%Ne];if($)for(let Z of $.samples){D(U,Z.r,Z.levelM);let te=R?(U-1+_.len)%_.len:U-1,X=R?(U+1)%_.len:U+1;te>=0&&D(te,Z.r,Z.levelM),X<_.len&&D(X,Z.r,Z.levelM)}}M.push(j)}M.reduce((_,R)=>_+R.binCount*A,0)<Xx||m.push({arcs:M,sectionIds:h.members.map(_=>_.sectionId),innerRMedian:g,outerRMedian:v})}if(!m.length)return null;if(m.sort((h,f)=>h.innerRMedian-f.innerRMedian),t){let h=m[m.length-1].outerRMedian;if(Math.hypot(t.x-c.x,t.y-c.y)>.9*h)return null}return{centre:c,binCount:Ne,binStepDeg:360/Ne,rings:m}}function qh(e,t,n,o){let r=e.binStepDeg,i=n/r-.5-t.startBin;i=(i%e.binCount+e.binCount)%e.binCount,i>t.binCount-1&&(t.closed?i=i-t.binCount<t.binCount-i?0:t.binCount-1:i=i-(t.binCount-1)<e.binCount-i?t.binCount-1:0);let a=Math.floor(i),s=t.closed?(a+1)%t.binCount:Math.min(t.binCount-1,a+1),c=i-a,l=u=>{let m=t.profiles[u],h=m.rs,f=m.ls;if(o<=h[0])return f[0];if(o>=h[h.length-1])return f[f.length-1];for(let d=0;d+1<h.length;d++)if(o<=h[d+1]){let p=h[d+1]-h[d],b=p>1e-9?(o-h[d])/p:0;return f[d]+(f[d+1]-f[d])*b}return f[f.length-1]};return l(a)*(1-c)+l(s)*c}function Ds(e,t,n,o,r,i,a,s,c,l=[],u=r){if(t.length!==n.length||t.length<2||i-r<1.5)return;let m=(p,b,y)=>{mn(e,p,b,y,l,a,s,{portalBase:u,ao:c})||ue(e,p,void 0,()=>y,b,a,s,c)},h=(p,b,y)=>({x:p.x+(b.x-p.x)*y,y:p.y+(b.y-p.y)*y}),f=o?t.length:t.length-1,d=0;for(let p=0;p<f;p++){let b=(p+1)%t.length,y=Math.hypot(n[b].x-n[p].x,n[b].y-n[p].y)*Me;if(y<1e-5)continue;let g=(x,S)=>[h(t[p],t[b],x),h(t[p],t[b],S),h(n[p],n[b],S),h(n[p],n[b],x)];m(g(0,1),r,r+.95),m(g(0,1),i-.22,i);let v=Math.ceil((d-.32)/6)*6,P=!1,w=!1;for(let x=v;x<d+y;x+=6){let S=Math.max(0,(x-d)/y),A=Math.min(1,(x+.32-d)/y);A<=S||(m(g(S,A),r+.95,i-.22),P||=S<1e-6,w||=A>1-1e-6)}if(!o&&(p===0&&!P||p===f-1&&!w)){let x=Math.min(1,.32/y);m(g(p===0?0:1-x,p===0?x:1),r+.95,i-.22)}d+=y}}var Sn=jt(require("polygon-clipping"),1),Ar=.65;function Ns(e,t){let n=1/0;for(let o of t)for(let r=0;r<o.length;r++){let i=o[r],a=o[(r+1)%o.length],s=a.x-i.x,c=a.y-i.y,l=Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/(s*s+c*c||1)));n=Math.min(n,Math.hypot(e.x-i.x-l*s,e.y-i.y-l*c))}return n}var Bs=.01;function Qh(e,t,n,o,r,i,a,s=[],c=!0,l={bays:[],walls:[]}){if(o-r<=1e-5)return;let u=o-r>=3,m=u?o-Ar:r;e.setMaterial(5);let h=u?[]:s.filter(x=>{if(x.role!=="entrance"&&x.role!=="exit")return!1;let S=Pe(x);if(!S)return!1;let A=To(S,r,r+Gt(x).heightM);return A!==null&&A.openingTop<=o-.12});if((!h.length||!mn(e,t,m,o,h,i,a,{holes:n,portalBase:r}))&&ue(e,t,n,()=>o,m,i,a,se,void 0,()=>[0,1,0]),!u){e.setMaterial(0);return}let f=c&&l.bays.length?$x(t,n,Lt(t,Pr/I),l):null,d=6/I,p=.22/I,b=s.flatMap(x=>{if(x.role!=="entrance"&&x.role!=="exit")return[];let S=Pe(x);return S?.length?[{minX:Math.min(...S.map(A=>A.x)),maxX:Math.max(...S.map(A=>A.x)),minY:Math.min(...S.map(A=>A.y)),maxY:Math.max(...S.map(A=>A.y))}]:[]}),y=Math.min(...t.map(x=>x.x)),g=Math.max(...t.map(x=>x.x)),v=Math.min(...t.map(x=>x.y)),P=Math.max(...t.map(x=>x.y));for(let x=y+d/2;x<g;x+=d)for(let S=v+d/2;S<P;S+=d){if(b.some(M=>x+p>=M.minX&&x-p<=M.maxX&&S+p>=M.minY&&S-p<=M.maxY))continue;let A=[{x:x-p,y:S-p},{x:x+p,y:S-p},{x:x+p,y:S+p},{x:x-p,y:S+p}];!mt({x,y:S},t,n)||Ns({x,y:S},[t,...n??[]])<p*Math.SQRT2+(c?Pr/I:0)||f&&Ns({x,y:S},f.flat())<p*Math.SQRT2+Pr/I||ue(e,A,void 0,()=>m,r,i,a,se)}if(f){for(let[x,...S]of f)ue(e,x,S,()=>m,r-Bs,i,a,se);e.setMaterial(0);return}let w=Lt(t,Pr/I);if(c&&w.length>=3){let x=s.filter(M=>{if(M.role!=="entrance"&&M.role!=="exit")return!1;let E=Pe(M);return!!E&&E.some(T=>!mt(T,t,void 0)||Ns(T,[t])<=Pr/I)}),S=[w.slice().reverse()],A=r-Bs;(!x.length||!mn(e,t,A,m,x,i,a,{holes:S,portalBase:r+Bs}))&&ue(e,t,S,()=>m,A,i,a,se)}e.setMaterial(0)}var Hs=.25,Pr=Hs;function $x(e,t,n,o){if(n.length<3)return null;let r=a=>{let s=a.map(c=>[c.x,c.y]);return s.push(s[0]),s},i=a=>{let[s,...c]=a.map(l=>[r(l)]);return Sn.default.union(s,...c)};try{let a=[r(e),...(t??[]).map(r)],s=Sn.default.difference(a,[r(n)]),c=Sn.default.intersection(a,i(o.bays));if(!c.length)return null;let l=Sn.default.difference(Sn.default.intersection(a,i(o.walls)),c);return Sn.default.union(Sn.default.difference(s,c),l).map(m=>m.map(h=>h.slice(0,-1).map(([f,d])=>({x:f,y:d}))))}catch{return null}}var Zx=.02,qx=.25,Qx=1.2,Jx=.6,eM=.45,tM=2.3,nM=Math.PI/180,Jh=.005;function Jt(e,t,n){let o=n*nM;return{x:e.x+t*Math.sin(o),y:e.y+t*Math.cos(o)}}function oM(e,t){let n=t.rings[t.rings.length-1];if(!n)return!1;let o=n.outerRMedian*.85;for(let r of e){if(r.role!=="wall")continue;let i=r.points&&r.points.length>=2?r.points:r.x!==void 0&&r.y!==void 0&&r.width!==void 0&&r.height!==void 0?[{x:r.x,y:r.y},{x:r.x+r.width,y:r.y},{x:r.x+r.width,y:r.y+r.height},{x:r.x,y:r.y+r.height}]:[];if(i.length<2)continue;let a=0;for(let s of i)Math.hypot(s.x-t.centre.x,s.y-t.centre.y)>=o&&a++;if(a>=i.length/2)return!0}return!1}var rM=24,iM=.01;function aM(e,t,n,o,r,i,a,s,c){let l=n.binCount,u=rM,m=Me,h=i+.02,f=i-iM,d=[];for(let R=0;R<l;R++){let C=(n.startBin+R+.5)*t.binStepDeg,O=new Float64Array(u+1);for(let B=0;B<=u;B++){let F=o[R]+(r[R]-o[R])*B/u;O[B]=Math.max(h,qh(t,n,C,F)-qx)}d.push(O)}if(c){let R=0;for(let C=0;C+1<l;C++)for(let O=0;O<u;O++){let B=Jt(t.centre,o[C]+(r[C]-o[C])*O/u,(n.startBin+C+.5)*t.binStepDeg),F=Jt(t.centre,o[C+1]+(r[C+1]-o[C+1])*(O+1)/u,(n.startBin+C+1.5)*t.binStepDeg);R=Math.max(R,Math.hypot(F.x-B.x,F.y-B.y))}for(let C=0;C<l;C++){let O=(n.startBin+C+.5)*t.binStepDeg;for(let B=0;B<=u;B++){let F=Jt(t.centre,o[C]+(r[C]-o[C])*B/u,O),N=c(F.x,F.y,R*1.01);N!==null&&(d[C][B]=Math.min(d[C][B],Math.max(f+Jh,N-Jh)))}}}let p=[a.bandTop[0]*s.top,a.bandTop[1]*s.top,a.bandTop[2]*s.top],b=[a.bandTop[0]*s.bottomCap,a.bandTop[1]*s.bottomCap,a.bandTop[2]*s.bottomCap],y=[a.bandWall[0]*s.top,a.bandWall[1]*s.top,a.bandWall[2]*s.top],g=[a.bandWall[0]*s.wallBottom,a.bandWall[1]*s.wallBottom,a.bandWall[2]*s.wallBottom],v=(R,C)=>{let O=(n.startBin+R+.5)*t.binStepDeg,B=o[R]+(r[R]-o[R])*C/u,F=Jt(t.centre,B,O);return[F.x*m,d[R][C],F.y*m]};{let R=Math.tan(12*Math.PI/180);for(let C=0;C<6;C++){let O=!1;for(let F=0;F<l;F++)for(let N=u-1;N>=0;N--)d[F][N]>d[F][N+1]&&(d[F][N]=d[F][N+1],O=!0);let B=n.closed?l:l-1;for(let F=0;F<B;F++){let N=(F+1)%l;for(let V=0;V<=u;V++){let H=d[N][V]-d[F][V];if(Math.abs(H)>1)continue;let L=o[F]+(r[F]-o[F])*V/u,G=o[N]+(r[N]-o[N])*V/u,j=Jt(t.centre,L,(n.startBin+F+.5)*t.binStepDeg),D=Jt(t.centre,G,(n.startBin+N+.5)*t.binStepDeg),U=R*Math.hypot(D.x-j.x,D.y-j.y)*m;H>U?(d[N][V]=d[F][V]+U,O=!0):-H>U&&(d[F][V]=d[N][V]+U,O=!0)}}if(!O)break}}let P=1,w=(R,C)=>{for(let O=0;O<=u;O+=4)if(Math.abs(d[R][O]-d[C][O])>P)return!0;return Math.abs(d[R][u]-d[C][u])>P},x=Math.tan(38*Math.PI/180),S=R=>(r[R]-o[R])/u*m,A=(R,C)=>d[R][C+1]-d[R][C]>x*Math.max(1e-6,S(R)),M=(R,C)=>{let O=n.closed?(R-1+l)%l:Math.max(0,R-1),B=n.closed?(R+1)%l:Math.min(l-1,R+1);Math.abs(d[O][C]-d[R][C])>P&&(O=R),Math.abs(d[B][C]-d[R][C])>P&&(B=R);let F=Math.max(0,C-1),N=Math.min(u,C+1);F<C&&A(R,F)&&(F=C),N>C&&A(R,C)&&(N=C);let V=v(O,C),H=v(B,C),L=v(R,F),G=v(R,N),j=H[0]-V[0],D=H[1]-V[1],U=H[2]-V[2],$=G[0]-L[0],Z=G[1]-L[1],te=G[2]-L[2],X=D*te-U*Z,me=U*$-j*te,re=j*Z-D*$,ce=Math.hypot(X,me,re);return ce>1e-12?(X/=ce,me/=ce,re/=ce,me<0&&(X=-X,me=-me,re=-re),[X,me,re]):[0,1,0]},E=(R,C,O=!1)=>{let B=O&&Math.min(R[1],C[1])-i>=3,F=[R[0],B?R[1]-Ar:f,R[2]],N=[C[0],B?C[1]-Ar:f,C[2]],V=C[0]-R[0],H=C[2]-R[2],L=Math.hypot(V,H);if(!(L>1e-12))return;let G=[H/L,0,-V/L];e.tri(R,C,N,G,y,y,g),e.tri(R,N,F,G,y,g,g)},T=.05*kt,k=R=>r[R]-o[R]<T,_=n.closed?l:l-1;for(let R=0;R<_;R++){let C=(R+1)%l;if(k(R)||k(C))continue;if(w(R,C)){let H=(n.startBin+R+1)*t.binStepDeg,L=(Z,te)=>{let X=(o[R]+o[C])/2,me=(r[R]+r[C])/2,re=X+(me-X)*te/u,ce=Jt(t.centre,re,H);return[ce.x*m,d[Z][te],ce.y*m]};for(let Z=0;Z<u;Z++){let te=v(R,Z),X=v(R,Z+1),me=L(R,Z),re=L(R,Z+1),ce=M(R,Z),J=M(R,Z+1);e.triN(te,me,re,ce,ce,J,p),e.triN(te,re,X,ce,J,J,p);let ae=v(C,Z),ie=v(C,Z+1),ge=L(C,Z),Ae=L(C,Z+1),be=M(C,Z),ke=M(C,Z+1);e.triN(ge,ae,ie,be,be,ke,p),e.triN(ge,ie,Ae,be,ke,ke,p);let Ke=L(R,Z),Be=L(R,Z+1),Fe=L(C,Z+1),Ge=L(C,Z),ne=Be[0]-Ke[0],W=Be[2]-Ke[2],K=Math.hypot(ne,W);if(K>1e-12){let Q=[W/K,0,-ne/K];e.tri(Ke,Be,Fe,Q,y),e.tri(Ke,Fe,Ge,Q,y)}}let G=v(R,0),j=v(C,0),D=v(C,u),U=v(R,u),$=Z=>[Z[0],f,Z[2]];Math.min(G[1],j[1])-i<3&&(e.tri($(G),$(D),$(j),[0,-1,0],b),e.tri($(G),$(U),$(D),[0,-1,0],b)),E(G,j,!0),E(U,D,!0);continue}for(let H=0;H<u;H++){let L=M(R,H),G=M(C,H),j=M(C,H+1),D=M(R,H+1);if(A(R,H)||A(C,H)){let X=(Be,Fe)=>{let Ge=(n.startBin+Be+.5)*t.binStepDeg,ne=o[Be]+(r[Be]-o[Be])*(H+.5)/u,W=Jt(t.centre,ne,Ge);return[W.x*m,Fe,W.y*m]},me=v(R,H),re=v(C,H),ce=X(R,d[R][H]),J=X(C,d[C][H]);e.triN(me,re,J,L,G,G,p),e.triN(me,J,ce,L,G,L,p);let ae=v(C,H+1),ie=v(R,H+1),ge=X(R,d[R][H+1]),Ae=X(C,d[C][H+1]);e.triN(ge,Ae,ae,D,j,j,p),e.triN(ge,ae,ie,D,j,D,p);let be=J[0]-ce[0],ke=J[2]-ce[2],Ke=Math.hypot(be,ke);if(Ke>1e-12){let Be=[-ke/Ke,0,be/Ke];e.tri(ce,J,Ae,Be,y),e.tri(ce,Ae,ge,Be,y)}continue}let U=v(R,H),$=v(C,H),Z=v(C,H+1),te=v(R,H+1);e.triN(U,$,Z,L,G,j,p),e.triN(U,Z,te,L,j,D,p)}let O=v(R,0),B=v(C,0),F=v(C,u),N=v(R,u),V=H=>[H[0],f,H[2]];Math.min(O[1],B[1])-i<3&&(e.tri(V(O),V(F),V(B),[0,-1,0],b),e.tri(V(O),V(N),V(F),[0,-1,0],b)),E(O,B,!0),E(N,F,!0)}if(!n.closed)for(let R of[0,l-1])for(let C=0;C<u;C++)E(v(R,C),v(R,C+1))}function ef(e,t,n){let{bottomY:o,colors:r,ao:i}=n,a=new Float64Array(t.binCount).fill(-1/0);for(let u of t.rings)for(let m of u.arcs){let h=new Float64Array(m.binCount),f=new Float64Array(m.binCount);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount,y=Math.max(0,m.innerR[p]-Ot);h[p]=Math.max(y,a[b]+.001),f[p]=Math.max(h[p]+.001,m.outerR[p]+Ot)}let d=0;for(let p=0;p<m.binCount;p++){let b=m.topLevelM[p]-o;b>d&&(d=b)}d>=Qx&&aM(e,t,m,h,f,o,r,i,n.standTopNear);for(let p=0;p<m.binCount;p++){let b=(m.startBin+p)%t.binCount;f[p]>a[b]&&(a[b]=f[p])}}if(n.deriveShell===!1||oM(n.shapes,t))return;let s=t.rings[t.rings.length-1],c=Jx*kt,l=eM*kt;for(let u of s.arcs){let m=[],h=[];for(let M=0;M<u.binCount;M++){let E=(u.startBin+M+.5)*t.binStepDeg,T=u.outerR[M]+Ot+c;m.push(Jt(t.centre,T,E)),h.push(Jt(t.centre,T+l,E))}let f=-1/0;for(let M=0;M<u.binCount;M++)u.topLevelM[M]>f&&(f=u.topLevelM[M]);let d=f+tM,p=u.closed?h:[...h,...m.slice().reverse()],b=u.closed?[m.slice().reverse()]:void 0,y=we(r.shellWall,[.66,.71,.72],.62),g=(M,E,T,k,_)=>{let R=Math.abs(k-f)<1e-6?k-Zx:k;mn(e,M,T,R,n.shapes,r.shellTop,_,{holes:E,portalBase:o,ao:i})||ue(e,M,E,()=>R,T,r.shellTop,_,i)},v=Math.max(1,Math.ceil((f-o)/4.5)),P=(f-o)/v,w=new Set,x=n.tierFrontLevels??t.rings.map(M=>{let E=M.arcs.flatMap(T=>Array.from(T.frontLevelM)).filter(Number.isFinite).sort((T,k)=>T-k);return E[Math.floor(E.length/2)]});for(let M of x)Number.isFinite(M)&&M-o>=3&&M<f&&w.add(Math.max(0,Math.min(v-1,Math.floor((M-o)/P))));let S=Math.min(...x.filter(M=>Number.isFinite(M)&&M-o>=3&&M<f));for(let M=0;M<v;M++)o+(M+1)*P<=S-Ar&&Number.isFinite(S)&&w.add(M);for(let M=0;M<v;M++){let E=o+(f-o)*M/v,T=o+(f-o)*(M+1)/v;w.has(M)&&T-E>=3.2?(g(p,b,E,E+.45,y),Ds(e,m,h,u.closed,E+.45,T-.16,r.shellTop,y,i,n.shapes,o)):g(p,b,E,T-.16,y),g(p,b,T-.16,T,oe(y,.62))}Ds(e,m,h,u.closed,f,d,r.shellTop,y,i,n.shapes,o);let A=8;for(let M=1;M<h.length;M++){if(A+=Math.hypot(h[M].x-h[M-1].x,h[M].y-h[M-1].y)*Me,A<8)continue;A=0;let E=h[M],T=h[M-1],k=E.x-T.x,_=E.y-T.y,R=Math.max(1,Math.hypot(k,_)),C=k/R*.16*kt,O=_/R*.16*kt,B=Math.max(1,Math.hypot(E.x-t.centre.x,E.y-t.centre.y)),F=(E.x-t.centre.x)/B*.24*kt,N=(E.y-t.centre.y)/B*.24*kt,V=[{x:E.x-C,y:E.y-O},{x:E.x+C,y:E.y+O},{x:E.x+C+F,y:E.y+O+N},{x:E.x-C+F,y:E.y-O+N}];g(V,void 0,o,f,oe(y,1.12))}}}var sM=2.5,tf=.65,cM=2,lM=.03;function uM(e,t){let n=()=>{let o=t;for(;e.length>2;){let r=e[0],i=e[1],a=Math.hypot(i.x-r.x,i.y-r.y);if(a>o){e[0]={x:r.x+(i.x-r.x)/a*o,y:r.y+(i.y-r.y)/a*o};return}o-=a,e.shift()}};n(),e.reverse(),n(),e.reverse()}function zs(e,t,n){let o=new Map;for(let i of e){let a=o.get(i.blockId);(!a||i.depth<a.depth)&&o.set(i.blockId,i)}let r=[];for(let[i,a]of o){if(a.y-n<sM||a.pts.length<2)continue;let s=a.pts.map(u=>{let m=u.x-t.x,h=u.y-t.y,f=Math.max(1,Math.hypot(m,h));return{x:u.x-m/f*tf/I,y:u.y-h/f*tf/I}}),c=[],l=[s[0]];for(let u=1;u<s.length;u++){let m=s[u-1],h=s[u];Math.hypot(h.x-m.x,h.y-m.y)*I>cM?(l.length>=2&&c.push(l),l=[h]):l.push(h)}l.length>=2&&c.push(l);for(let u of c)uM(u,lM/I);c.length&&r.push({blockId:i,y:a.y,runs:c})}return r}var nf=.1,mM=1.1,hM=.22,Gs=.95,Vs=.05,of=1.8;function rf(e,t,n,o){let r=[.72,.72,.69],i=[.48,.55,.57];for(let a of zs(t,n,o)){let s=a.y;for(let c of a.runs){let l=of;for(let u=1;u<c.length;u++){let m=c[u-1],h=c[u],f=h.x-m.x,d=h.y-m.y,p=Math.hypot(f,d);if(p<1e-5)continue;let b=y=>{let g=-d/p*y/I/2,v=f/p*y/I/2;return[{x:m.x+g,y:m.y+v},{x:h.x+g,y:h.y+v},{x:h.x-g,y:h.y-v},{x:m.x-g,y:m.y-v}]};if(ue(e,b(hM),void 0,()=>s+nf,s-mM,r,r,se),ue(e,b(Vs),void 0,()=>s+Gs,s+Gs-Vs,i,i,se),l+=p*I,l>=of||u===c.length-1){l=0;let y=.028/I,g=[{x:m.x-y,y:m.y-y},{x:m.x+y,y:m.y-y},{x:m.x+y,y:m.y+y},{x:m.x-y,y:m.y+y}];ue(e,g,void 0,()=>s+Gs-Vs,s+nf,i,i,se)}}}}}var fM=.9,dM=1.5,pM=.3;function af(e,t,n){let o=[],r=[],i=fM/I,a=dM/I,s=pM/I;for(let c of e)for(let l of c.runs){if(l.length<2)continue;let u=l.slice(),m=(b,y)=>{let g=u[b],v=u[y],P=Math.hypot(g.x-v.x,g.y-v.y)||1;u[b]={x:g.x+(g.x-v.x)/P*s,y:g.y+(g.y-v.y)/P*s}};m(0,1),m(u.length-1,u.length-2);let h=u.map((b,y)=>{let g=u[Math.max(0,y-1)],v=u[Math.min(u.length-1,y+1)],P=v.x-g.x,w=v.y-g.y,x=Math.hypot(P,w)||1,S=-w/x,A=P/x;return S*(b.x-t.x)+A*(b.y-t.y)<0&&(S=-S,A=-A),{nx:S,ny:A}}),f=u.map((b,y)=>({x:b.x-h[y].nx*a,y:b.y-h[y].ny*a})),d=u.map((b,y)=>({x:b.x+h[y].nx*i,y:b.y+h[y].ny*i})),p=u.map((b,y)=>({x:b.x+h[y].nx*(i+n/I),y:b.y+h[y].ny*(i+n/I)}));o.push([...f,...d.slice().reverse()]),r.push([...d,...p.reverse()])}return{bays:o,walls:r}}var Us=.88,$i=.27,bM=1.2,gM=.01,yM=7,xM=.05,MM=.25;function sf(e,t,n,o,r){let i=[.67,.71,.68],a=[i[0]*Us,i[1]*Us,i[2]*Us],s=c=>!!r&&r.some((l,u)=>u!==c&&l?.belowY!=null&&Math.abs(l.belowY-t[c].y)<1e-6&&t[u].blockId===t[c].blockId);for(let c=0;c<t.length;c++){let l=t[c];if(!(l.pts.length<2))for(let u of[0,l.pts.length-1]){let m=l.pts[u],h=l.pts[u===0?1:u-1],f=m.x-h.x,d=m.y-h.y,p=Math.hypot(f,d);if(p<1e-5)continue;f/=p,d/=p;let b=1/0;for(let C=0;C<n.length;C++){let O=n[C],B=n[(C+1)%n.length],F=B.x-O.x,N=B.y-O.y,V=f*N-d*F;if(Math.abs(V)<1e-8)continue;let H=O.x-m.x,L=O.y-m.y,G=(H*N-L*F)/V,j=(H*d-L*f)/V;G>0&&j>=0&&j<=1&&(b=Math.min(b,G))}let y=.3/I,g=b-.04/I;if(!Number.isFinite(b)||b*I>2||g-y<.12/I)continue;let v=!!o&&s(c),P=r?.[c]?.pitch,w=v&&P&&Number.isFinite(P)?Math.min(bM/I,Math.max($i/I,P-$i/I-gM/I)):$i/I,x=-d,S=f;o&&x*(o.x-m.x)+S*(o.y-m.y)<0&&(x=-x,S=-S);let A=$i/I,M=[{x:m.x+f*y+x*A,y:m.y+d*y+S*A},{x:m.x+f*g+x*A,y:m.y+d*g+S*A},{x:m.x+f*g-x*w,y:m.y+d*g-S*w},{x:m.x+f*y-x*w,y:m.y+d*y-S*w}];if(!M.every(C=>Ye(n,C.x,C.y)))continue;let E=r?.[c]?.belowY,T=E==null?0:l.y-E,k=!!o&&T>.03&&T<=.65;if(k&&o){let C=(O,B)=>Math.hypot((O.x+B.x)/2-o.x,(O.y+B.y)/2-o.y);C(M[0],M[1])>C(M[3],M[2])&&(M=[M[3],M[2],M[1],M[0]])}let _=k?Math.ceil((T-1e-8)/.2):1,R=(C,O,B)=>({x:C.x+(O.x-C.x)*B,y:C.y+(O.y-C.y)*B});for(let C=0;C<_;C++){let O=C/_,B=(C+1)/_,F=[R(M[0],M[3],O),R(M[1],M[2],O),R(M[1],M[2],B),R(M[0],M[3],B)],N=l.y+.008-(k?T*(1-B):0);if(ue(e,F,void 0,()=>N,N-(k?T/_+.1:.16),i,a,se),!k)continue;let V=Math.hypot(F[3].x-F[0].x,F[3].y-F[0].y)*I;if(V<1e-4)continue;let H=Math.min(xM/V,MM),L=R(F[0],F[3],H),G=R(F[1],F[2],H),j=U=>[U.x*I,N+.004,U.y*I],D=[.8,.67,.3];e.setMaterial(yM),e.tri(j(F[0]),j(F[1]),j(G),[0,1,0],D),e.tri(j(F[0]),j(G),j(L),[0,1,0],D),e.setMaterial(0)}}}}var vM=.02,SM=.012,wM=.01,PM=.3,AM=.5;function RM(e,t,n){if(e.length===1)return Math.hypot(t-e[0].x,n-e[0].y);let o=1/0;for(let r=0;r+1<e.length;r++){let i=e[r],a=e[r+1],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>1e-12?((t-i.x)*s+(n-i.y)*c)/l:0;u=Math.max(0,Math.min(1,u)),o=Math.min(o,Math.hypot(t-(i.x+u*s),n-(i.y+u*c)))}return o}function EM(e,t,n,o){let r=1/0,i=Number.NaN;for(let a=0;a<e.length;a++){let s=t[a];if(Math.hypot(n-s.cx,o-s.cy)-s.rad>=r)continue;let c=RM(e[a].pts,n,o);c<r&&(r=c,i=e[a].y)}return i}function cf(e,t,n,o,r,i,a){let s=o.filter(h=>h.pts.length>0);if(s.length<2||t.length<3)return;let c=s.map(h=>{let f=0,d=0;for(let b of h.pts)f+=b.x,d+=b.y;f/=h.pts.length,d/=h.pts.length;let p=0;for(let b of h.pts)p=Math.max(p,Math.hypot(b.x-f,b.y-d));return{cx:f,cy:d,rad:p}}),l=[...t],u=n.map(h=>[...h]),m=vM/I;for(let h of[l,...u])for(let f=0;f<h.length;f++){let d=h[f],p=h[(f+1)%h.length],b=p.x-d.x,y=p.y-d.y,g=Math.hypot(b,y);if(g*I<.05)continue;let v=(d.x+p.x)/2,P=(d.y+p.y)/2,w=y/g,x=-b/g;mt({x:v+w*m,y:P+x*m},l,u)&&(w=-w,x=-x);let S=r.x-v,A=r.y-P,M=Math.hypot(S,A)||1;if((w*S+x*A)/M>AM)continue;let E=1/0;for(let F of[.2,.5,.8]){let N=EM(s,c,d.x+b*F-w*m*2,d.y+y*F-x*m*2);Number.isFinite(N)&&(E=Math.min(E,N))}if(!Number.isFinite(E)||E-i<PM)continue;let T=i-wM,k=E-SM,_={x:(d.x-w*m)*I,z:(d.y-x*m)*I},R={x:(p.x-w*m)*I,z:(p.y-x*m)*I},C=[w,0,x],O=oe(a,se.wallBottom),B=oe(a,se.top);e.tri([_.x,k,_.z],[R.x,k,R.z],[R.x,T,R.z],C,B,B,O),e.tri([_.x,k,_.z],[R.x,T,R.z],[_.x,T,_.z],C,B,O,O)}}function lf(e,t,n,o,r,i,a,s,c=!1){if(!t.outline||t.outline.length<3)return;let l=n.baseHeightM,u=n.objects.filter(g=>g.type==="shape"&&(g.role==="entrance"||g.role==="exit")),m=Yu(o,s.tierTop);if(!r)return;let h=g=>r.deckAt(g.x,g.y),f=um(t,a),d=f[0]??t.outline;if(r.rowLevels.length>=2){let g=xi(r.rowLevels),v=mm(am(r.rowLevels,n.focal,g),f),P=af(zs(r.rowLevels,n.focal,l),n.focal,Hs);for(let x of v){let S=Math.max(l,x.topY-uf);for(let A of i.subtract(x.outline,S))Qh(e,A,x.holes,S,l,s.tierTop,s.tierWall,u,!c,P);e.setMaterial(5),cf(e,x.outline,x.holes,r.rowLevels,n.focal,S,s.tierWall),e.setMaterial(0)}v.length||ue(e,d,t.holes,()=>r.landingY,l,m,s.tierWall,se);let w={tread:[m[0]*se.top,m[1]*se.top,m[2]*se.top],riser:[m[0]*.72,m[1]*.72,m[2]*.72]};for(let x of f.length?f:[d])cm(e,r.rowLevels,n.focal,r.landingY,w,x,g);rf(e,r.rowLevels,n.focal,l),sf(e,r.rowLevels,t.outline,n.focal,g);return}let p=r.flat?1/0:yh,b=g=>r.normalAt(g.x,g.y),y=r.flat?r.landingY:void 0;for(let g of i.subtract(d,y))ue(e,g,t.holes,h,l,m,s.tierWall,se,p,b)}function IM(e,t,n){let o=new Set;for(let a of e.objects)a.type==="section"&&o.add(a.id);let r=new Map;for(let a=0;a<t.length;a++){let s=n.seatOwner[a];if(!s||!o.has(s))continue;let c=n.bySection.get(s);if(c&&c.rowLevels.length>=2)continue;let l=t[a];if(l.kind==="booth")continue;let u=r.get(s);u||(u=new Map,r.set(s,u));let m=l.rowId||`__seat-${a}`,h=u.get(m);h||(h={pts:[],levelM:0,n:0},u.set(m,h)),h.pts.push({x:l.x,y:l.y}),h.levelM+=n.seatDeckY(a),h.n++}let i=[];for(let a of e.objects){if(a.type!=="section")continue;let s=n.bySection.get(a.id);if(s&&s.rowLevels.length>=2){let l=s.rowLevels.filter(u=>!u.patch).map(u=>({pts:u.pts,levelM:u.y}));l.length>=2&&i.push({sectionId:a.id,rows:l});continue}let c=r.get(a.id);c&&i.push({sectionId:a.id,rows:[...c.values()].map(l=>({pts:l.pts,levelM:l.levelM/l.n}))})}return i}function _M(e,t){let n=1/0;for(let o=0;o<t.length;o++){let r=t[o],i=t[(o+1)%t.length],a=i.x-r.x,s=i.y-r.y,c=Math.max(0,Math.min(1,((e.x-r.x)*a+(e.y-r.y)*s)/(a*a+s*s||1)));n=Math.min(n,Math.hypot(e.x-r.x-c*a,e.y-r.y-c*s))}return n}var uf=.02;function CM(e,t){let n=e.objects.filter(o=>o.type==="section"&&!!o.outline&&o.outline.length>=3).flatMap(o=>{let r=t.bySection.get(o.id);if(!r)return[];let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let u of o.outline)u.x<i&&(i=u.x),u.x>a&&(a=u.x),u.y<s&&(s=u.y),u.y>c&&(c=u.y);let l=r.landingY;for(let u of r.rowLevels)l=Math.min(l,u.y-uf);return[{outline:o.outline,holes:o.holes,surface:r,floorTop:l,minX:i,maxX:a,minY:s,maxY:c}]});return(o,r,i)=>{let a=null;for(let s of n){if(o<s.minX-i||o>s.maxX+i||r<s.minY-i||r>s.maxY+i)continue;let c={x:o,y:r};if(!mt(c,s.outline,s.holes)&&_M(c,s.outline)>i)continue;let l=Math.min(s.surface.deckAt(o,r),s.floorTop);(a===null||l<a)&&(a=l)}return a}}var TM=3,kM=.4;function mf(e,t,n,o,r,i,a=!0){let s=IM(t,n,o);if(s.length<TM)return;let c=Zh(s,t.focal);if(!c)return;let l=Math.max(0,...c.rings.map(u=>u.arcs.reduce((m,h)=>m+h.binCount,0)))/c.binCount;e.setMaterial(5),ef(e,c,{bottomY:t.baseHeightM,tierFrontLevels:s.map(u=>Math.min(...u.rows.map(m=>m.levelM))),colors:{bandTop:oe(r.tierTop,.8),bandWall:r.tierWall,shellTop:i??oe(r.tierWall,1.15),shellWall:i??r.tierWall},ao:se,shapes:t.objects.filter(u=>u.type==="shape"),deriveShell:a&&l>=kM,standTopNear:CM(t,o)}),e.setMaterial(0)}var hf=4;var LM=[[/\b(wc|toilets?|restrooms?|washrooms?|lavatory|loo)\b/i,"restroom"],[/\b(bar|drinks|pub|cocktails?)\b/i,"bar"],[/\b(food|concessions?|snacks?|kiosk|caf[eé]|kitchen|catering)\b/i,"concession"],[/\b(coat ?check|cloak ?room|cloakroom|coats)\b/i,"coat"],[/\b(screen|led wall|projection|video wall)\b/i,"screen"],[/\b(sound|foh|mixing desk|control booth)\b/i,"sound"],[/\b(entrance|entry|way in|gate)\b/i,"entrance"],[/\b(exit|way out)\b/i,"exit"],[/\b(pillar|column|obstruction)\b/i,"obstruction"],[/\b(walls?|outline|boundary|perimeter)\b/i,"wall"]],OM=1.2,FM=12;function ff(e){if(e.heightM!==void 0)return!1;let t=Pe(e);if(!t||t.length<3)return!1;let n=0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length];n+=Math.hypot(a.x-i.x,a.y-i.y)}return n*Me<FM*2?!1:2*Rr(t)/n*Me<=OM}function Ws(e){if(!e)return null;for(let[t,n]of LM)if(t.test(e))return n;return null}var pf="auto-rows-";function bf(e){return e.id.startsWith(pf)&&!e.label}var DM=1.15,NM=.09,gf=6,BM=34,HM=.35,GM=6,VM=.35,zM=.75,UM=12,WM=2.5,jM=40,XM=[18,24],KM=[12,16],df=14,YM=.8,$M=.6,ZM=5,qM=.3,yf=.4,xf=2,QM=400,JM=2.6,ev=.8,tv=4,nv=26,ov=.7,rv=.5,iv=.985,av=1.5,sv=2.2,cv=3,lv=25,uv=.985,mv=2,hv=6,fv=3,dv=.1,pv=1.5,bv=1.6,gv=6e3,yv=.6,xv="#c3c7cd",js=300,Mv=240;function vv(e,t,n,o){if(!e.fill||!/^#[0-9a-f]{6}$/i.test(e.fill))return null;let r=Ks([...t]),i=new Set;for(let u of o)i.add(Math.floor(Math.atan2(u.y-r.y,u.x-r.x)*180/Math.PI/10));if(i.size*10<Mv)return null;let{h:a,s,l:c}=fl(ml(e.fill));return a<70/360||a>170/360||s<.2||c<.08||c>.75||n.some(u=>u!==e&&u.type==="shape"&&Pe(u)?.some(m=>Zs(m,t)))?null:e.kind==="ellipse"?"oval-cricket":e.kind==="rect"?"pitch-football":null}var Sv="Estimated from the drawing; confirm with the venue.",Ys=e=>{if(!e.length)return null;let t=[...e].sort((o,r)=>o-r),n=Math.floor(t.length/2);return t.length%2?t[n]:(t[n-1]+t[n])/2},Ks=e=>({x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}),Rr=e=>{let t=0;for(let n=0;n<e.length;n++){let o=e[n],r=e[(n+1)%e.length];t+=o.x*r.y-r.x*o.y}return Math.abs(t)/2};function wv(e){return e.height!==void 0||e.rake!==void 0||e.elevation!==void 0||e.surfaceKind!==void 0}function $s(e){let t=new Map;for(let n of e){let o=t.get(n.rowId);o?o.push(n):t.set(n.rowId,[n])}return t}function Zs(e,t){let n=!1;for(let o=0,r=t.length-1;o<t.length;r=o++){let i=t[o],a=t[r];i.y>e.y!=a.y>e.y&&e.x<(a.x-i.x)*(e.y-i.y)/(a.y-i.y)+i.x&&(n=!n)}return n}function qs(e,t){let n=t[0],o=1/0;for(let r=0;r<t.length;r++){let i=t[r],a=t[(r+1)%t.length],s=a.x-i.x,c=a.y-i.y,l=s*s+c*c,u=l>0?Math.max(0,Math.min(1,((e.x-i.x)*s+(e.y-i.y)*c)/l)):0,m={x:i.x+s*u,y:i.y+c*u},h=Math.hypot(e.x-m.x,e.y-m.y);h<o&&(o=h,n=m)}return n}function Mf(e,t){let n=0,o=0;for(let r of e.values()){if(r.length<3)continue;let i=r[0],a=r[r.length-1],s=a.x-i.x,c=a.y-i.y,l=Math.hypot(s,c);if(l<1e-6)continue;let u={x:(i.x+a.x)/2,y:(i.y+a.y)/2},m=qs(u,t),h=m.x-u.x,f=m.y-u.y,d=Math.hypot(h,f);d<1e-6||(o+=Math.abs((-c*h+s*f)/(l*d))*r.length,n+=r.length)}return n?o/n:0}function Pv(e,t,n){let o=e.filter(p=>p.type==="shape"),r=o.find(p=>p.role==="stage");if(r){let p=Pe(r);return p?{shape:r,centre:Ks(p),outline:p,inferred:!1}:null}if(!n.length)return null;let i=1/0,a=-1/0,s=1/0,c=-1/0;for(let p of n)i=Math.min(i,p.x),a=Math.max(a,p.x),s=Math.min(s,p.y),c=Math.max(c,p.y);let l=(a-i)*(c-s),u=[];for(let p of o){if(p.role)continue;let b=Pe(p);if(!b)continue;let y=Rr(b);if(y*Me*Me<6||y>l)continue;let g=Math.min(...b.map(M=>M.x)),v=Math.max(...b.map(M=>M.x)),P=Math.min(...b.map(M=>M.y)),w=Math.max(...b.map(M=>M.y)),x=0;for(let M of n)M.x>g&&M.x<v&&M.y>P&&M.y<w&&Zs(M,b)&&x++;if(x>n.length*.05)continue;let S=Ks(b),A=Mf(t,b);A>=YM&&u.push({shape:p,centre:S,outline:b,score:A,area:y,box:[g,P,v,w]})}let m=(p,b)=>b!==p&&b.area>p.area&&p.box[0]>=b.box[0]-1e-6&&p.box[1]>=b.box[1]-1e-6&&p.box[2]<=b.box[2]+1e-6&&p.box[3]<=b.box[3]+1e-6,h=u.filter(p=>!u.some(b=>m(p,b))),f=Math.max(0,...h.map(p=>p.score)),d=h.filter(p=>p.score>=f-.03).sort((p,b)=>b.area-p.area)[0]??null;return d?{shape:d.shape,centre:d.centre,outline:d.outline,inferred:!0}:null}function Av(e,t,n){if(!n||n.length<3)return Math.hypot(e.x-t.x,e.y-t.y);let o=qs(e,n);return Math.hypot(e.x-o.x,e.y-o.y)}function vf(e){return e.length<3?[...e].sort((t,n)=>t.x-n.x||t.y-n.y):bo(e)}function Rv(e){if(!e.length||e.length>gv)return[];let t=[...$s(e).values()],n=t.map((s,c)=>c),o=s=>n[s]===s?s:n[s]=o(n[s]),r=bv/Me,i=t.map(s=>({minX:Math.min(...s.map(c=>c.x))-r,maxX:Math.max(...s.map(c=>c.x))+r,minY:Math.min(...s.map(c=>c.y))-r,maxY:Math.max(...s.map(c=>c.y))+r}));for(let s=0;s<t.length;s++)for(let c=s+1;c<t.length;c++){let l=i[s],u=i[c];if(l.maxX<u.minX||u.maxX<l.minX||l.maxY<u.minY||u.maxY<l.minY)continue;t[s].some(h=>t[c].some(f=>Math.hypot(h.x-f.x,h.y-f.y)<=r))&&(n[o(s)]=o(c))}let a=new Map;return t.forEach((s,c)=>{let l=o(c),u=a.get(l);u?u.push(...s):a.set(l,[...s])}),[...a.values()].filter(s=>new Set(s.map(c=>c.rowId)).size>=2)}function Ev(e,t,n){if(!t.length)return null;let o=t.filter(A=>n.tableIds.has(A.rowId)||A.kind==="booth").length>t.length/2,r=$s(t),i=!n.outline||Mf(r,n.outline)>=$M,a=0,s=0;for(let A of r.values()){if(A.length<2)continue;let M=A[0],E=A[A.length-1],T=E.x-M.x,k=E.y-M.y,_=Math.hypot(T,k);if(_<1e-6)continue;let R={x:(M.x+E.x)/2,y:(M.y+E.y)/2},C=i?n.outline?qs(R,n.outline):n.focal:n.middle,O=-k/_,B=T/_;O*(C.x-R.x)+B*(C.y-R.y)<0&&(O=-O,B=-B),a+=O*A.length,s+=B*A.length}let c={x:t.reduce((A,M)=>A+M.x,0)/t.length,y:t.reduce((A,M)=>A+M.y,0)/t.length};if(Math.hypot(a,s)<1e-9){let A=i?n.focal:n.middle;a=A.x-c.x,s=A.y-c.y}let l=Math.hypot(a,s)||1,u={x:a/l,y:s/l},m=A=>-(A.x*u.x+A.y*u.y),h=A=>-A.x*u.y+A.y*u.x,f=1/0,d=-1/0,p=1/0,b=-1/0,y=1/0,g=new Map;for(let A of t){let M=m(A),E=h(A);f=Math.min(f,M),d=Math.max(d,M),p=Math.min(p,E),b=Math.max(b,E),i&&(y=Math.min(y,Av(A,n.focal,n.outline)));let T=A.logicalRowId??A.rowId,k=g.get(T);k?k.push(M):g.set(T,[M])}i||(y=Math.max(0,f-m(n.middle)));let v=[...g.values()].map(A=>Ys(A)).sort((A,M)=>A-M),P=[];if(!o)for(let A of v)P.length&&A-P[P.length-1]<VM/Me||P.push(A);let w=wv(e),x=bn(e,{floorBaseHeightM:n.baseHeightM}),S={id:e.id,section:e,authored:w,plane:n,facing:u,facesAction:i,hull:vf(t),sample:t.filter((A,M)=>M%Math.ceil(t.length/QM)===0),frontD:f,backD:d,latMin:p,latMax:b,frontDistance:y,rowDepths:P,rowCount:P.length,level:0,height:x.height,rake:w?x.rake:0,backHeight:0};return S.backHeight=S.height+(d-f)*Me*Math.tan(S.rake*Math.PI/180),S}function Iv(e,t,n,o){if(e.length<2)return 0;let r=Math.max(1,t*Me),i=n+DM-o,a=0,s=0;for(let l=1;l<e.length;l++){let u=Math.max(zM,(e[l]-e[l-1])*Me),m=(i+NM)*(r+u)/r;a+=m-i,s+=u,i=m,r+=u}let c=Math.atan(a/s)*180/Math.PI;return Math.round(Math.max(gf,Math.min(BM,c))*10)/10}function _v(e,t,n=!1){if(!n&&e.facing.x*t.facing.x+e.facing.y*t.facing.y<qM)return null;let o=-1/0,r=1/0,i=-1/0;for(let h of t.hull){o=Math.max(o,-(h.x*e.facing.x+h.y*e.facing.y));let f=-h.x*e.facing.y+h.y*e.facing.x;r=Math.min(r,f),i=Math.max(i,f)}if(Math.min(e.latMax,i)-Math.max(e.latMin,r)<(n?1e-6:yf*(e.latMax-e.latMin)))return null;let s=xf/Me,c=new Map,l=new Map;for(let h of e.sample){let f=Math.floor((-h.x*e.facing.y+h.y*e.facing.x)/s),d=-(h.x*e.facing.x+h.y*e.facing.y);c.set(f,Math.min(c.get(f)??1/0,d))}for(let h of t.sample){let f=Math.floor((-h.x*e.facing.y+h.y*e.facing.x)/s),d=-(h.x*e.facing.x+h.y*e.facing.y);l.set(f,Math.max(l.get(f)??-1/0,d))}let u=[];for(let[h,f]of c){let d=l.get(h);d!==void 0&&u.push(f-d)}let m=u.length?Ys(u):e.frontD-o;return m<-1/Me?null:m}function Cv(e,t){if(t.plane.floorIndex>=e.plane.floorIndex)return!1;let n=-1/0,o=1/0,r=1/0,i=-1/0;for(let c of t.hull){let l=-(c.x*e.facing.x+c.y*e.facing.y);n=Math.max(n,l),o=Math.min(o,l);let u=-c.x*e.facing.y+c.y*e.facing.x;r=Math.min(r,u),i=Math.max(i,u)}let a=Math.min(e.latMax,i)-Math.max(e.latMin,r),s=Math.min(e.backD,n)-Math.max(e.frontD,o);return a>yf*(e.latMax-e.latMin)&&s>1/Me}function Tv(e,t){let n=new Set;for(let o of e){let r=(Math.atan2(o.y-t.y,o.x-t.x)*180/Math.PI+360)%360;n.add(Math.floor(r/10))}return n.size/36}function kv(e,t){let n=1/0,o=-1/0;for(let i of t.hull){let a=-(i.x*e.facing.x+i.y*e.facing.y);n=Math.min(n,a),o=Math.max(o,a)}let r=Math.max(0,Math.min(o-n,e.frontD-n));return t.height+r*Me*Math.tan(t.rake*Math.PI/180)}function Lv(e,t){if(!e.facesAction)return!1;let n={x:-e.facing.y,y:e.facing.x},o=xf/Me,r=Math.max(1,Math.ceil((e.backD-e.frontD)/o)),i={left:new Map,right:new Map};for(let s of t)if(!(s===e||s.plane.floorIndex!==e.plane.floorIndex)&&!(s.facing.x*e.facing.x+s.facing.y*e.facing.y>=iv))for(let c of s.sample){let l=-(c.x*e.facing.x+c.y*e.facing.y);if(l<e.frontD||l>e.backD)continue;let u=-c.x*e.facing.y+c.y*e.facing.x,m=u<e.latMin?"left":u>e.latMax?"right":null;if(!m)return!1;let h=Math.min(r-1,Math.floor((l-e.frontD)/o)),f=m==="left"?e.latMin-u:u-e.latMax;f<(i[m].get(h)?.gap??1/0)&&i[m].set(h,{gap:f,other:s})}let a=s=>{let c=s==="left"?e.latMin:e.latMax,l=0;for(let[u,{other:m}]of i[s]){if((m.facing.x*n.x+m.facing.y*n.y)*(s==="left"?1:-1)<ov)continue;let f=e.frontD+(u+.5)*o,d={x:-f*e.facing.x+c*n.x,y:-f*e.facing.y+c*n.y},p=-(d.x*m.facing.x+d.y*m.facing.y),b=-d.x*m.facing.y+d.y*m.facing.x;p<m.frontD&&b>=m.latMin&&b<=m.latMax&&l++}return l/r>=rv};return a("left")&&a("right")}function Ov(e,t){if(t.plane.floorIndex!==e.plane.floorIndex||t.facing.x*e.facing.x+t.facing.y*e.facing.y<uv)return!1;let n=1/0,o=-1/0,r=1/0;for(let s of t.hull){let c=-s.x*e.facing.y+s.y*e.facing.x;n=Math.min(n,c),o=Math.max(o,c),r=Math.min(r,-(s.x*e.facing.x+s.y*e.facing.y))}let i=(e.frontD-r)*Me;if(i<-mv||i>hv)return!1;let a=Math.max(n-e.latMax,e.latMin-o);return a*Me<=fv&&a*Me>=-dv}function Fv(e,t=!1,n=!1,o){let r=t?KM:XM,i=new Set(n?[]:e.filter(p=>!p.authored&&Lv(p,e))),a=[...e].sort((p,b)=>p.plane.floorIndex-b.plane.floorIndex||Number(i.has(b))-Number(i.has(p))||p.frontDistance-b.frontDistance);for(let p of i)o?.add(p.id);let s=(p,b,y)=>{let g=new Map,v=[],P=new Map,w=x=>{if(x.plane.floorIndex===0||x.plane.baseHeightM>0)return x.plane.baseHeightM;let S=P.get(x.plane.floorIndex-1);return S===void 0?x.plane.baseHeightM:S+hf};for(let x of a){if(i.has(x))x.height=w(x),x.level=0,x.rake=0,x.backHeight=x.height,g.set(x.id,void 0);else if(!x.authored){let A=w(x),M;for(let R of v){if(R.plane.floorIndex>x.plane.floorIndex)continue;if(Cv(x,R)){let F=kv(x,R)+JM;F>A&&(A=F,M=R);continue}let C=_v(x,R,i.has(R));if(C==null)continue;let O=n&&!!x.plane.stageDeck&&R.level===0&&R.plane.floorIndex===x.plane.floorIndex&&Math.max(0,C)*Me<=tv,B=i.has(R)?R.height+av:O?R.backHeight:R.backHeight+HM+Math.min(GM,Math.max(0,C)*Me)*Math.tan(R.rake*Math.PI/180);B>A&&(A=B,M=R)}let E=p.get(x);E&&E.height>A+.01?(A=E.height,M=void 0):E=void 0,x.height=Math.round(Math.min(A,x.plane.baseHeightM+jM)*100)/100;let T=!M&&!E&&x.height>x.plane.baseHeightM;if(x.level=M?M.level+1:E?E.level:T?1:0,x.rake=Iv(x.rowDepths,x.frontDistance,x.height,x.plane.focalHeightM),!x.facesAction&&x.rowCount<ZM)x.rake=0;else if(x.level===0){let R=Math.max(1e-6,(x.backD-x.frontD)*Me);x.rake=Math.min(x.rake,UM,Math.round(Math.atan(WM/R)*1800/Math.PI)/10)}else x.rowCount>=2&&(x.rake=Math.max(x.rake,r[Math.min(x.level,r.length)-1]));let k=(x.backD-x.frontD)*Me,_=M&&i.has(M)||E&&y?.has(E.id);if(b!==void 0&&_&&x.rowCount>=2&&(x.rake=b),t&&k>0&&x.height+k*Math.tan(x.rake*Math.PI/180)>x.plane.baseHeightM+df){let R=Math.max(0,x.plane.baseHeightM+df-x.height);x.rake=Math.max(gf,Math.round(Math.atan(R/k)*1800/Math.PI)/10)}n&&x.plane.stageDeck&&x.level>0&&(x.rake=Math.min(x.rake,nv)),x.backHeight=x.height+k*Math.tan(x.rake*Math.PI/180),g.set(x.id,M?.id??(E?g.get(E.id):void 0))}let S=x.plane.floorIndex;P.set(S,Math.min(P.get(S)??1/0,x.height)),v.push(x)}return g},c=s(new Map),l=new Map,u=p=>l.get(p)?.height??p.height;for(let p=!0,b=0;p&&b<e.length;b++){p=!1;for(let y of e)if(!(y.authored||i.has(y)))for(let g of e){let v=l.get(g)??g;g===y||v.height-v.plane.baseHeightM<pv||v.height<=u(y)+.01||Ov(y,g)&&(l.set(y,v),p=!0)}}let m=new Map(e.map(p=>[p.id,p])),h=e.filter(p=>!p.authored&&p.rowCount>=2&&i.has(m.get(c.get(p.id)??""))),f=h.length?Ys(h.map(p=>p.rake)):void 0;if(!l.size&&f===void 0)return c;let d=new Map([...new Set(l.values())].map(p=>[p,{...p}]));return s(new Map([...l].map(([p,b])=>[p,d.get(b)])),f,new Set(h.map(p=>p.id)))}var Xs=(e,t)=>!!e&&e.x===t.x&&e.y===t.y;function Zi(e,t={x:0,y:-40}){let n=fo(e),o=new Map;for(let y of n){if(!y.sectionId)continue;let g=o.get(y.sectionId);g?g.push(y):o.set(y.sectionId,[y])}let r={focalInferred:!1,confident:!1,sections:[]},i=e.floors?.length?e.floors.map((y,g)=>({objects:y.objects,floorIndex:g,floorId:y.id,baseHeightM:y.baseHeightM??0,focal:y.focalPoint??e.focalPoint})):[{objects:e.objects,floorIndex:0,floorId:void 0,baseHeightM:0,focal:e.focalPoint}],a=new Set(i.flatMap(y=>y.objects.filter(g=>g.type==="table").map(g=>g.id))),s=[],c,l=new Set,u=i.map(y=>{let g=_=>!e.floors?.length||_.floorId===y.floorId,v=Rv(n.filter(_=>!_.sectionId&&_.kind!=="booth"&&!a.has(_.rowId)&&g(_))),P=[];for(let _ of v){let R=Zt($t(vf(_)),yv/Me);if(n.some(O=>!g(O)&&Zs(O,R)))continue;let C=`${pf}${y.floorIndex}-${P.length}`;l.add(C),o.set(C,_),P.push({type:"section",id:C,label:"",color:xv,outline:R})}let w=P.length?{...y,objects:[...y.objects,...P]}:y,x=new Set(w.objects.filter(_=>_.type==="section").map(_=>_.logicalSectionId??_.id)),S=[...o.entries()].filter(([_])=>x.has(_)).flatMap(([,_])=>_),A=Pv(w.objects,$s(S),S),M=w.focal;(A||w.focal&&!Xs(w.focal,t))&&(r.confident=!0),A&&(r.stage??={id:A.shape.id,inferred:A.inferred,...w.floorId?{floorId:w.floorId}:{}},(A.inferred||Xs(w.focal,t))&&(M=A.centre,r.focalInferred=!0));let E=A&&(!A.inferred||Rr(A.outline)*Me*Me<=js),T=A?void 0:c,k={tableIds:a,floorIndex:w.floorIndex,floorId:w.floorId,baseHeightM:w.baseHeightM,focal:T?.focal??M,outline:A?.outline??T?.outline,focalHeightM:T?.focalHeightM??w.baseHeightM+(A&&E?Gt({...A.shape,role:"stage"}).heightM:0),stageDeck:T?.stageDeck??!!(A&&E&&Rr(A.outline)*Me*Me<=js),middle:S.length?{x:S.reduce((_,R)=>_+R.x,0)/S.length,y:S.reduce((_,R)=>_+R.y,0)/S.length}:M};for(let _ of w.objects){if(_.type!=="section")continue;let R=Ev(_,o.get(_.logicalSectionId??_.id)??[],k);R&&s.push(R)}return k.outline&&(c=k),Xs(w.focal,k.focal)||(r.focal??=[]).push({...w.floorId?{floorId:w.floorId}:{},point:{...k.focal}}),{unit:w,plane:k,stage:A,planeSeats:S}}),m=i.flatMap(y=>y.objects).map(y=>y.type==="shape"&&!y.role&&(Ws(y.label)==="wall"||!Ws(y.label)&&ff(y))?{...y,role:"wall"}:y),h=Mn({objects:m},n)!==null;h&&(r.indoor=!0);let f=new Set,d=Fv(s,h,Tv(n,u[0]?.plane.focal??t)<ev,f),p=new Map(s.filter(y=>!y.authored).map(y=>[y.id,y])),b=u.map(({unit:y,plane:g,stage:v,planeSeats:P})=>y.objects.map(w=>{let x=w.type==="shape"&&!w.role&&w.id!==v?.shape.id?Ws(w.label):null;if(w.type==="shape"&&!w.role&&w.id!==v?.shape.id&&(x==="wall"||!x&&ff(w))&&w.type==="shape"){(r.roles??=[]).push({id:w.id,...g.floorId?{floorId:g.floorId}:{},role:"wall"});let{fill:R,...C}=w;return{...C,role:"wall"}}if(x&&w.type==="shape")return(r.roles??=[]).push({id:w.id,...g.floorId?{floorId:g.floorId}:{},role:x}),{...w,role:x};let A=v?.inferred&&w.id===v.shape.id&&w.type==="shape"?vv(w,v.outline,y.objects,P):null;if(A&&w.type==="shape")return r.stage?.id===w.id&&(r.stage.field=A),{...w,role:"stage",stageKind:A};let M=w.type==="shape"&&w.id===v?.shape.id&&w.heightM===void 0&&!w.stageKind&&s.some(R=>R.plane===g&&(f.has(R.id)||R.level===0&&R.facesAction&&R.rake<=cv&&(R.frontDistance+R.backD-R.frontD)*Me>=lv)),E=M?{heightM:sv}:{};if(v?.inferred&&w.id===v.shape.id&&w.type==="shape"&&Rr(v.outline)*Me*Me<=js)return r.stage?.id===w.id&&(r.stage.deck=!0),{...w,role:"stage",...E};if(M&&w.type==="shape"&&w.role==="stage")return{...w,...E};let T=w.type==="section"?p.get(w.id):void 0;if(!T||w.type!=="section")return w;let k=T.rowCount>=2&&T.rake>0;l.has(T.id)?r.looseRowBlocks=(r.looseRowBlocks??0)+1:r.sections.push({id:T.id,floorId:g.floorId,surfaceKind:k?"rakedRows":"flat",height:T.height,rake:T.rake,stackedOn:d.get(T.id)});let _={status:"inferred",source:"public-2d-topology",note:Sv};return{...w,height:T.height,rake:T.rake,surfaceKind:k?"rakedRows":"flat",physical3dProvenance:{height:_,rake:_,surfaceKind:_}}}));if(e.floors?.length){let y=e.floors.map((g,v)=>({...g,objects:b[v],focalPoint:u[v].plane.focal}));return{doc:{...e,floors:y,objects:y[0].objects,focalPoint:y[0].focalPoint},report:r}}return{doc:{...e,objects:b[0],focalPoint:u[0].plane.focal},report:r}}var Sf=/^[\p{L}\p{N}]{1,4}$/u,Dv=/^([\p{L}\p{N}]{2,})[\s\-\u2013\u2014\u00b7_./]+(.+)$/u;function wf(e,t){let n=t?.trim();if(!n)return e;let o=e.toLocaleLowerCase("en-US"),r=n.toLocaleLowerCase("en-US");if(o.startsWith(`${r} `)){let a=e.slice(n.length).trim();if(Sf.test(a))return a}let i=Dv.exec(e);if(i){let a=i[1].toLocaleLowerCase("en-US"),s=i[2].trim();if((r.startsWith(a)||a.startsWith(r))&&Sf.test(s))return s}return e}var Pf={inline:"Inline booth \xB7 1 open side",corner:"Corner booth \xB7 2 open sides",peninsula:"Peninsula booth \xB7 3 open sides",island:"Island booth \xB7 4 open sides"},Nv=new Map(za.map(e=>[e.key,e.label]));function Bv(e){return`picker.access.${e}`}function Af(e){let t=[],n=e.boothType;n&&Object.prototype.hasOwnProperty.call(Pf,n)&&t.push({key:`booth:${n}`,icon:"booth",titleKey:`picker.boothType.${n}`,titleFallback:Pf[n],tone:"place"});let o=e.wheelchairSpaceType;for(let s of e.accessibility??[]){if(s==="wheelchair"&&o)continue;let c=Nv.get(s);c&&t.push({key:`access:${s}`,icon:s,titleKey:Bv(s),titleFallback:c,tone:"access"})}o==="no-seat"?t.push({key:"wheelchair:no-seat",icon:"wheelchair",titleKey:"picker.emptyWheelchairSpace",titleFallback:"Empty wheelchair space",tone:"access"}):o==="seat-present"&&t.push({key:"wheelchair:seat-present",icon:"wheelchair",titleKey:"picker.accessiblePhysicalSeat",titleFallback:"Accessible physical seat",tone:"access"}),e.aisle===!0&&t.push({key:"place:aisle",icon:"aisle",titleKey:"picker.aisleSeat",titleFallback:"Aisle seat",tone:"place"});let r=e.commercial;r?.restrictedView&&t.push({key:"mark:restrictedView",icon:"restrictedView",titleKey:"picker.restrictedView",titleFallback:"Restricted view",tone:"warn"}),r?.obstructedView&&t.push({key:"mark:obstructedView",icon:"obstructedView",titleKey:"picker.obstructedView",titleFallback:"Obstructed view",tone:"warn"}),r?.premium&&t.push({key:"mark:premium",icon:"premium",titleKey:"picker.premiumSeat",titleFallback:"Premium seat",tone:"premium"});let i=r?.note?.trim();if(i){let s=t.find(c=>c.tone==="warn"||c.tone==="premium");s?s.note=i:t.push({key:"note",icon:"note",titleKey:"picker.organizerNote",titleFallback:"Organizer note",tone:"note",note:i})}let a=typeof e.entrance=="string"?e.entrance.trim():"";return a&&t.push({key:"place:entrance",icon:"entrance",titleKey:"picker.entrance",titleFallback:"Entrance",tone:"place",note:a}),t}function Rf(e,t,n){return n<0?t>1?e.filter(o=>o.kind==="floor"):[...e]:e.filter(o=>o.floorIndex===void 0||o.floorIndex===n)}function Ef(e,t){let n=[...e].sort((r,i)=>r.screen.y-i.screen.y),o=[];for(let r of n){let i=o.find(a=>a.some(s=>Math.abs(s.screen.x-r.screen.x)<104&&Math.abs(s.screen.y-r.screen.y)<34));i?i.push(r):o.push([r])}return o.flatMap(r=>r.length<2?r:r.map((i,a)=>({...i,screen:{...i.screen,x:Math.max(54,Math.min(t-54,i.screen.x+(a-(r.length-1)/2)*104))}})))}var Hv=1.15,Gv=2.75,Vv=4.5,zv=.85,Uv=.5,Wv=.26;function If(e,t,n){let o=Math.max(1e-6,t),r=e/o,i=n?.hasZoneLabels??!0,a=new Set(["stage","gate"]);return r>=.75&&a.add("floor"),r>=Hv&&a.add("zone"),r<=(i?Gv:Vv)&&(a.add("section"),a.add("ga")),r<=zv&&(a.add("annotation"),a.add("booth")),r<=Uv&&a.add("row"),r<=Wv&&a.add("seat"),a}function _f(e,t,n,o,r,i=6){let a=i+t,s=o-i-t,c=i+n,l=r-i-n;return{...e,x:a>s?o/2:Math.max(a,Math.min(s,e.x)),y:c>l?r/2:Math.max(c,Math.min(l,e.y))}}function en(e,t,n,o){let r=e,i=t[0],a=t[1],s=t[2],c=r[0]*i+r[4]*a+r[8]*s+r[12],l=r[1]*i+r[5]*a+r[9]*s+r[13],u=r[2]*i+r[6]*a+r[10]*s+r[14],m=r[3]*i+r[7]*a+r[11]*s+r[15];if(!(m>1e-6))return{x:0,y:0,depth:1/0,visible:!1};let h=c/m,f=l/m,d=u/m,p=h>=-1.05&&h<=1.05&&f>=-1.05&&f<=1.05&&d<=1;return{x:(h*.5+.5)*n,y:(1-(f*.5+.5))*o,depth:d,visible:p}}function Cf(e,t,n=t,o=()=>0){let r=[],i=[...e].sort((a,s)=>o(s)-o(a)||a.screen.depth-s.screen.depth);for(let a of i){let s=!1;for(let c of r)if(Er(a,c,t,n)){s=!0;break}s||r.push(a)}return r}var jv=6;function Er(e,t,n,o){let r=Math.abs(e.screen.x-t.screen.x),i=Math.abs(e.screen.y-t.screen.y),a=e.halfWidth!=null&&t.halfWidth!=null?Math.max(n,e.halfWidth+t.halfWidth+jv):n;return r<a&&i<o}function Tf(e,t,n){return e.length*t*.58+(n?14:0)}var Xv={row:8,seat:14};function kf(e){return e<480?{row:5,seat:8}:e<768?{row:6,seat:10}:Xv}function Lf(e,t,n,o){let r=Math.max(1,Math.min(n,o)*.5),i=Math.min(2,Math.hypot(e.x-n/2,e.y-o/2)/r);return t*(1+1.5*i)}function Ir(e,t,n,o,r=[]){let i=[...e].sort((s,c)=>(c.priority??0)-(s.priority??0)||s.focus-c.focus),a=[];for(let s of i){if(a.length>=o)break;let c=!1;for(let l of r)if(Er(s,l,t,n)){c=!0;break}if(!c){for(let l of a)if(Er(s,l,t,n)){c=!0;break}}c||a.push(s)}return a}function Qs(e,t,n,o){let r=e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15];return r<=0||!(n>0)?0:n*Math.hypot(e[0],e[4],e[8])*o/(2*r)}var Kv=1.5,Yv=30,$v=4,Zv=3.6,qv=6,Js=15,Qv=3,Jv=1;function e2(e){return Math.max(Zv,Math.min(qv,2.4+.15*e))}var _r=Math.PI*2;function t2(e,t){let n=0,o=0;for(let m of e)n+=m.x,o+=m.y;let r=Math.atan2(o/e.length-t.y,n/e.length-t.x),i=e.map(m=>{let h=Math.atan2(m.y-t.y,m.x-t.x)-r;for(;h>Math.PI;)h-=_r;for(;h<-Math.PI;)h+=_r;return h+r}),a=i.map((m,h)=>h).sort((m,h)=>i[m]-i[h]),s=i[a[0]],c=i[a[a.length-1]];if(c-s>Math.PI)return null;let l=m=>Math.hypot(m.x-t.x,m.y-t.y),u=m=>{let h=e[m],f=(m+e.length-1)%e.length,d=(m+1)%e.length,p=Math.abs(i[f]-i[m])<=Math.abs(i[d]-i[m])?f:d,b=e[p];return l(h)<=l(b)?[h,b]:[b,h]};return{start:s,end:c,startEdge:u(a[0]),endEdge:u(a[a.length-1])}}function Of(e){return e.type==="shape"&&e.role==="wall"&&e.heightM===void 0}function ec(e,t,n=()=>!0){let o=[];for(let c of e){if(!Of(c)||!n(c))continue;let l=Pe(c);if(!l||l.length<3)continue;let u=t2(l,t);if(!u)return[];o.push(u)}if(o.length<2)return[];let r=e.flatMap(c=>{if(c.type!=="shape"||c.role!=="entrance"&&c.role!=="exit")return[];let l=Pe(c);if(!l?.length)return[];let u=0,m=0;for(let h of l)u+=h.x,m+=h.y;return[{x:u/l.length,y:m/l.length}]}),i=c=>(c%_r+_r)%_r;o.sort((c,l)=>i(c.start)-i(l.start));let a=c=>Math.hypot(c.x-t.x,c.y-t.y),s=[];for(let c=0;c<o.length;c++){let l=o[c],u=o[(c+1)%o.length],m=i(u.start-l.end);if(m<=0||m>=Math.PI/2)continue;let h=x=>i(x-l.end)<m;if(o.some(x=>x!==l&&x!==u&&(h(x.start)||h(x.end)||i(l.end-x.start)<x.end-x.start)))continue;let[d,p]=l.endEdge,[b,y]=u.startEdge,g={x:(d.x+p.x)/2,y:(d.y+p.y)/2},v={x:(b.x+y.x)/2,y:(b.y+y.y)/2},P=Math.hypot(v.x-g.x,v.y-g.y)*I;if(P<Kv||P>Yv||Math.abs(a(g)-a(v))*I>$v+.2*P)continue;let w={x:(g.x+v.x)/2,y:(g.y+v.y)/2};r.some(x=>h(Math.atan2(x.y-t.y,x.x-t.x))&&Math.abs(a(x)-a(w))*I<=Qv)||s.push({quad:[d,p,y,b],mid:w,widthM:P,openingM:e2(P)})}return s}function Ff(e,t){let n=[];for(let i of t)if(i.text?.trim())for(let a of e){let s=Math.hypot(i.position.x-a.mid.x,i.position.y-a.mid.y)*I;s<=Js&&n.push({text:i,gate:a,d:s})}n.sort((i,a)=>i.d-a.d);let o=new Map,r=new Set;for(let{text:i,gate:a}of n)o.has(i.id)||r.has(a)||(o.set(i.id,a),r.add(a));return o}function Df(e,t,n,o,r,i,a,s=()=>!0){let c=ec(t,Co(n),s);if(!c.length)return;let l=t.find(m=>Of(m)&&s(m)),u=zi(l?.fill,a);e.setMaterial(Fi);for(let m of c)r-m.openingM<Jv||Ni(e,m.quad,o+m.openingM,o+r,[],u.top,u.wall,i,r);e.setMaterial(0)}var n2=6,o2=2.2,qi=.1,r2=/^(gate|entrance|entry|exit|way in|way out|door)s?$/i,i2=new Set(["stage","entrance","exit","screen","suite","obstruction","sound","bar","concession","restroom","coat"]),a2=.3,s2=1.8,c2=.9,l2=.55,u2=1,Nf=4e3,m2=6,Bf="#d8a425",h2="#e8c15a",tc="#1c1608";function Hf(e){let t=f2(e);if(!t)return null;let n=Af(e).find(o=>o.icon===t.icon);return{...t,name:n?.titleFallback??t.icon}}function f2(e){let t=e.accessibility;if(t?.length)return{icon:t.includes("wheelchair")?"wheelchair":t[0],color:si(t)};let n=e.commercial;return n?.obstructedView?{icon:"obstructedView",color:Bf,ink:tc}:n?.restrictedView?{icon:"restrictedView",color:Bf,ink:tc}:n?.premium?{icon:"premium",color:h2,ink:tc}:null}function d2(e,t){if(!e)return;let n,o=0;for(let[i,a]of e)a>o&&(o=a,n=i);let r=t.categories?.find(i=>i.key===n)?.color;return r&&/^#[0-9a-f]{6}$/i.test(r)?r:void 0}var p2=6e3,b2=.25,Gf=[-90,90,-135,135,-45,45];function g2(e,t,n,o){let r=e.flatMap(({id:a,a:s,members:c})=>{let l=(s.minX+s.maxX)/2,u=(s.minY+s.maxY)/2,m=.5*Math.hypot(s.maxX-s.minX,s.maxY-s.minY),h=1/0;for(let f of c)h=Math.min(h,Math.hypot(t[f].x-l,t[f].y-u));return c.length&&h>=m*b2?[{id:a,cx:l,cy:u,half:m,members:c}]:[]}).sort((a,s)=>a.half-s.half),i=new Map;return r.forEach(({id:a,cx:s,cy:c,members:l},u)=>{let m=o.x-s,h=o.y-c,p=(Math.hypot(m,h)>1e-6?Math.atan2(h,m):0)+Gf[u%Gf.length]*Math.PI/180,b=Math.cos(p),y=Math.sin(p),g=-1,v=-1/0;for(let P of l){let w=(t[P].x-s)*b+(t[P].y-c)*y;w>v&&(v=w,g=P)}i.set(a,[t[g].x*I,n.seatDeckY(g),t[g].y*I])}),i}function zf(e){let{doc:t,units:n,seats:o,surfaces:r,focal:i}=e,a=t.zones??[],s=[];if(a.length){let c=new Map;for(let h of n)for(let f of h.objects)f.type==="section"&&f.zone&&c.set(f.id,f.zone);let l=new Map,u=new Map;for(let h=0;h<o.length;h++){let f=o[h],d=r.seatOwner[h],p=f.zoneId??(d?c.get(d):void 0);if(!p)continue;let b=l.get(p);b||(b={n:0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0,sumY:0},l.set(p,b));let y=u.get(p);y||u.set(p,y=[]),y.push(h),b.n++,f.x<b.minX&&(b.minX=f.x),f.y<b.minY&&(b.minY=f.y),f.x>b.maxX&&(b.maxX=f.x),f.y>b.maxY&&(b.maxY=f.y),b.sumY+=r.seatDeckY(h)}let m=g2(a.flatMap(h=>{let f=l.get(h.id);return f?[{id:h.id,a:f,members:u.get(h.id)??[]}]:[]}),o,r,i);for(let h of a){let f=l.get(h.id),d=[];for(let[p,b]of c)b===h.id&&d.push(p);if(!f||f.n===0){s.push({id:h.id,label:h.label,color:Ie(h.color),sectionIds:d,seatCount:0,center:[0,0,0],radius:0,focalWorld:[(h.focalPoint??i).x*I,1.5,(h.focalPoint??i).y*I]});continue}s.push({id:h.id,label:h.label,color:Ie(h.color),sectionIds:d,seatCount:f.n,...m.has(h.id)?{labelAt:m.get(h.id)}:{},center:[(f.minX+f.maxX)/2*I,f.sumY/f.n,(f.minY+f.maxY)/2*I],radius:.5*Math.hypot((f.maxX-f.minX)*I,(f.maxY-f.minY)*I)||1,focalWorld:[(h.focalPoint??i).x*I,1.5,(h.focalPoint??i).y*I]})}}return s}function Uf(e){let{doc:t,units:n,seats:o,surfaces:r,seatData:i,hintedSeatFloor:a,zones:s,focal:c}=e,l=[],u=[],m=[],h=new Map;for(let d of n)for(let p of d.objects){if(p.type!=="section"||!p.zone)continue;let b=(p.displayLabel||p.label||"").trim().toLocaleLowerCase();if(!b)continue;let y=t.floors?.[d.index]?.name?.trim().toLocaleLowerCase();if(n.length>1&&y===b)continue;let g=h.get(p.zone);g||h.set(p.zone,g=new Set),g.add(b)}for(let d of s)d.seatCount!==0&&(h.get(d.id)?.has(d.label.trim().toLocaleLowerCase())||l.push({id:`zone:${d.id}`,kind:"zone",text:d.label,anchor:[(d.labelAt??d.center)[0],(d.labelAt??d.center)[1]+n2,(d.labelAt??d.center)[2]],color:t.zones?.find(p=>p.id===d.id)?.color}));{let d=new Map,p=new Map,b=new Map,y=new Map;for(let g=0;g<o.length;g++){let v=r.seatOwner[g];if(!v)continue;let P=d.get(v);P||(P={n:0,x:0,y:0,deck:0},d.set(v,P)),P.n++,P.x+=o[g].x,P.y+=o[g].y,P.deck+=r.seatDeckY(g);let w=o[g].categoryKey;if(w){let S=p.get(v);S||(S=new Map,p.set(v,S)),S.set(w,(S.get(w)??0)+1)}if(o[g].accessibility?.includes("wheelchair")){let S=b.get(v);S?S.push(g):b.set(v,[g])}let x=y.get(v);x||(x={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0,minDeck:1/0,maxDeck:-1/0},y.set(v,x)),x.minDeck=Math.min(x.minDeck,r.seatDeckY(g)),x.maxDeck=Math.max(x.maxDeck,r.seatDeckY(g)),o[g].x<x.minX&&(x.minX=o[g].x),o[g].x>x.maxX&&(x.maxX=o[g].x),o[g].y<x.minY&&(x.minY=o[g].y),o[g].y>x.maxY&&(x.maxY=o[g].y)}for(let g of n)for(let v of g.objects){if(v.type!=="section"||bf(v))continue;let P=d.get(v.id);if(!P||P.n===0)continue;let w=y.get(v.id),x=[P.x/P.n*I,P.deck/P.n,P.y/P.n*I],S=v.displayLabel||v.label||v.id;u.push({id:v.id,floorIndex:g.index,label:S,seatCount:P.n,center:x,radius:Math.max(1,Math.hypot(w.maxX-w.minX,w.maxY-w.minY)*.5*I),box:{min:[w.minX*I-.4,w.minDeck,w.minY*I-.4],max:[w.maxX*I+.4,w.maxDeck+1,w.maxY*I+.4]},focalWorld:[g.focal.x*I,g.baseHeightM+1.5,g.focal.y*I]});let A=t.floors?.[g.index]?.name?.trim().toLocaleLowerCase();if(!(n.length>1&&A===S.trim().toLocaleLowerCase())){let M=d2(p.get(v.id),t),E=b.get(v.id);l.push({id:`section:${v.id}`,kind:"section",text:S,anchor:[x[0],x[1]+o2,x[2]],floorIndex:g.index,...M?{tint:M}:{},...E?{wheelchairSeats:E}:{}})}}}{for(let x of n)for(let S of x.objects){if(S.type!=="gaArea")continue;let A=so(S.points);if(!A)continue;let M=S.labelPresentation?.visible===!1?"":S.displayLabel||S.label||S.id,E=S.capacity>0?[M,S.capacity.toLocaleString()].filter(Boolean).join(" \xB7 "):M;E&&l.push({id:`ga:${S.id}`,kind:"ga",text:E,areaName:M,anchor:[A.x*I,x.baseHeightM+s2,A.y*I],floorIndex:x.index})}let d=new Map,p=new Map;for(let x of n)for(let S of x.objects)if(S.type==="section"&&d.set(S.id,S.displayLabel||S.label||S.id),S.type==="row"){let A=S.displayLabel?.trim()||S.segmentedRow?.displayLabel?.trim();A&&p.set(S.id,A)}let b=new Map;for(let x=0;x<o.length;x++){let S=o[x],A=Math.hypot(S.x-c.x,S.y-c.y),M=b.get(S.rowId);(!M||A>M.far)&&b.set(S.rowId,{seat:S,index:x,far:A})}for(let[x,S]of b){let A=r.seatOwner[S.index]??S.seat.sectionId,M=Vf(S.seat.label,x,d.get(A??""),p.get(x));M&&l.push({id:`row:${x}`,kind:"row",text:M,anchor:[S.seat.x*I,r.seatDeckY(S.index)+c2,S.seat.y*I],floorIndex:a[S.index]})}let y=new Map;for(let x=0;x<o.length;x++){let S=o[x],A=y.get(S.rowId);A||(A={n:0,x:0,y:0,z:0,minX:1/0,maxX:-1/0,minZ:1/0,maxZ:-1/0,label:Vf(S.label,S.rowId,d.get(r.seatOwner[x]??S.sectionId??""),p.get(S.rowId)),sectionId:r.seatOwner[x]??S.sectionId},y.set(S.rowId,A));let M=x*3,E=i.iPosition[M],T=i.iPosition[M+1],k=i.iPosition[M+2];A.n++,A.x+=E,A.y+=T,A.z+=k,A.minX=Math.min(A.minX,E),A.maxX=Math.max(A.maxX,E),A.minZ=Math.min(A.minZ,k),A.maxZ=Math.max(A.maxZ,k)}for(let[x,S]of y)m.push({id:x,label:S.label,sectionId:S.sectionId,seatCount:S.n,center:[S.x/S.n,S.y/S.n,S.z/S.n],radius:Math.max(.8,Math.hypot(S.maxX-S.minX,S.maxZ-S.minZ)*.5)});let g=0,v=(x,S)=>{g++,l.push({id:`access:${o[x].id}`,kind:"access",text:S.name,icon:S.icon,color:S.color,...S.ink?{ink:S.ink}:{},seatWidthM:i.iChairWidth[x]*2,anchor:[o[x].x*I,r.seatDeckY(x)+u2,o[x].y*I],floorIndex:a[x],rowId:o[x].rowId})},P=null,w=()=>{if(P){let x=Hf(o[P.seats[0]]),S=P.seats.length,A=Math.max(1,Math.round(S/m2));for(let M=0;M<A&&g<Nf;M++)v(P.seats[Math.min(S-1,Math.floor((M+.5)*S/A))],x)}P=null};for(let x=0;x<o.length&&g<Nf;x++){let S=Hf(o[x]);if(S&&o[x].accessibility?.length){w(),v(x,S);continue}if(!S){w();continue}P&&P.rowId===o[x].rowId&&P.icon===S.icon?P.seats.push(x):(w(),P={rowId:o[x].rowId,icon:S.icon,seats:[x]})}if(w(),o.length<=p2)for(let x=0;x<o.length;x++){let S=o[x],A=nc(S.displayLabel||S.label);A&&l.push({id:`seat:${S.id}`,kind:"seat",seatWidthM:i.iChairWidth[x]*2,text:A,anchor:[S.x*I,r.seatDeckY(x)+l2,S.y*I],floorIndex:a[x],rowId:S.rowId})}}let f=Ci(n);for(let d of n){let p=Mn(d,n.length===1?o:o.filter((g,v)=>a[v]===d.index)),b=p?Ff(ec(d.objects,Co(p)),d.objects.filter(g=>g.type==="text")):new Map,y=[...b.values()];for(let g of d.objects){let v=g.type==="text"?b.get(g.id):void 0;if(g.type==="shape"&&(g.role==="entrance"||g.role==="exit")&&r2.test(g.label?.trim()??"")){let P=Pe(g),w=P?so(P):null;if(w&&y.some(x=>Math.hypot(w.x-x.mid.x,w.y-x.mid.y)*I<=Js+x.widthM))continue}if(v&&g.type==="text")l.push({id:`text:${g.id}`,kind:"gate",text:g.text,icon:"entrance",anchor:[v.mid.x*I,d.baseHeightM+v.openingM+qi,v.mid.y*I],color:g.color,floorIndex:d.index});else if(g.type==="shape"&&g.role&&i2.has(g.role)){if(f.has(g))continue;let P=Pe(g),w=P?so(P):null;if(!w||!g.label||g.gate?.hideFromBuyers)continue;l.push({id:`architecture:${g.id}`,kind:g.role==="stage"?"stage":g.role==="entrance"||g.role==="exit"?"gate":"annotation",text:g.label,...g.role==="entrance"||g.role==="exit"?{icon:g.role}:{},...g.gate?.stepFree?{stepFree:!0}:{},anchor:[w.x*I,d.baseHeightM+Gt(g).heightM+qi,w.y*I],color:g.fill,floorIndex:d.index})}else if(g.type==="text"){let P=g.semanticKind==="icon"?xr(g.iconKey)?.key:void 0,w=g.text||(P?xr(P).label:"");if(!w)continue;l.push({id:`text:${g.id}`,kind:"annotation",text:w,...P?{venueIcon:P}:{},anchor:P?[(g.position.x+g.fontSize/2)*I,d.baseHeightM+qi,(g.position.y+g.fontSize/2)*I]:[g.position.x*I,d.baseHeightM+qi,g.position.y*I],color:g.color,rotation:g.rotation,floorIndex:d.index})}else if(g.type==="booth"){if(g.labelPresentation?.visible===!1)continue;let P=_t(g);if(!P)continue;let w=so(P);if(!w)continue;l.push({id:`booth:${g.id}`,kind:"booth",text:g.displayLabel||g.label||g.id,anchor:[w.x*I,d.baseHeightM+Lo+a2,w.y*I],floorIndex:d.index})}}}return{labels:l,sections:u,rows:m}}function Wf(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 nc(e){let t=e.lastIndexOf("-");return t>=0&&t<e.length-1?e.slice(t+1):e}function Vf(e,t,n,o){if(o?.trim())return o.trim();let r=e?e.lastIndexOf("-"):-1,i=r>0?e.slice(0,r):t;return i&&wf(i,n)}function jf(e){let{doc:t,units:n,seats:o,surfaces:r,solids:i,hintedSeatFloor:a,seatFloor:s}=e,c=[];{let l=n.map(()=>({minX:1/0,minY:1/0,minZ:1/0,maxX:-1/0,maxY:-1/0,maxZ:-1/0}));for(let h=0;h<i.floor.length;h+=1){let f=Math.max(0,Math.min(n.length-1,Math.round(i.floor[h]))),d=h*3,p=l[f];p.minX=Math.min(p.minX,i.position[d]),p.minY=Math.min(p.minY,i.position[d+1]),p.minZ=Math.min(p.minZ,i.position[d+2]),p.maxX=Math.max(p.maxX,i.position[d]),p.maxY=Math.max(p.maxY,i.position[d+1]),p.maxZ=Math.max(p.maxZ,i.position[d+2])}let u=new Map;for(let h=0;h<n.length;h++)for(let f of n[h].objects)f.type==="section"&&u.set(f.id,h);let m=n.map(()=>({n:0,minX:1/0,minY:1/0,minDeck:1/0,maxX:-1/0,maxY:-1/0,maxDeck:-1/0,sumX:0,sumDeck:0,sumZ:0}));for(let h=0;h<o.length;h++){let f=r.seatOwner[h],d=(f!==null?u.get(f):void 0)??a[h];if(d===void 0)continue;let p=m[d],b=o[h];p.n++,b.x<p.minX&&(p.minX=b.x),b.y<p.minY&&(p.minY=b.y),b.x>p.maxX&&(p.maxX=b.x),b.y>p.maxY&&(p.maxY=b.y);let y=r.seatDeckY(h);p.sumX+=b.x*I,p.sumDeck+=y,p.sumZ+=b.y*I,p.minDeck=Math.min(p.minDeck,y),p.maxDeck=Math.max(p.maxDeck,y+1.6),s[h]=d}for(let h=0;h<n.length;h++){let f=m[h],d=t.floors?.[h],p=l[h],b=Math.min(f.n?f.minX*I:n[h].focal.x*I-1,Number.isFinite(p.minX)?p.minX:1/0),y=Math.max(f.n?f.maxX*I:n[h].focal.x*I+1,Number.isFinite(p.maxX)?p.maxX:-1/0),g=Math.min(f.n?f.minY*I:n[h].focal.y*I-1,Number.isFinite(p.minZ)?p.minZ:1/0),v=Math.max(f.n?f.maxY*I:n[h].focal.y*I+1,Number.isFinite(p.maxZ)?p.maxZ:-1/0),P=Math.min(f.n?Math.min(n[h].baseHeightM,f.minDeck):n[h].baseHeightM,Number.isFinite(p.minY)?p.minY:1/0),w=Math.max(f.n?Math.max(f.maxDeck,P+.5):P+.5,Number.isFinite(p.maxY)?p.maxY:-1/0),x=[f.n?f.sumX/f.n:(b+y)/2,f.n?f.sumDeck/f.n:(P+w)/2,f.n?f.sumZ/f.n:(g+v)/2],S=Math.max(1,.5*Math.hypot(y-b,w-P,v-g));c.push({index:h,id:d?.id??`floor-${h}`,label:d?.name??(n.length>1?`Floor ${h+1}`:"Venue"),seatCount:f.n,center:x,radius:S,box:{min:[b,P,g],max:[y,w,v]},focalWorld:[n[h].focal.x*I,n[h].baseHeightM+1.5,n[h].focal.y*I]})}}return c}function ac(e,t){let n=1/0,o=1/0,r=-1/0,i=-1/0,a=(s,c)=>{s<n&&(n=s),c<o&&(o=c),s>r&&(r=s),c>i&&(i=c)};for(let s of t)a(s.x,s.y);for(let s of e)for(let c of s.objects)if(c.type==="section")for(let l of c.outline)a(l.x,l.y);else if(c.type==="shape"&&c.points)for(let l of c.points)a(l.x,l.y);else if(c.type==="gaArea")for(let l of c.points)a(l.x,l.y);else if(c.type==="booth"){let l=_t(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="table"){let l=Ui(c);if(l)for(let u of l)a(u.x,u.y)}else if(c.type==="decorImage"){let l=Wi(c);if(l)for(let u of l)a(u.x,u.y)}return Number.isFinite(n)||(n=-100,o=-100,r=100,i=100),{minX:n,minY:o,maxX:r,maxY:i}}function Qf(e,t,n,o,r,i){if(t.length===1){let a=n.map(m=>({x:m.x,y:m.y}));for(let m of t[0].objects)m.type==="section"?a.push(...m.outline):m.type==="shape"?a.push(...Pe(m)??m.points??[]):m.type==="gaArea"?a.push(...m.points):m.type==="booth"?a.push(..._t(m)??[]):m.type==="table"?a.push(...Ui(m)??[]):m.type==="decorImage"&&a.push(...Wi(m)??[]);if($f(e,t[0],n,i)||qf(e,t[0],n,a,i))return!1;if(Yf(e,t[0].baseHeightM,a,i))return!0;let s=Mr(a),c=(r.minX+r.maxX)/2,l=(r.minY+r.maxY)/2,u=s.length>=3?s.map(m=>{let h=m.x-c,f=m.y-l,d=Math.max(1,Math.hypot(h,f));return{x:m.x+h/d*80,y:m.y+f/d*80}}):tr(r.minX-28,r.minY-28,r.maxX-r.minX+56,r.maxY-r.minY+56);return ue(e,u,void 0,()=>-.04,-.22,i.ground,i.ground,se),!1}else{let a=t.reduce((p,b)=>b.baseHeightM<p.baseHeightM?b:p);e.setFloor(er);let s={...a,objects:t.flatMap(p=>p.objects)},c=n.map(p=>({x:p.x,y:p.y}));for(let p of s.objects)p.type==="section"&&c.push(...p.outline);if($f(e,s,n,i)||qf(e,s,n,c,i))return!1;if(Yf(e,a.baseHeightM,c,i))return!0;let l=n.filter((p,b)=>o[b]===a.index),u=ac([a],l),m=Math.hypot(u.maxX-u.minX,u.maxY-u.minY),h=Math.max(28,Math.min(80,m*.04)),f=tr(u.minX-h,u.minY-h,u.maxX-u.minX+h*2,u.maxY-u.minY+h*2),d=a.baseHeightM-.03;return ue(e,f,void 0,()=>d,d-.22,i.ground,i.ground,se),!1}}function sc(e,t,n,o){let{cx:r,cz:i,radius:a}=n,s=1/0,c=1/0,l=1/0,u=-1/0,m=-1/0,h=-1/0,f=(b,y,g)=>{s=Math.min(s,b),u=Math.max(u,b),c=Math.min(c,y),m=Math.max(m,y),l=Math.min(l,g),h=Math.max(h,g)};for(let b=0;b<e.position.length;b+=3){let y=b/3;o&&y>=o[0]&&y<o[1]||f(e.position[b],e.position[b+1],e.position[b+2])}for(let b=0;b<t.count;b++){let y=b*3,g=t.iPosition[y],v=t.iPosition[y+1],P=t.iPosition[y+2],w=Math.max(.35,t.iMaxRadius[b]??.35);f(g-w,v,P-w),f(g+w,v+1.6,P+w)}Number.isFinite(s)||(s=r-a,u=r+a,c=0,m=a*.16,l=i-a,h=i+a);let d=[(s+u)/2,(c+m)/2,(l+h)/2],p=Math.max(1,.5*Math.hypot(u-s,m-c,h-l));return{center:d,radius:p,minY:c,maxY:m}}var y2=4096;function Jf(e,t,n=[]){let o=Math.max(1,Math.ceil(e.count/y2)),r=Math.ceil(e.count/o),i=new Float32Array((r*2+t.length*4+n.length)*3),a=0;for(let s=0;s<e.count;s+=o){let c=e.iPosition[s*3],l=e.iPosition[s*3+1],u=e.iPosition[s*3+2];i[a++]=c,i[a++]=l,i[a++]=u,i[a++]=c,i[a++]=0,i[a++]=u}for(let[s,c,l]of n)i[a++]=s,i[a++]=c,i[a++]=l;for(let s of t)for(let[c,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])i[a++]=s.cx+c*s.halfX,i[a++]=s.y,i[a++]=s.cz+l*s.halfZ;return i.subarray(0,a)}function ed(e,t,n,o,r,i,a=[]){let s=1/0,c=1/0,l=-1/0,u=-1/0;for(let w=0;w<e.count;w++){let x=w*3,S=e.iPosition[x],A=e.iPosition[x+2];S<s&&(s=S),S>l&&(l=S),A<c&&(c=A),A>u&&(u=A)}for(let[w,,x]of a)w<s&&(s=w),w>l&&(l=w),x<c&&(c=x),x>u&&(u=x);for(let w of t)s=Math.min(s,w.cx-w.halfX),l=Math.max(l,w.cx+w.halfX),c=Math.min(c,w.cz-w.halfZ),u=Math.max(u,w.cz+w.halfZ);let m=n.minX*I,h=n.maxX*I,f=n.minY*I,d=n.maxY*I,p=m,b=h,y=f,g=d;if(Number.isFinite(s)){let w=Math.max(2,.06*Math.hypot(l-s,u-c));p=Math.max(m,s-w),b=Math.min(h,l+w),y=Math.max(f,c-w),g=Math.min(d,u+w)}let v=Math.min(0,o),P=Math.max(r,i*.05);return{min:[p,v,y],max:[b,P,g]}}var oc=12,x2=.5,M2=6,rc=.8,Xf=5,v2=.6,S2=40,ic=0,Kf=8;function Yf(e,t,n,o){let r=Mr([...n]);if(r.length<3)return!1;let i=1/0,a=1/0,s=-1/0,c=-1/0;for(let w of r)i=Math.min(i,w.x),s=Math.max(s,w.x),a=Math.min(a,w.y),c=Math.max(c,w.y);let l=Math.hypot(s-i,c-a)*I,u=Math.max(S2,l*v2),m=w=>Zt(r,w/I,1.2),h=m(x2),f=[h,m(M2),m(oc),m(oc+Xf),m(oc+Xf+u)];if(f.some(w=>w.length!==h.length))return!1;let d=we(o.ground,[.78,.76,.72],.35),p=we(o.ground,[.56,.62,.52],.3),b=[d[0]*rc,d[1]*rc,d[2]*rc],y=t-.04;e.setMaterial(ic),ue(e,h,void 0,()=>y,t-.22,b,b,se);let g=[0,1,0],v=(w,x,S,A,M)=>{let E=w.map(R=>[R.x*I,y,R.y*I]),T=x.map(R=>[R.x*I,y,R.y*I]),[k,_]=M;for(let R=0;R<E.length;R++){let C=(R+1)%E.length;e.tri(E[R],T[C],T[R],g,S,A,A,[k,_,_]),e.tri(E[R],E[C],T[C],g,S,S,A,[k,k,_])}},P=[ic,ic];return v(f[0],f[1],b,d,P),v(f[1],f[2],d,d,P),v(f[2],f[3],d,p,P),v(f[3],f[4],p,p,[Kf,Kf+1]),e.setMaterial(0),!0}function $f(e,t,n,o){let r=Mn(t,n);if(!r)return!1;let i=t.baseHeightM,a=we(o.ground,[.62,.55,.47],.4);return ue(e,r,void 0,()=>i-.04,i-.22,a,a,se),!0}var w2=3e3,P2=20,Zf=1.5,A2=1.2,R2=.25;function qf(e,t,n,o,r){if(!n.length||n.length>w2||o.length<3)return!1;for(let M of t.objects){if(M.type==="shape"&&co(M.stageKind))return!1;if(M.type==="section"){let{height:E}=bn(M,{floorBaseHeightM:t.baseHeightM});if(E-t.baseHeightM>P2)return!1}}let i=0,a=0;for(let M of o)i+=M.x,a+=M.y;i/=o.length,a/=o.length;let s=0,c=0,l=0;for(let M of o){let E=M.x-i,T=M.y-a;s+=E*E,c+=T*T,l+=E*T}let u=.5*Math.atan2(2*l,s-c),m=Math.cos(u),h=Math.sin(u),f=-h,d=m,p=1/0,b=-1/0,y=1/0,g=-1/0;for(let M of o){let E=(M.x-i)*m+(M.y-a)*h,T=(M.x-i)*f+(M.y-a)*d;p=Math.min(p,E),b=Math.max(b,E),y=Math.min(y,T),g=Math.max(g,T)}let v=M=>[[p-M,y-M],[b+M,y-M],[b+M,g+M],[p-M,g+M]].map(([E,T])=>({x:i+m*E+f*T,y:a+h*E+d*T})),P=v(Zf/I),w=v((Zf+R2)/I),x=t.baseHeightM,S=we(r.ground,[.62,.55,.47],.4),A=we(r.ground,[.86,.86,.84],.55);return ue(e,w,void 0,()=>x-.04,x-.22,S,S,se),ue(e,w,[P.slice().reverse()],()=>x+A2,x-.04,we(A,[1,1,1],.2),A,se),!0}function td(e,t,n){let o=()=>({byObjectId:new Map,elements:[]});if(!t||!e)return o();let r=Lu(t);if(!r.ok||r.value.id!==e)return o();let i=new Map;for(let m of n)for(let h of m.objects)h.type==="shape"&&i.set(h.id,{shape:h,unit:m});let a=new Set,s=new Set,c=new Map((t.overlay.productionElements??[]).map(m=>{let h=m.runtimeContentImageUrl;return[m.id,typeof h=="string"&&/^(?:blob:|data:image\/|https:\/\/)/.test(h)?h:void 0]})),l=[];for(let m of r.value.overlay.productionElements??[]){let h=i.get(m.objectId),f=h?Pe(h.shape):null,d=m.baseElevationM??0;if(!h||!f||f.length<3||!m.id||a.has(m.id)||s.has(m.objectId)||!Number.isFinite(m.heightM)||m.heightM<.05||m.heightM>50||!Number.isFinite(d)||d<-10||d>100)return o();a.add(m.id),s.add(m.objectId);let p=f.map(A=>A.x*I),b=f.map(A=>A.y*I),y=h.unit.baseHeightM+d,g=Math.min(...p),v=Math.max(...p),P=Math.min(...b),w=Math.max(...b),x,S=c.get(m.id)??m.contentImageUrl;if(m.kind==="screen"&&S&&(x=Mh(f,y,y+m.heightM,h.unit.focal),!x))if(v-g>=w-P){let A=Math.abs(P-h.unit.focal.y*I)<=Math.abs(w-h.unit.focal.y*I)?P-.006:w+.006;x=[[g,y,A],[v,y,A],[g,y+m.heightM,A],[v,y+m.heightM,A]]}else{let A=Math.abs(g-h.unit.focal.x*I)<=Math.abs(v-h.unit.focal.x*I)?g-.006:v+.006;x=[[A,y,P],[A,y,w],[A,y+m.heightM,P],[A,y+m.heightM,w]]}l.push({id:m.id,objectId:m.objectId,kind:m.kind,floorIndex:h.unit.index,baseY:y,topY:y+m.heightM,bounds:{min:[g,y,P],max:[v,y+m.heightM,w]},occlusion:m.occlusion,...S?{contentImageUrl:S}:{},...x?{contentPlane:x}:{}})}let u=l.sort((m,h)=>m.id.localeCompare(h.id));return{byObjectId:new Map(u.map(m=>[m.objectId,m])),elements:u}}var E2=[1,.87,.64],I2=[1,.96,.84],nd=[.98,.66,.28],tn={poolEdge:{stage:.88,ring:.74},poolStrength:.6,poolLift:{stage:.02,ring:.006},lamps:{stage:8,ring:4},lampOut:.7,lampHeightM:[6,12],lampRadiusM:[.16,.28],minSpanM:3};function _2(e,t){let n=e.stageKind;if(n==="ring-boxing")return"ring";if(Et(n)||!t.length)return null;if(n==="round")return"stage";let o=Pe(e);return!o||o.length<3?null:Mo(od(o),t)?"stage":null}function C2(e,t,n,o){let r=1/0;for(let i=0;i<e.length;i++){let a=e[i],s=e[(i+1)%e.length],c=s.x-a.x,l=s.y-a.y,u=n*l-o*c;if(Math.abs(u)<1e-12)continue;let m=((a.x-t.x)*l-(a.y-t.y)*c)/u,h=((a.x-t.x)*o-(a.y-t.y)*n)/u;m>1e-9&&h>=-1e-9&&h<=1+1e-9&&(r=Math.min(r,m))}return Number.isFinite(r)?r:0}function od(e){return{x:e.reduce((t,n)=>t+n.x,0)/e.length,y:e.reduce((t,n)=>t+n.y,0)/e.length}}function rd(e,t,n,o,r={}){if(!r.night||!r.deck)return!1;let i=_2(t,o);if(!i)return!1;let a=Pe(t);if(!a||a.length<3)return!1;let s=od(a);if(!Ye(a,s.x,s.y))return!1;let c=28,l=[];for(let M=0;M<c;M++){let E=2*Math.PI*M/c;l.push(C2(a,s,Math.cos(E),Math.sin(E))*tn.poolEdge[i])}if(l.some(M=>!(M>0)))return!1;let u=Math.min(...l)*I;if(u*2<tn.minSpanM*tn.poolEdge[i])return!1;let m=r.deck,h=n+tn.poolLift[i],f=[0,1,0],d=(M,E)=>{let T=2*Math.PI*(M%c)/c,k=l[M%c]*E;return[(s.x+Math.cos(T)*k)*I,h,(s.y+Math.sin(T)*k)*I]},p=[s.x*I,h,s.y*I],b=M=>we(m,E2,tn.poolStrength*M),y=[{r:.4,k:.72},{r:.72,k:.28},{r:1,k:0}];e.setMaterial(0);for(let M=0;M<c;M++){e.tri(p,d(M+1,y[0].r),d(M,y[0].r),f,b(1),b(y[0].k),b(y[0].k));for(let E=0;E+1<y.length;E++){let T=y[E],k=y[E+1];e.tri(d(M,T.r),d(M+1,k.r),d(M,k.r),f,b(T.k),b(k.k),b(k.k)),e.tri(d(M,T.r),d(M+1,T.r),d(M+1,k.r),f,b(T.k),b(T.k),b(k.k))}}let[g,v]=tn.lampHeightM,P=n+Math.max(g,Math.min(v,u*1.6)),w=Math.max(tn.lampRadiusM[0],Math.min(tn.lampRadiusM[1],u*.05)),x=[0,-1,0],S=tn.lamps[i],A=10;e.setMaterial(xo);for(let M=0;M<S;M++){let E=2*Math.PI*(M+.5)/S,T=u*tn.lampOut,k=s.x*I+Math.cos(E)*T,_=s.y*I+Math.sin(E)*T;for(let R=0;R<A;R++){let C=2*Math.PI*R/A,O=2*Math.PI*(R+1)/A;e.tri([k,P,_],[k+Math.cos(C)*w,P,_+Math.sin(C)*w],[k+Math.cos(O)*w,P,_+Math.sin(O)*w],x,I2,nd,nd)}}return e.setMaterial(0),!0}function T2(e){let t=Math.min(1,Math.max(0,e));return t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055}function pt(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function vt(e){return Array.isArray(e)?e:[]}function k2(e){let t=[e];for(;t.length;){let n=t.pop();if(Array.isArray(n)){t.push(...n);continue}if(!pt(n))continue;let o=pt(n.extensions)?n.extensions:null;if(o&&Object.prototype.hasOwnProperty.call(o,"KHR_draco_mesh_compression"))return!0;t.push(...Object.values(n))}return!1}function Cr(e,t){return!Array.isArray(e)||e.length!==t||!e.every(n=>typeof n=="number"&&Number.isFinite(n))?null:e}function L2(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function O2(e,t){let n=new Array(16).fill(0);for(let o=0;o<4;o++)for(let r=0;r<4;r++)for(let i=0;i<4;i++)n[o*4+r]+=e[i*4+r]*t[o*4+i];return n}function F2(e){let t=Cr(e.matrix,16);if(t)return t;if(e.matrix!==void 0)return null;let n=e.translation===void 0?[0,0,0]:Cr(e.translation,3),o=e.rotation===void 0?[0,0,0,1]:Cr(e.rotation,4),r=e.scale===void 0?[1,1,1]:Cr(e.scale,3);if(!n||!o||!r)return null;let[i,a,s,c]=o,l=Math.hypot(i,a,s,c);if(!(l>1e-8))return null;let u=i/l,m=a/l,h=s/l,f=c/l,d=u+u,p=m+m,b=h+h,y=u*d,g=u*p,v=u*b,P=m*p,w=m*b,x=h*b,S=f*d,A=f*p,M=f*b;return[(1-(P+x))*r[0],(g+M)*r[0],(v-A)*r[0],0,(g-M)*r[1],(1-(y+x))*r[1],(w+S)*r[1],0,(v+A)*r[2],(w-S)*r[2],(1-(y+P))*r[2],0,n[0],n[1],n[2],1]}function D2(e,t,n,o){return[e[0]*t+e[4]*n+e[8]*o+e[12],e[1]*t+e[5]*n+e[9]*o+e[13],e[2]*t+e[6]*n+e[10]*o+e[14]]}function N2(e){let t=e[0],n=e[4],o=e[8],r=e[1],i=e[5],a=e[9],s=e[2],c=e[6],l=e[10],u=i*l-a*c,m=a*s-r*l,h=r*c-i*s,f=t*u+n*m+o*h;if(Math.abs(f)<1e-12)return null;let d=1/f;return[u*d,m*d,h*d,(o*c-n*l)*d,(t*l-o*s)*d,(n*s-t*c)*d,(n*a-o*i)*d,(o*r-t*a)*d,(t*i-n*r)*d]}function id(e,t,n,o){let r=e[0]*t+e[1]*n+e[2]*o,i=e[3]*t+e[4]*n+e[5]*o,a=e[6]*t+e[7]*n+e[8]*o,s=Math.hypot(r,i,a)||1;return r/=s,i/=s,a/=s,[r,i,a]}function B2(e){if(e.byteLength<20||e.byteLength>8388608)return null;let t=new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.getUint32(0,!0)!==1179937895||t.getUint32(4,!0)!==2||t.getUint32(8,!0)!==e.byteLength)return null;let n=12,o=null,r=null;for(;n+8<=e.byteLength;){let i=t.getUint32(n,!0),a=t.getUint32(n+4,!0);if(n+=8,i%4!==0||n+i>e.byteLength)return null;let s=e.subarray(n,n+i);if(a===1313821514&&!o)try{let c=JSON.parse(new TextDecoder().decode(s).replace(/[\u0000 ]+$/g,""));if(!pt(c))return null;o=c}catch{return null}else if(a===5130562&&!r)r=s;else return null;n+=i}return n===e.byteLength&&o&&r?{json:o,bin:r}:null}function H2(e){return e===5120||e===5121?1:e===5122||e===5123?2:e===5125||e===5126?4:0}function G2(e){return e==="SCALAR"?1:e==="VEC2"?2:e==="VEC3"?3:e==="VEC4"?4:0}function V2(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 z2(e){let t=e instanceof Uint8Array?e:new Uint8Array(e),n=B2(t);if(!n)return{ok:!1,issue:"invalid_glb"};let{json:o,bin:r}=n;if(!pt(o.asset)||o.asset.version!=="2.0")return{ok:!1,issue:"unsupported_glb"};let i=vt(o.extensionsUsed).filter(A=>typeof A=="string");if(i.includes("KHR_draco_mesh_compression")||k2(o))return{ok:!1,issue:"draco_not_allowed"};if(i.length||vt(o.extensionsRequired).length)return{ok:!1,issue:"unsupported_glb"};if(vt(o.images).length||vt(o.textures).length)return{ok:!1,issue:"external_resource"};let a=vt(o.buffers);if(a.length!==1||!pt(a[0])||a[0].uri!==void 0||typeof a[0].byteLength!="number"||!Number.isInteger(a[0].byteLength)||a[0].byteLength<0||a[0].byteLength>r.byteLength)return{ok:!1,issue:"external_resource"};let s=vt(o.accessors),c=vt(o.bufferViews),l=vt(o.meshes),u=vt(o.nodes),m=vt(o.scenes),h=typeof o.scene=="number"?o.scene:0;if(!pt(m[h]))return{ok:!1,issue:"unsupported_glb"};let f=new DataView(r.buffer,r.byteOffset,r.byteLength),d=(A,M,E,T=!1)=>{if(typeof A!="number"||!Number.isInteger(A)||!pt(s[A]))return null;let k=s[A],_=typeof M=="string"?k.type===M:M.includes(k.type),R=k.componentType!==5126,C=T&&R?k.normalized===!0:k.normalized!==!0;if(!_||k.sparse!==void 0||!C||typeof k.count!="number"||!Number.isInteger(k.count)||k.count<1||typeof k.componentType!="number"||!E.includes(k.componentType)||typeof k.bufferView!="number")return null;let O=c[k.bufferView];if(!pt(O)||O.buffer!==0||typeof O.byteLength!="number"||!Number.isInteger(O.byteLength)||O.byteLength<0)return null;let B=G2(k.type),F=H2(k.componentType),N=typeof O.byteStride=="number"?O.byteStride:B*F,V=typeof O.byteOffset=="number"?O.byteOffset:0,H=typeof k.byteOffset=="number"?k.byteOffset:0,L=V+H,G=H+(k.count-1)*N+B*F;if(!Number.isInteger(N)||!Number.isInteger(V)||!Number.isInteger(H)||N<B*F||V<0||H<0||V+O.byteLength>r.byteLength||G>O.byteLength)return null;let j=[];for(let D=0;D<k.count;D++){let U=[];for(let $=0;$<B;$++){let Z=V2(f,L+D*N+$*F,k.componentType);if(!Number.isFinite(Z))return null;U.push(Z)}j.push(U)}return j},p=[],b=[],y=[],g=!1,v=vt(o.materials),P=A=>{if(A===void 0)return null;if(typeof A!="number"||!Number.isInteger(A)||!pt(v[A]))return!1;let M=v[A].pbrMetallicRoughness;if(M===void 0)return null;if(!pt(M))return!1;if(M.baseColorFactor===void 0)return null;let E=Cr(M.baseColorFactor,4);return!E||E.some(T=>T<0||T>1)?!1:[E[0],E[1],E[2]]},w=0,x=new Set,S=(A,M)=>{if(typeof A!="number"||!Number.isInteger(A)||!pt(u[A])||x.has(A))return!1;x.add(A);let E=u[A],T=F2(E);if(!T)return!1;let k=O2(M,T),_=N2(k);if(!_)return!1;if(E.mesh!==void 0){if(typeof E.mesh!="number")return!1;let R=l[E.mesh];if(!pt(R))return!1;for(let C of vt(R.primitives)){if(!pt(C)||C.mode!==void 0&&C.mode!==4||!pt(C.attributes))return!1;let O=d(C.attributes.POSITION,"VEC3",[5126]),B=C.attributes.NORMAL===void 0?null:d(C.attributes.NORMAL,"VEC3",[5126]);if(!O||C.attributes.NORMAL!==void 0&&!B)return!1;let F=P(C.material);if(F===!1)return!1;let N=C.attributes.COLOR_0===void 0?null:d(C.attributes.COLOR_0,["VEC3","VEC4"],[5126,5121,5123],!0);if(C.attributes.COLOR_0!==void 0&&(!N||N.length!==O.length))return!1;let V=N?s[C.attributes.COLOR_0]:null,H=!V||V.componentType===5126?1:V.componentType===5121?1/255:1/65535,L=F!==null||N!==null;L&&(g=!0);let G=O.length;if(C.indices!==void 0){let D=typeof C.indices=="number"?s[C.indices]:null;G=pt(D)?D.count:void 0}if(typeof G!="number"||!Number.isInteger(G)||G%3!==0||(w+=G/3,w>1e5))return!1;let j=C.indices===void 0?O.map((D,U)=>[U]):d(C.indices,"SCALAR",[5121,5123,5125]);if(!j||j.length%3!==0||j.length!==G)return!1;for(let D=0;D<j.length;D+=3){let U=[j[D][0],j[D+1][0],j[D+2][0]];if(U.some(te=>!Number.isInteger(te)||te<0||te>=O.length))return!1;let $=U.map(te=>D2(k,...O[te])),Z=null;if(!B){let te=$[1][0]-$[0][0],X=$[1][1]-$[0][1],me=$[1][2]-$[0][2],re=$[2][0]-$[0][0],ce=$[2][1]-$[0][1],J=$[2][2]-$[0][2];Z=id([1,0,0,0,1,0,0,0,1],X*J-me*ce,me*re-te*J,te*ce-X*re)}for(let te=0;te<3;te++){if(p.push(...$[te]),b.push(...B?id(_,...B[U[te]]):Z),!L){y.push(-1,-1,-1);continue}let X=N?N[U[te]]:null;for(let me=0;me<3;me++)y.push(T2((F?F[me]:1)*(X?X[me]*H:1)))}}}}for(let R of vt(E.children))if(!S(R,k))return!1;return x.delete(A),!0};for(let A of vt(m[h].nodes))if(!S(A,L2()))return{ok:!1,issue:w>1e5?"triangle_limit":"unsupported_glb"};return!w||p.length!==w*9||b.length!==p.length?{ok:!1,issue:"unsupported_glb"}:{ok:!0,triangleCount:w,position:new Float32Array(p),normal:new Float32Array(b),color:g?new Float32Array(y):null}}function ad(e){try{return z2(e)}catch{return{ok:!1,issue:"invalid_glb"}}}function Oo(e){let{doc:t}=e,n=ur(t,e.eventConfigurationId??t.eventConfigurationId),o=cu(t.theme,wm(n,e.seats)),r=o.structure,i=td(e.eventConfigurationId,e.eventConfiguration,n),a=e.seats,s=new ui,c=null;if(e.registeredShellGlb){let W=ad(e.registeredShellGlb);if(W.ok){let K=W.position.length/3,Q=new Float32Array(W.position.length),ve=o.materials.shell??r.tierWall,Ee=W.color;for(let Ve=0;Ve<K;Ve++){let ze=W.normal[Ve*3+1],ye=ze<-.25?.4:.62+.38*Math.max(0,ze),Pt=!!Ee&&Ee[Ve*3]!==-1;Q[Ve*3]=(Pt?Ee[Ve*3]:ve[0])*ye,Q[Ve*3+1]=(Pt?Ee[Ve*3+1]:ve[1])*ye,Q[Ve*3+2]=(Pt?Ee[Ve*3+2]:ve[2])*ye}c={position:W.position,normal:W.normal,color:Q,floor:new Float32Array(K).fill(er),material:new Float32Array(K),count:K}}}let l=new Map;for(let W of n)for(let K of W.objects)l.set(K.id,W.index),K.type==="section"&&l.set(K.logicalSectionId??K.id,W.index);let u=a.map(W=>l.get(W.sectionId??"")??l.get(W.rowId??"")??0),m=ac(n,a),h=s.vertexCount,d=Qf(s,n,a,u,m,r)?s.vertexCount:h,p=$u(t,a),b=new Map,y=new Map;for(let W of t.categories??[])b.set(W.key,W.color),W.seatGlyph&&y.set(W.key,W.seatGlyph);let g=[],v=xh(n,a,u),P=new Map;a.forEach((W,K)=>{let Q=v.seatDeckY(K);Number.isFinite(Q)&&P.set(W.rowId,Math.min(P.get(W.rowId)??1/0,Q))});let w=new Float32Array(a.length),x=[],S=[],A=new Map((t.floors??[]).map((W,K)=>[W.id,K])),M=n.map(()=>[]);for(let W of a){let K=W.floorId?A.get(W.floorId)??0:0;M[Math.min(K,M.length-1)]?.push(W)}let E=(W,K)=>{if(!K||K.length<3)return!1;let Q=Math.min(...K.map(ze=>ze.x)),ve=Math.max(...K.map(ze=>ze.x)),Ee=Math.min(...K.map(ze=>ze.y)),Ve=Math.max(...K.map(ze=>ze.y));for(let ze=0;ze<W;ze++)for(let ye of M[ze])if(!(ye.x<Q||ye.x>ve||ye.y<Ee||ye.y>Ve)&&mt(ye,K,void 0))return!0;return!1},T=Ci(n),k=null,_=-1/0;a.forEach((W,K)=>{let Q=v.seatDeckY(K);Number.isFinite(Q)&&Q>_&&(_=Q)});let R=!1,C=W=>n.length===1?a:a.filter((K,Q)=>u[Q]===W),O=(W,K)=>{let Q=_t(W);if(!Q)return!1;let ve=1/0,Ee=1/0,Ve=-1/0,ze=-1/0;for(let ye of Q)ve=Math.min(ve,ye.x),Ve=Math.max(Ve,ye.x),Ee=Math.min(Ee,ye.y),ze=Math.max(ze,ye.y);return a.some((ye,Pt)=>ye.kind!=="booth"&&(n.length===1||u[Pt]===K)&&ye.x>ve&&ye.x<Ve&&ye.y>Ee&&ye.y<ze&&Ye(Q,ye.x,ye.y))},B,F=[],N;for(let W=0;W<n.length;W++){let K=n[W];s.setFloor(W);let Q=Mn(K,C(W)),ve=0;if(Q){let fe=0;for(let Ce of K.objects)if(Ce.type==="section")for(let ee of v.bySection.get(Ce.id)?.rowLevels??[])fe=Math.max(fe,ee.y-K.baseHeightM);ve=fh(fe);for(let Ce of Q)F.push([Ce.x*I,Ce.y*I]);if(N=Math.max(N??-1/0,K.baseHeightM+ve),!B){let Ce=Co(Q);B={centre:[Ce.x*I,Ce.y*I]}}}let Ee=new Mi,Ve=[],ze=K.objects.filter(fe=>fe.type==="shape"&&(fe.role==="entrance"||fe.role==="exit")),ye=K.objects.filter(fe=>fe.type==="section"&&!!fe.outline&&fe.outline.length>=3),Pt=Xh(K.objects.filter(fe=>fe.type==="booth"),K.focal);for(let fe of K.objects)if(fe.type==="section"){let Ce=s.vertexCount;lf(s,fe,K,Zu(fe,p),v.bySection.get(fe.id),Ee,ye,r,W>0&&E(W,fe.outline));let ee=s.vertexCount-Ce;ee>0&&x.push({sectionId:fe.id,start:Ce,count:ee})}else if(fe.type==="shape"){let Ce=i.byObjectId.get(fe.id);if(T.has(fe)&&!Ce)continue;let ee=g.length,pe=Q!==null&&fe.role==="wall"&&!Ce;s.setMaterial(pe?Fi:(Ce?.kind??fe.role)==="screen"?1:0);let de=fe.role==="stage"&&!Ce?Yh(fe,C(W)):pe&&fe.heightM===void 0?{...fe,heightM:ve}:fe,Te=dm(de,Ve),Oe=n.length>1&&fe.role==="stage";if(Oe&&s.setFloor(er),Fh(s,de,K.baseHeightM+Te.supportOffsetM,Te.topOffsetM-Te.supportOffsetM,r,K.focal,g,Ce,ze),s.setMaterial(0),fe.role==="stage"&&!Ce&&g.length>ee&&(k??W)===W){k=W;let Ue=t.floors?.[W]?.id,We=n.length>1&&Ue?a.filter(st=>st.floorId===Ue):a,at=Sm(s,de,g[g.length-1].y,We,{deck:g[g.length-1].top,night:!Kt(r),theatre:{maxTopY:Q?K.baseHeightM+ve:Math.max((n[0]?.baseHeightM??0)+8,_+5)}});at==="theatre"&&(R=!0),at===null&&rd(s,de,g[g.length-1].y,We,{deck:g[g.length-1].top,night:!Kt(r)});let Ze=Et(de.stageKind)?Pe(de):null;Ze&&Km(s,de,Ze,g[g.length-1].y,We,K.objects.some(st=>st.type==="shape"&&st.role==="goal"),K.objects.some(st=>st.type==="shape"&&st.role==="dugout")),Ze&&hi(de.stageKind)&&Ym(s,Ze,g[g.length-1].y,We,Vi),s.setMaterial(0)}Oe&&s.setFloor(W)}else if(fe.type==="gaArea"){let Ce=s.vertexCount;Nh(s,fe,K.baseHeightM,Ie(b.get(fe.categoryKey)),r);let ee=s.vertexCount-Ce;ee>0&&S.push({sectionId:fe.id,start:Ce,count:ee})}else fe.type==="booth"?kh(s,fe,K.baseHeightM,Ie(b.get(fe.categoryKey)),r,Pt.get(fe.id)??K.focal,O(fe,W)):fe.type==="table"?Oh(s,fe,Math.max(K.baseHeightM,P.get(fe.id)??K.baseHeightM),Ie(fe.fill??t.theme?.decorFill??"#232c40"),r,!!(fe.fill??t.theme?.decorFill)):fe.type==="decorImage"&&Dh(s,fe,K.baseHeightM,r);Q&&Df(s,K.objects,Q,K.baseHeightM,ve,K.focal,r,fe=>!i.byObjectId.has(fe.id)),mf(s,K,a,v,r,o.materials.shell,!c)}let V=n.length>1?{x:n.reduce((W,K)=>W+K.focal.x,0)/n.length,y:n.reduce((W,K)=>W+K.focal.y,0)/n.length}:t.focalPoint??{x:(m.minX+m.maxX)/2,y:(m.minY+m.maxY)/2},H=$l(c?[s.build(),c]:[s.build()]),L=new Map;for(let W of n)for(let K of W.objects)K.type==="table"&&L.set(K.id,K.center);let G=Ql(a,e.initialState,v,w,b,y,new Set(L.keys())),j=zf({doc:t,units:n,seats:a,surfaces:v,focal:V}),{labels:D,sections:U,rows:$}=Uf({doc:t,units:n,seats:a,surfaces:v,seatData:G,hintedSeatFloor:u,zones:j,focal:V}),Z=new Map(U.map((W,K)=>[W.id,K]));v.seatOwner.forEach((W,K)=>{G.iSection[K]=W?Z.get(W)??-1:-1});let te=jf({doc:t,units:n,seats:a,surfaces:v,solids:H,hintedSeatFloor:u,seatFloor:w});Wf(D,te),G.iYaw=cl(G.iPosition,a.length,W=>a[W].rowId,W=>{let K=n[w[W]]?.focal??V;return[K.x*I,K.y*I]},W=>{let K=L.get(a[W].rowId);return K?[K.x*I,K.y*I]:void 0});let X=!!t.focalPoint||n.some(W=>W.objects.some(K=>K.type==="shape"&&K.role==="stage")),me=n.flatMap((W,K)=>W.objects.flatMap(Q=>Q.type==="gaArea"&&Q.points?.length>=3?[{points:Q.points,holes:Q.holes,capacity:Q.capacity,floorY:W.baseHeightM+wr,floorIndex:K,focal:X?W.focal:null}]:[])),re=n.flatMap(W=>W.objects.flatMap(K=>K.type==="gaArea"&&K.points?.length>=3?[{id:K.id,points:K.points,...K.holes?.length?{holes:K.holes}:{},floorY:W.baseHeightM+wr,floorIndex:W.index}]:[])),ce=me.length?Wh(me,a.flatMap((W,K)=>W.kind==="booth"||L.has(W.rowId)?[]:[{x:W.x,y:W.y,deckY:v.seatDeckY(K),floorIndex:n.length>1?u[K]:0}]),Math.min(e.crowdFigures??Number.POSITIVE_INFINITY,zh(a.length,e.crowdSeatCeiling??Xi()))):null,J=(m.minX+m.maxX)/2*I,ae=(m.minY+m.maxY)/2*I,ie=.5*Math.hypot((m.maxX-m.minX)*I,(m.maxY-m.minY)*I)||10,ge=sc(H,G,{cx:J,cz:ae,radius:ie},[h,d]),Ae=sc(H,G,{cx:J,cz:ae,radius:ie}),be=X2(n),ke=ed(G,g,m,ge.minY,ge.maxY,ie,be),Ke=!B&&n.some(W=>W.objects.some(K=>K.type==="shape"&&co(K.stageKind))),Be=!!o.house&&!Ke&&!c&&(!!B||o.house.indoor),Fe=g.flatMap(W=>[[W.cx-W.halfX,W.cz-W.halfZ],[W.cx+W.halfX,W.cz-W.halfZ],[W.cx+W.halfX,W.cz+W.halfZ],[W.cx-W.halfX,W.cz+W.halfZ]]),Ge=Be?dh(G.iPosition,a.length,n[0]?.baseHeightM??0,[...Fe,...F],N):null;return{sharedAisles:Jl(n.flatMap(W=>W.objects.flatMap(K=>{if(K.type!=="section")return[];let Q=v.bySection.get(K.id);return Q?[{sectionId:K.id,floorIndex:W.index,rows:Q.rowLevels}]:[]}))),solids:H,sectionSolidRanges:x,seats:G,...ce?{crowd:ce}:{},...re.length?{areas:re}:{},...S.length?{areaSolidRanges:S}:{},seatSectionIds:v.seatOwner,bounds:{center:[(ke.min[0]+ke.max[0])/2,(ke.min[1]+ke.max[1])/2,(ke.min[2]+ke.max[2])/2],radius:ie,groundY:0,box:ke,fitPoints:Jf(G,g,be)},...B?{room:B}:{},...Ke?{outdoor:!0}:{},...Ge?{house:R?{...Ge,theatre:!0}:Ge}:{},renderBounds:{center:ge.center,radius:ge.radius},clipBounds:{center:Ae.center,radius:Ae.radius},stateColorLUT:lu(o,ct),theme:o,seatCount:a.length,focalWorld:[V.x*I,1.5,V.y*I],zones:j,stages:g,productionElements:i.elements,sections:U,rows:$,labels:D,floors:te}}function X2(e){let t=[];for(let n of e)for(let o of n.objects){let r=o.type==="gaArea"?o.points:o.type==="booth"?_t(o):null;for(let i of r??[])t.push([i.x*I,n.baseHeightM,i.y*I])}return t}var wn=require("ogl"),K2=.05,Y2=.55,$2=12,Z2=1.6,q2=1,Q2=2.5,J2=650,zn={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40,nearStrength:.6};function eS(e,t){if(t)return 0;let n=(e-zn.fadeInFromM)/(zn.fullByM-zn.fadeInFromM);return Math.max(zn.nearStrength,Math.min(1,n))}var sd=24;function tS(e){let t=[],n=[],o=[],r=(m,h,f)=>{t.push(...m),n.push(...h),o.push(f)};for(let m=0;m<16;m++){let h=m/16*Math.PI*2,f=(m+1)/16*Math.PI*2,d=v=>[Math.cos(v),0,Math.sin(v)],p=[Math.cos(h)*.012,0,Math.sin(h)*.012],b=[Math.cos(f)*.012,0,Math.sin(f)*.012],y=[Math.cos(h)*.03,1,Math.sin(h)*.03],g=[Math.cos(f)*.03,1,Math.sin(f)*.03];r(p,d(h),0),r(y,d(h),0),r(g,d(f),0),r(p,d(h),0),r(g,d(f),0),r(b,d(f),0)}let c=.16,l=.24,u=.01;for(let m=0;m<48;m++){let h=m/48*Math.PI*2,f=(m+1)/48*Math.PI*2,d=[Math.cos(h)*c,u,Math.sin(h)*c],p=[Math.cos(h)*l,u,Math.sin(h)*l],b=[Math.cos(f)*l,u,Math.sin(f)*l],y=[Math.cos(f)*c,u,Math.sin(f)*c];for(let g of[d,p,b,d,b,y])r(g,[0,1,0],1)}for(let m=0;m<32;m++){let h=m/32*Math.PI*2,f=(m+1)/32*Math.PI*2,d=zn.baseRadius,p=zn.topRadius,b=[Math.cos(h)*d,0,Math.sin(h)*d],y=[Math.cos(f)*d,0,Math.sin(f)*d],g=[Math.cos(h)*p,1,Math.sin(h)*p],v=[Math.cos(f)*p,1,Math.sin(f)*p],P=[Math.cos(h),0,Math.sin(h)],w=[Math.cos(f),0,Math.sin(f)];r(b,P,2),r(g,P,2),r(v,w,2),r(b,P,2),r(v,w,2),r(y,w,2)}return new wn.Geometry(e,{position:{size:3,data:new Float32Array(t)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(o)}})}var nS=`#version 300 es
|
|
21
35
|
precision highp float;
|
|
22
36
|
in vec3 position; in vec3 normal; in float part;
|
|
23
37
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
|
|
@@ -44,7 +58,7 @@ void main() {
|
|
|
44
58
|
float scale = part > 0.5 ? uRingScale : uHeight;
|
|
45
59
|
vec3 world = uSeat + vec3(position.x, position.y * grow, position.z) * scale;
|
|
46
60
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(world, 1.0);
|
|
47
|
-
}`,
|
|
61
|
+
}`,oS=`#version 300 es
|
|
48
62
|
precision highp float;
|
|
49
63
|
in vec3 vNormal; in float vPart; in float vAlong;
|
|
50
64
|
uniform vec3 uColor; uniform float uRingAlpha; uniform vec3 uBeamColor; uniform float uBeam;
|
|
@@ -62,15 +76,25 @@ void main() {
|
|
|
62
76
|
float key = max(dot(normalize(vNormal), normalize(vec3(-0.4, 0.7, 0.6))), 0.0);
|
|
63
77
|
vec3 c = uColor * (0.55 + 0.5 * key) + vec3(0.12) * pow(key, 12.0);
|
|
64
78
|
fragColor = vec4(c, 1.0);
|
|
65
|
-
}`;function m1(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function ya(e){return Math.max(t1,Math.min(n1,e*e1))}function f1(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function sm(e,t,n=[.24,.74,1]){let o=f1(n),r=new Dt.Transform,i=c1(e),a=new Map,s=(c,l)=>{let u=new Dt.Program(e,{vertex:l1,fragment:u1,uniforms:{uSeat:{value:c},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:en.height},uBeam:{value:0},uBeamColor:{value:o},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new Dt.Mesh(e,{geometry:i,program:u});return m.frustumCulled=!1,m.setParent(r),{mesh:m,program:u,seat:c,start:l}};return{root:r,setSeats(c,l,u){let m=new Set(c.slice(0,am).map(f=>f.id));for(let[f,d]of a)m.has(f)||(d.mesh.setParent(null),a.delete(f));for(let f of c.slice(0,am))a.has(f.id)||a.set(f.id,s(f.position,u?l:-1/0))},update(c,l,u,m=!1){let f=!1;for(let d of a.values()){let h=l[0]-d.seat[0],p=l[1]-d.seat[1],b=l[2]-d.seat[2],y=Math.hypot(h,p,b);d.mesh.visible=!u&&y>(m?r1:i1);let M=ya(y),S=Math.max(0,Math.min(1,(c-d.start)/a1));S<1&&(f=!0),d.program.uniforms.uHeight.value=M,d.program.uniforms.uRingScale.value=Math.min(M,o1),d.program.uniforms.uLift.value=m?1:1-m1(S),d.program.uniforms.uBeam.value=s1(y,m),d.program.uniforms.uRingAlpha.value=.55+.4*(S<1?Math.sin(S*Math.PI):0)}return f},dispose(){for(let c of a.values())c.mesh.setParent(null);a.clear(),i.remove()}}}var d1={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function h1(e){return d1[e]??""}function Sr(e,t={}){let n=h1(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var xo="#ffffff",cm="#0b1220",Mo=6,p1=80,lm=14,um=88,mm=20,fm={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},b1=640,y1=.8,g1=11,x1="3px 7px",M1="2px 5px",dm="rgba(10,14,22,.62)",v1="#f4f7fb",hm=5,pm=2,S1=6,vo=new Set(["row","seat","access"]),ga={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},kn={row:{x:66,y:20},seat:{x:52,y:22}},tn=ye,xa=e=>us(e);function nn(e,t){let n=xa(e),o=xa(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function w1(e){let t=tn(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&nn(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:nn(r,o)}}var P1=30;function Ma(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function A1(e,t=[.04,.06,.1],n=!0){let o=xa(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?Ma(i,t):t,s=tn(e),c=n?7:4.5,l=s&&nn(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function I1(e,t=[.04,.06,.1]){let n=Ma(dm,t),o=tn(e);return{ink:o&&nn(o,n)>=4.5?e:v1,backing:dm}}var R1=.8,On=20,E1=14,C1=60,_1='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',wr=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||_1,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=fm[t].size;return!this.narrowStage||vo.has(t)?n:Math.max(g1,n*y1)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length)return;this.narrowStage=n>0&&n<b1;let s=Cu(r,i,{hasZoneLabels:this.labels.some(v=>v.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*R1&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(v=>v.kind==="section")&&s.delete("zone");let c=[];for(let v of this.labels){let P=v.kind==="annotation"&&!!v.venueIcon;if(!s.has(v.kind)&&!P&&!(v.kind==="seat"&&this.selectedSeatLabelIds.has(v.id)))continue;let R=v.kind==="seat"&&a&&this.selectedSeatLabelIds.has(v.id)?v.pinBase:void 0,k=R&&a?[R[0],R[1]+ya(Math.hypot(R[0]-a[0],R[1]-a[1],R[2]-a[2])),R[2]]:v.anchor,F=gt(t,k,n,o);if(!F.visible)continue;let E=vo.has(v.kind),I=this.sizeFor(v.kind),C=v.kind==="access"?On:Lu(v.text,I,!E)+(E?hm*2:0)+((this.wheelchairFree.get(v.id)??0)>0?P1:0);if(v.kind==="access"&&v.seatWidthM!==void 0&&ua(t,v.anchor,v.seatWidthM,n)<E1||v.kind==="seat"&&v.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(v.id)&&ua(t,v.anchor,v.seatWidthM,n)<Math.max(22,C))continue;let L=_u(F,C/2,I/2+(E?pm:4),n,o),N=a?Math.hypot(v.anchor[0]-a[0],v.anchor[1]-a[1],v.anchor[2]-a[2]):1;c.push({label:v,screen:L,focus:Ou(L,N,n,o),halfWidth:C/2,...this.selectedSeatLabelIds.has(v.id)?{priority:1}:{}})}let l=Eu(c.filter(v=>v.label.kind==="floor"),n),u=[...c.filter(v=>!vo.has(v.label.kind)&&v.label.kind!=="floor"),...l],m=ku(n),f=c.filter(v=>v.label.kind==="seat"&&this.selectedSeatLabelIds.has(v.label.id)),d=yo(f,kn.seat.x,kn.seat.y,m.seat);this.placePinHeads(f.filter(v=>v.label.pinBase&&!d.includes(v)).map(v=>v.screen));let h=Tu(u,um,mm,v=>ga[v.label.kind]??0).filter(v=>!d.some(P=>bo(v,P,um,mm))),p=yo(c.filter(v=>v.label.kind==="access"),On,On,C1,[...h,...d]),b=yo(c.filter(v=>v.label.kind==="row"),kn.row.x,kn.row.y,m.row,[...h,...d,...p]),y=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,M=yo(c.filter(v=>v.label.kind==="seat"&&!this.selectedSeatLabelIds.has(v.label.id)&&(this.seatNumberSeat!==null?v.label.id===this.seatNumberSeat:!y||this.seatNumberRow!==null&&v.label.rowId===this.seatNumberRow)),kn.seat.x,kn.seat.y,y?p1:m.seat-d.length,[...h,...d,...p,...b]),S=[...h,...p,...b,...d,...M],A=new Set(S.map(v=>v.label.id));for(let{label:v,screen:P}of S){let k=this.nodeFor(v).style;k.display=v.kind==="access"?"flex":v.kind==="gate"?"inline-flex":"";let F=!!v.pinBase&&this.selectedSeatLabelIds.has(v.id);k.transform=F?`translate(-50%, -100%) translate(${P.x.toFixed(1)}px, ${(P.y-Mo).toFixed(1)}px)`:`translate(-50%, -50%) translate(${P.x.toFixed(1)}px, ${P.y.toFixed(1)}px)`}let g=S.filter(({label:v})=>!vo.has(v.kind)).sort((v,P)=>ga[P.label.kind]-ga[v.label.kind]||v.screen.depth-P.screen.depth||v.focus-P.focus).flatMap(({label:v})=>{let P=this.nodes.get(v.id);return P&&P.style.display!=="none"?[{node:P,box:P.getBoundingClientRect()}]:[]}),w=[];for(let{node:v,box:P}of g)w.some(k=>P.left<k.right+3&&P.right+3>k.left&&P.top<k.bottom+3&&P.bottom+3>k.top)?v.style.display="none":w.push(P);for(let[v,P]of this.nodes)A.has(v)||(P.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let y=document.createElement("span"),M=y.style;M.position="absolute",M.left="50%",M.bottom=`-${Mo}px`,M.transform="translateX(-50%)",M.borderLeft=`${Mo}px solid transparent`,M.borderRight=`${Mo}px solid transparent`,M.borderTop=`${Mo}px solid ${xo}`,n.appendChild(y)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=fm[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=vo.has(t.kind),u=!l,m=A1(t.color??this.opts.ink,this.opts.backgroundRgb,!0),f=l?I1(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?cm:f.ink,c.background=o?xo:f.backing,c.border=o?`1px solid ${xo}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${S1}px`;let d=this.narrowStage?M1:x1;c.padding=o||u?d:`${pm}px ${hm}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let h=this.opts.backgroundRgb??[.04,.06,.1],p=tn(o?cm:f.ink)??[1,1,1],b=Ma(o?xo:f.backing,h);return n.dataset.qualityContrast=nn(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=so(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=Oi.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${ki[o.group]}" stroke="${er}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${er}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=Sr("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=nn([1,1,1],tn("#0f172a")).toFixed(3)}dressSectionTag(t,n,o){let r=n.tint?w1(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${Sr("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?Sr(n.icon,{size:On-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${On}px`,o.height=`${On}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=nn(tn(n.ink??"#ffffff")??[1,1,1],tn(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${lm}px`,o.height=`${lm}px`,o.borderRadius="50%",o.background=xo,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var ym=1;var T1=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function L1(e){return e.every(t=>Number.isFinite(t))}function k1(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 bm(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function on(e){return Math.round(e*1e4)/1e4}function O1(e){if(e)return{box:{x:on(e.box.x),y:on(e.box.y),width:on(e.box.width),height:on(e.box.height)},horizontalFillRatio:on(e.horizontalFillRatio),verticalFillRatio:on(e.verticalFillRatio),visibleAreaRatio:on(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function xt(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function Pr(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>T1.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)k1(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[xt("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),xt("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),xt("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),xt("viewport-empty","The 3D viewport must have visible dimensions",e.viewport.width>1&&e.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${e.viewport.width}\xD7${e.viewport.height}`}]),xt("camera-invalid","The capture camera must have a finite physical pose",L1(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),xt("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!e.scene.authoredRelief||e.scene.renderedVerticalSpanM>.05&&e.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:e.scene.projectedReliefPx,minimum:2}]),xt("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),xt("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",n.filter(s=>s.renderedFontPx<11).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.renderedFontPx,minimum:11}))),xt("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",n.filter(s=>s.contrast<4.5).map(s=>({primaryId:s.id,primaryLabel:s.text,measured:s.contrast,minimum:4.5}))),xt("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:O1(e.framing)},metrics:{minimumHierarchyFontPx:bm(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:bm(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function gm(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var Ne=require("ogl");var Nt=require("ogl");var Ar=`
|
|
79
|
+
}`;function rS(e){if(e>=1)return 1;if(e<.72){let n=e/.72;return 1-(1-n)*(1-n)}let t=(e-.72)/.28;return 1-.08*Math.sin(t*Math.PI)}function cc(e){return Math.max(Y2,Math.min($2,e*K2))}function iS(e){let t=.2126*e[0]+.7152*e[1]+.0722*e[2],n=t>=.25?0:Math.min(.45,(.25-t)*2.2);return e.map(o=>o+(1-o)*n)}function cd(e,t,n=[.24,.74,1]){let o=iS(n),r=new wn.Transform,i=tS(e),a=new Map,s=(c,l)=>{let u=new wn.Program(e,{vertex:nS,fragment:oS,uniforms:{uSeat:{value:c},uHeight:{value:1},uLift:{value:0},uRingScale:{value:1},uBeamHeight:{value:zn.height},uBeam:{value:0},uBeamColor:{value:o},uColor:{value:t},uRingAlpha:{value:.85}},transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1}),m=new wn.Mesh(e,{geometry:i,program:u});return m.frustumCulled=!1,m.setParent(r),{mesh:m,program:u,seat:c,start:l}};return{root:r,setSeats(c,l,u){let m=new Set(c.slice(0,sd).map(h=>h.id));for(let[h,f]of a)m.has(h)||(f.mesh.setParent(null),a.delete(h));for(let h of c.slice(0,sd))a.has(h.id)||a.set(h.id,s(h.position,u?l:-1/0))},update(c,l,u,m=!1){let h=!1;for(let f of a.values()){let d=l[0]-f.seat[0],p=l[1]-f.seat[1],b=l[2]-f.seat[2],y=Math.hypot(d,p,b);f.mesh.visible=!u&&y>(m?q2:Q2);let g=cc(y),v=Math.max(0,Math.min(1,(c-f.start)/J2));v<1&&(h=!0),f.program.uniforms.uHeight.value=g,f.program.uniforms.uRingScale.value=Math.min(g,Z2),f.program.uniforms.uLift.value=m?1:1-rS(v),f.program.uniforms.uBeam.value=eS(y,m),f.program.uniforms.uRingAlpha.value=.55+.4*(v<1?Math.sin(v*Math.PI):0)}return h},dispose(){for(let c of a.values())c.mesh.setParent(null);a.clear(),i.remove()}}}var aS={wheelchair:'<circle cx="10.6" cy="3.7" r="1.7" /><path d="M8.9 6.3v4.3a1.3 1.3 0 0 0 1.3 1.3h3.4l1.9 4.5h1.9" /><circle cx="9.7" cy="13.3" r="4.7" />',companion:'<circle cx="6" cy="6" r="2" /><circle cx="14" cy="6" r="2" /><path d="M2.5 16v-3.5A3.5 3.5 0 0 1 6 9a3.5 3.5 0 0 1 3.5 3.5V16M10.5 16v-3.5A3.5 3.5 0 0 1 14 9a3.5 3.5 0 0 1 3.5 3.5V16" />',"semi-ambulatory":'<circle cx="8" cy="4" r="1.7" /><path d="m8 6 2 4 3 2M10 10l-2 3-1 4M10 10l2 7M14 7l2 10" />',"designated-aisle":'<path d="M3.5 5.5v7h8.5V10H6.5M5 12.5V17M11 12.5V17" /><path d="M13.5 6.5H19M16.5 4l2.5 2.5L16.5 9" />',"step-free":'<circle cx="5.5" cy="5" r="1.7" /><path d="M5.5 7v4l3 2M2.5 16.5H8l7-7h3M8 16.5h10" />',hearing:'<path d="M7 16c-1-1.2-1.5-2.4-1.5-3.8V9a5 5 0 1 1 10 0c0 2.2-1.2 3.2-2.6 4-1.2.7-1.7 1.4-1.7 2.4A2.6 2.6 0 0 1 8.6 18" />',cart:'<path d="M8 6.5A4 4 0 1 0 8 13M17 6.5a4 4 0 1 0 0 6.5" />',"sign-language":'<path d="M6 16V8.5a1 1 0 0 1 2 0v3M8 11V5.5a1 1 0 0 1 2 0V11M10 11V4.5a1 1 0 0 1 2 0V11M12 11V6a1 1 0 0 1 2 0v6l1-1.5a1.2 1.2 0 0 1 2 1.3L14 17H9.5A3.5 3.5 0 0 1 6 13.5" />',"low-vision":'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><circle cx="10" cy="10" r="2.5" /><path d="m15 4 .5-1.5M17 5l1.5-.8" />',"sensory-friendly":'<path d="M4 11v-1a6 6 0 0 1 12 0v1M4 11h2.5v5H5a1 1 0 0 1-1-1v-4ZM16 11h-2.5v5H15a1 1 0 0 0 1-1v-4Z" /><path d="M8.5 11.5c.8.7 2.2.7 3 0M9 14c.6.4 1.4.4 2 0" />',"plus-size":'<path d="M5 9V6.5A2.5 2.5 0 0 1 7.5 4h5A2.5 2.5 0 0 1 15 6.5V9M3.5 8.5v5h13v-5M6 13.5V17M14 13.5V17" />',"lift-armrest":'<path d="M5 10V6.5A2.5 2.5 0 0 1 7.5 4h4A2.5 2.5 0 0 1 14 6.5V10M4 9v4h11V9M6 13v4M13 13v4" /><path d="M17 11V4M15 6l2-2 2 2" />',obstructedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="m4 17 12-14" />',restrictedView:'<path d="M2.5 10s3-5 7.5-5 7.5 5 7.5 5-3 5-7.5 5-7.5-5-7.5-5Z" /><path d="M10 7.5v3.5M10 13.5h.01" />',premium:'<path d="m10 2.5 2.2 4.6 5 .7-3.6 3.5.9 5-4.5-2.4-4.5 2.4.9-5-3.6-3.5 5-.7Z" />',note:'<circle cx="10" cy="10" r="7.5" /><path d="M10 9.2v4.6M10 6.3h.01" />',aisle:'<path d="M2.5 6v7h6.5v-2.5H4.5M3.5 13v3.5M8 13v3.5" /><path d="M12.5 3v14M17 3v14" />',entrance:'<path d="M10 3.5h6.5v13H10" /><path d="M3 10h8.5M8.5 7l3 3-3 3" />',booth:'<path d="M3.5 8.5h13v8h-13ZM2.5 8.5 4 4h12l1.5 4.5M8 16.5v-4h4v4" />'};function sS(e){return aS[e]??""}function Qi(e,t={}){let n=sS(e);if(!n)return"";let o=t.size??18,r=20;return`<svg viewBox="0 0 ${r} ${r}" width="${o}" height="${o}" fill="none" stroke="currentColor" stroke-width="1.45" stroke-linecap="round" stroke-linejoin="round"`+(t.className?` class="${t.className}"`:"")+` aria-hidden="true" focusable="false">${n}</svg>`}var Un="#ffffff",lc="#0b1220",Tr=6,cS=80,ld=14,ud=88,md=20,hd={floor:{size:14,weight:"700",opacity:.98},stage:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},gate:{size:12,weight:"700",opacity:.98},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1},access:{size:12,weight:"700",opacity:1}},lS=640,uS=.8,mS=11,hS="3px 7px",fS="2px 5px",fd="rgba(10,14,22,.62)",dS="#f4f7fb",dd=5,pd=2,pS=6,kr=new Set(["row","seat","access"]),uc={stage:6,gate:5,floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Fo={row:{x:66,y:20},seat:{x:52,y:22}},Wn=Ie,mc=e=>hl(e);function jn(e,t){let n=mc(e),o=mc(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function bS(e){let t=Wn(e);if(!t)return null;let n=i=>`#${i.map(a=>Math.round(Math.max(0,Math.min(1,a))*255).toString(16).padStart(2,"0")).join("")}`,o=t.map(i=>i+(1-i)*.78),r=t.map(i=>i*.62);for(let i=0;i<12&&jn(r,o)<4.5;i++)r=r.map(a=>a*.8);return{fill:n(o),ink:n(r),border:n(t.map(i=>i+(1-i)*.35)),contrast:jn(r,o)}}var gS=30,yS=30,xS=.62;function hc(e,t){let n=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(e.replace(/\s/g,""));if(!n)return t;let o=Math.max(0,Math.min(1,Number(n[4])));return[1,2,3].map(r=>Number(n[r])/255*o+t[r-1]*(1-o))}function MS(e,t=[.04,.06,.1],n=!0){let o=mc(t)<.42,r=o?"#f4f7fb":"#0b1220",i=o?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",a=n?hc(i,t):t,s=Wn(e),c=n?7:4.5,l=s&&jn(s,a)>=c?e:r;return o?{ink:l,backing:i,border:"rgba(210,222,245,.24)"}:{ink:l,backing:i,border:"rgba(11,18,32,.22)"}}function vS(e,t=[.04,.06,.1]){let n=hc(fd,t),o=Wn(e);return{ink:o&&jn(o,n)>=4.5?e:dS,backing:fd}}var SS=.8,Do=20,wS=14,PS=60,AS='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ji=class{constructor(t,n={}){this.nodes=new Map;this.labels=[];this.wheelchairFree=new Map;this.placedTags=[];this.nodeAppearance=new WeakMap;this.forcedDense=!1;this.overviewDistance=null;this.selectedSeatLabelIds=new Set;this.narrowStage=!1;this.seatNumberRow=void 0;this.seatNumberSeat=null;this.pinHeads=[];this.opts=n,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let o=this.root.style;o.position="absolute",o.inset="0",o.pointerEvents="none",o.overflow="hidden",o.fontFamily=n.fontFamily||AS,t.appendChild(this.root)}setVisible(t){this.root.style.visibility=t?"":"hidden"}tagAt(t,n){if(this.root.style.visibility==="hidden")return null;for(let o of this.placedTags)if(t>=o.left&&t<=o.right&&n>=o.top&&n<=o.bottom)return o.id;return null}setLabels(t){this.labels=t;let n=new Set(t.map(o=>o.id));for(let[o,r]of this.nodes)n.has(o)||(r.remove(),this.nodes.delete(o))}setForcedDense(t){this.forcedDense=t}setOverviewDistance(t){this.overviewDistance=t>0?t:null}setSeatNumberRow(t){return t===this.seatNumberRow?!1:(this.seatNumberRow=t,!0)}setSeatNumberSeat(t){let n=t?`seat:${t}`:null;return n===this.seatNumberSeat?!1:(this.seatNumberSeat=n,!0)}setWheelchairFree(t){let n=t.size!==this.wheelchairFree.size;if(!n){for(let[o,r]of t)if(this.wheelchairFree.get(o)!==r){n=!0;break}}return n&&(this.wheelchairFree=new Map(t)),n}setSelectedSeatIds(t){this.selectedSeatLabelIds=new Set(Array.from(t,n=>`seat:${n}`))}sizeFor(t){let n=hd[t].size;return!this.narrowStage||kr.has(t)?n:Math.max(mS,n*uS)}qualityEvidence(){let t=this.root.getBoundingClientRect(),n=this.root.style.visibility!=="hidden";return this.labels.map(o=>{let r=this.nodes.get(o.id),i=r?.getBoundingClientRect(),a=!!(n&&r&&r.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:o.id,kind:o.kind,text:o.text,visible:a,renderedFontPx:r&&Number.parseFloat(r.style.fontSize)||0,contrast:r?Number(r.dataset.qualityContrast??0):0,...a&&i?{screenBox:{x:i.x-t.x,y:i.y-t.y,width:i.width,height:i.height}}:{}}})}update(t,n,o,r,i,a){if(!this.labels.length){this.placedTags=[];return}this.narrowStage=n>0&&n<lS;let s=If(r,i,{hasZoneLabels:this.labels.some(M=>M.kind==="zone")});this.forcedDense&&(s.add("row"),s.add("seat"),s.add("access")),!this.forcedDense&&this.overviewDistance!==null&&r>this.overviewDistance*SS&&(s.delete("section"),s.delete("ga")),s.has("section")&&this.labels.some(M=>M.kind==="section")&&s.delete("zone");let c=[];for(let M of this.labels){let E=M.kind==="annotation"&&!!M.venueIcon;if(!s.has(M.kind)&&!E&&!(M.kind==="seat"&&this.selectedSeatLabelIds.has(M.id)))continue;let T=M.kind==="seat"&&a&&this.selectedSeatLabelIds.has(M.id)?M.pinBase:void 0,k=T&&a?[T[0],T[1]+cc(Math.hypot(T[0]-a[0],T[1]-a[1],T[2]-a[2])),T[2]]:M.anchor,_=en(t,k,n,o);if(!_.visible)continue;let R=kr.has(M.kind),C=this.sizeFor(M.kind),O=M.kind==="access"?Do:Tf(M.text,C,!R)+(R?dd*2:0)+((this.wheelchairFree.get(M.id)??0)>0?gS:0)+((M.count??0)>0?yS:0);if(M.kind==="access"&&M.seatWidthM!==void 0&&Qs(t,M.anchor,M.seatWidthM,n)<wS||M.kind==="seat"&&M.seatWidthM!==void 0&&!this.selectedSeatLabelIds.has(M.id)&&Qs(t,M.anchor,M.seatWidthM,n)<Math.max(22,O))continue;let B=_f(_,O/2,C/2+(R?pd:4),n,o),F=a?Math.hypot(M.anchor[0]-a[0],M.anchor[1]-a[1],M.anchor[2]-a[2]):1;c.push({label:M,screen:B,focus:Lf(B,F,n,o),halfWidth:O/2,...this.selectedSeatLabelIds.has(M.id)?{priority:1}:{}})}let l=Ef(c.filter(M=>M.label.kind==="floor"),n),u=[...c.filter(M=>!kr.has(M.label.kind)&&M.label.kind!=="floor"),...l],m=kf(n),h=c.filter(M=>M.label.kind==="seat"&&this.selectedSeatLabelIds.has(M.label.id)),f=Ir(h,Fo.seat.x,Fo.seat.y,m.seat);this.placePinHeads(h.filter(M=>M.label.pinBase&&!f.includes(M)).map(M=>M.screen));let d=Cf(u,ud,md,M=>uc[M.label.kind]??0).filter(M=>!f.some(E=>Er(M,E,ud,md))),p=Ir(c.filter(M=>M.label.kind==="access"),Do,Do,PS,[...d,...f]),b=Ir(c.filter(M=>M.label.kind==="row"),Fo.row.x,Fo.row.y,m.row,[...d,...f,...p]),y=this.seatNumberRow!==void 0||this.seatNumberSeat!==null,g=Ir(c.filter(M=>M.label.kind==="seat"&&!this.selectedSeatLabelIds.has(M.label.id)&&(this.seatNumberSeat!==null?M.label.id===this.seatNumberSeat:!y||this.seatNumberRow!==null&&M.label.rowId===this.seatNumberRow)),Fo.seat.x,Fo.seat.y,y?cS:m.seat-f.length,[...d,...f,...p,...b]),v=[...d,...p,...b,...f,...g],P=new Set(v.map(M=>M.label.id));for(let{label:M,screen:E}of v){let k=this.nodeFor(M).style;k.display=M.kind==="access"?"flex":M.kind==="gate"?"inline-flex":"";let _=!!M.pinBase&&this.selectedSeatLabelIds.has(M.id);k.transform=_?`translate(-50%, -100%) translate(${E.x.toFixed(1)}px, ${(E.y-Tr).toFixed(1)}px)`:`translate(-50%, -50%) translate(${E.x.toFixed(1)}px, ${E.y.toFixed(1)}px)`}let x=v.filter(({label:M})=>!kr.has(M.kind)).sort((M,E)=>uc[E.label.kind]-uc[M.label.kind]||M.screen.depth-E.screen.depth||M.focus-E.focus).flatMap(({label:M})=>{let E=this.nodes.get(M.id);return E&&E.style.display!=="none"?[{id:M.id,node:E,box:E.getBoundingClientRect()}]:[]}),S=[],A=[];for(let{id:M,node:E,box:T}of x)S.some(_=>T.left<_.right+3&&T.right+3>_.left&&T.top<_.bottom+3&&T.bottom+3>_.top)?E.style.display="none":(S.push(T),T.width>0&&T.height>0&&A.push({id:M,left:T.left,right:T.right,top:T.top,bottom:T.bottom}));this.placedTags=A;for(let[M,E]of this.nodes)P.has(M)||(E.style.display="none")}nodeFor(t){let n=this.nodes.get(t.id);if(!n){n=document.createElement("div");let y=n.style;y.position="absolute",y.left="0",y.top="0",y.whiteSpace="nowrap",y.display="none",this.root.appendChild(n),this.nodes.set(t.id,n)}let o=this.selectedSeatLabelIds.has(t.id),r=this.nodeAppearance.get(n),i=this.wheelchairFree.get(t.id)??0,a=t.text+(t.icon??"")+(t.venueIcon??"")+(t.tint??"")+(i>0?`|${i}`:"")+((t.count??0)>0?`|x${t.count}`:"")+(t.muted?"|muted":"");if(r&&r.text===a&&r.kind===t.kind&&r.color===t.color&&r.selected===o&&r.narrow===this.narrowStage)return n;if(this.nodeAppearance.set(n,{text:a,kind:t.kind,color:t.color,selected:o,narrow:this.narrowStage}),t.kind==="access")return this.paintAccessChip(n,t);if(n.textContent=t.text,o){let y=document.createElement("span"),g=y.style;g.position="absolute",g.left="50%",g.bottom=`-${Tr}px`,g.transform="translateX(-50%)",g.borderLeft=`${Tr}px solid transparent`,g.borderRight=`${Tr}px solid transparent`,g.borderTop=`${Tr}px solid ${Un}`,n.appendChild(y)}n.setAttribute("data-label-kind",t.kind),n.toggleAttribute("data-selected-seat",o);let s=hd[t.kind],c=n.style;c.fontSize=`${this.sizeFor(t.kind)}px`,c.fontWeight=o?"800":s.weight,c.opacity=o?"1":String(s.opacity);let l=kr.has(t.kind),u=!l,m=MS(t.color??this.opts.ink,this.opts.backgroundRgb,!0),h=l?vS(t.color??this.opts.ink,this.opts.backgroundRgb):m;c.color=o?lc:h.ink,c.background=o?Un:h.backing,c.border=o?`1px solid ${Un}`:u?`1px solid ${m.border}`:"",c.borderRadius=o||u?"999px":`${pS}px`;let f=this.narrowStage?fS:hS;c.padding=o||u?f:`${pd}px ${dd}px`,c.lineHeight=l?"1.1":"",c.boxShadow=o?"0 0 0 3px rgba(255,255,255,.28), 0 0 18px rgba(255,255,255,.55), 0 5px 14px rgba(0,0,0,.45)":u?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",c.textShadow=o||u?"none":"0 1px 1px rgba(0,0,0,0.4)",c.letterSpacing=t.kind==="zone"||t.kind==="floor"?"0.08em":"0.02em";let d=this.opts.backgroundRgb??[.04,.06,.1],p=Wn(o?lc:h.ink)??[1,1,1],b=hc(o?Un:h.backing,d);return n.dataset.qualityContrast=jn(p,b).toFixed(3),c.textTransform=t.kind==="zone"||t.kind==="floor"?"uppercase":"",t.kind==="section"&&this.dressSectionTag(n,t,i),t.kind==="gate"&&this.dressGateTag(n,t),t.kind==="ga"&&this.dressAreaTag(n,t),t.venueIcon&&this.dressVenueIconTag(n,t.venueIcon),n}dressVenueIconTag(t,n){let o=xr(n);if(!o)return;let r=t.style;r.display="inline-flex",r.alignItems="center",r.gap="5px";let i=16,a=Rs.glyphScale,s=document.createElement("span");s.setAttribute("aria-hidden","true"),s.setAttribute("data-venue-icon",o.key),s.style.lineHeight="0",s.innerHTML=`<svg width="${i}" height="${i}" viewBox="0 0 24 24"><circle cx="12" cy="12" r="11.25" fill="${As[o.group]}" stroke="${Oi}" stroke-width="1.5"/><path transform="translate(${12-12*a} ${12-12*a}) scale(${a})" d="${o.solid}" fill="${Oi}"/></svg>`,t.prepend(s)}dressGateTag(t,n){let o=t.style;o.background="#0f172a",o.color="#ffffff",o.border="1px solid rgba(255,255,255,0.28)",o.textTransform="uppercase",o.letterSpacing="0.06em",o.display="inline-flex",o.alignItems="center",o.gap="5px";let r=document.createElement("span");if(r.setAttribute("aria-hidden","true"),r.setAttribute("data-gate-arrow",n.icon==="exit"?"out":"in"),r.innerHTML=n.icon==="exit"?'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 1.5H2v9h3"/><path d="M5.5 6h5M8.5 3.5 11 6 8.5 8.5"/></svg>':'<svg width="12" height="12" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M7 1.5h3v9H7"/><path d="M1 6h5.5M4 3.5 6.5 6 4 8.5"/></svg>',t.prepend(r),n.stepFree){let i=document.createElement("span");i.setAttribute("data-gate-step-free","true"),i.setAttribute("aria-label","Step-free"),i.style.lineHeight="0",i.innerHTML=Qi("wheelchair",{size:11}),t.append(i)}t.dataset.qualityContrast=jn([1,1,1],Wn("#0f172a")).toFixed(3)}dressAreaTag(t,n){let o=n.count??0;if(t.toggleAttribute("data-area-quiet",n.muted===!0),n.muted&&o<=0&&(t.style.opacity=String(xS)),o<=0){t.removeAttribute("data-area-count");return}t.setAttribute("data-area-count",String(o)),t.style.border=`2px solid ${Un}`;let r=document.createElement("span");r.textContent=String(o);let i=r.style;i.display="inline-block",i.minWidth="1.2em",i.textAlign="center",i.marginLeft="6px",i.padding="1px 6px",i.borderRadius="999px",i.background=Un,i.color=lc,i.fontWeight="800",i.fontSize="0.9em",i.lineHeight="1.2",i.verticalAlign="middle",t.appendChild(r)}dressSectionTag(t,n,o){let r=n.tint?bS(n.tint):null,i=t.style;if(r&&(i.background=r.fill,i.color=r.ink,i.border=`1px solid ${r.border}`,t.dataset.qualityContrast=r.contrast.toFixed(3)),o<=0)return;let a=document.createElement("span");a.setAttribute("data-wheelchair-free",String(o)),a.setAttribute("aria-label",`${o} wheelchair ${o===1?"place":"places"} free`),a.innerHTML=`${Qi("wheelchair",{size:11})}<span>${o}</span>`;let s=a.style;s.display="inline-flex",s.alignItems="center",s.gap="2px",s.marginLeft="6px",s.padding="1px 5px",s.borderRadius="999px",s.background="#2563eb",s.color="#ffffff",s.fontSize="0.85em",s.lineHeight="1.2",s.verticalAlign="middle",t.appendChild(a)}paintAccessChip(t,n){t.setAttribute("data-label-kind","access"),t.setAttribute("data-access-type",n.icon??""),t.innerHTML=n.icon?Qi(n.icon,{size:Do-6}):"",t.setAttribute("role","img"),t.setAttribute("aria-label",n.text);let o=t.style;return o.width=`${Do}px`,o.height=`${Do}px`,o.alignItems="center",o.justifyContent="center",o.borderRadius="50%",o.background=n.color??"#3b82f6",o.color=n.ink??"#ffffff",o.border="1.5px solid #ffffff",o.boxShadow="0 2px 6px rgba(0,0,0,.35)",o.padding="0",o.lineHeight="0",o.boxSizing="border-box",t.dataset.qualityContrast=jn(Wn(n.ink??"#ffffff")??[1,1,1],Wn(n.color??"#3b82f6")??[.23,.51,.96]).toFixed(3),t}placePinHeads(t){for(;this.pinHeads.length<t.length;){let n=document.createElement("div");n.setAttribute("data-pin-head",""),n.setAttribute("aria-hidden","true");let o=n.style;o.position="absolute",o.left="0",o.top="0",o.width=`${ld}px`,o.height=`${ld}px`,o.borderRadius="50%",o.background=Un,o.boxShadow="0 0 0 3px rgba(255,255,255,.28), 0 0 14px rgba(255,255,255,.55), 0 3px 8px rgba(0,0,0,.45)",o.pointerEvents="none",this.root.appendChild(n),this.pinHeads.push(n)}this.pinHeads.forEach((n,o)=>{let r=t[o];n.style.display=r?"":"none",r&&(n.style.transform=`translate(-50%, -100%) translate(${r.x.toFixed(1)}px, ${r.y.toFixed(1)}px)`)})}dispose(){this.pinHeads=[],this.root.remove(),this.nodes.clear()}};var gd=1;var RS=new Set(["floor","stage","zone","section","ga","booth","annotation"]);function ES(e){return e.every(t=>Number.isFinite(t))}function IS(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 bd(e){return e.length?Math.round(Math.min(...e)*100)/100:null}function Xn(e){return Math.round(e*1e4)/1e4}function _S(e){if(e)return{box:{x:Xn(e.box.x),y:Xn(e.box.y),width:Xn(e.box.width),height:Xn(e.box.height)},horizontalFillRatio:Xn(e.horizontalFillRatio),verticalFillRatio:Xn(e.verticalFillRatio),visibleAreaRatio:Xn(e.visibleAreaRatio),clippedEdges:[...e.clippedEdges]}}function nn(e,t,n){return n.length?{code:e,message:t,count:n.length,samples:n.slice(0,20)}:null}function ea(e){let t=e.labels.filter(s=>s.visible&&s.screenBox),n=t.filter(s=>RS.has(s.kind)),o=e.scene.floorCount>1?e.scene.floorCount:e.scene.zoneCount||e.scene.sectionCount,r=[];for(let s=0;s<n.length;s+=1)for(let c=0;c<s;c+=1)IS(n[s].screenBox,n[c].screenBox)&&r.push({primaryId:n[s].id,primaryLabel:n[s].text,secondaryId:n[c].id});let i=[...e.camera.position,e.camera.distance,e.camera.verticalFovDeg],a=[nn("webgl2-unavailable","The venue scene must render through WebGL2",e.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),nn("context-lost","The WebGL context must be live at capture",e.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),nn("frame-not-stable","The captured 3D frame must be rendered and parked",e.frame.rendered>0&&e.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),nn("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}`}]),nn("camera-invalid","The capture camera must have a finite physical pose",ES(i)&&e.camera.distance>0&&e.camera.verticalFovDeg>0&&e.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),nn("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}]),nn("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",o===0||n.length>0?[]:[{primaryId:"labels",primaryLabel:`${o} expected hierarchy labels`}]),nn("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}))),nn("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}))),nn("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",r)].filter(s=>!!s);return{version:1,state:"venue3d",passed:a.length===0,resolvedRules:["rendered-3d-webgl-context","rendered-3d-stable-frame","rendered-3d-camera-pose","rendered-3d-relief-projection","rendered-3d-label-size","rendered-3d-label-contrast","rendered-3d-label-collision"],viewport:e.viewport,context:e.context,frame:e.frame,camera:e.camera,scene:e.scene,composition:{visibleLabels:t.map(({id:s,kind:c,text:l})=>({id:s,kind:c,text:l})).sort((s,c)=>s.kind.localeCompare(c.kind)||s.id.localeCompare(c.id)),framing:_S(e.framing)},metrics:{minimumHierarchyFontPx:bd(n.map(s=>s.renderedFontPx)),minimumHierarchyContrast:bd(n.map(s=>s.contrast)),projectedReliefPx:Math.round(e.scene.projectedReliefPx*100)/100},findings:a}}function yd(e,t,n){e.fill(0);for(let o=0;o<Math.min(n,t.length);o++)e[t[o]]=1}var it=require("ogl");function CS(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}var fc=128;function xd(e,t,n,o,r){if(!(o>=0&&o<t&&r>=0&&r<n))return!1;let i=(r*t+o)*4;return e[i]===0&&e[i+1]===0&&e[i+2]===0&&Math.abs(e[i+3]-fc)<=8}function Md(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=CS(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let h=l-o,f=c-r,d=h*h+f*f;d<s&&(s=d,a=m)}return a}function vd(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var Pn=require("ogl");var ta=`
|
|
66
80
|
float chairWeight(float depth) {
|
|
67
81
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
68
|
-
}`,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
82
|
+
}`,dc=`
|
|
83
|
+
const float TIP_SIN = ${Math.sin(Ra*Math.PI/180).toFixed(4)};
|
|
84
|
+
const float TIP_COS = ${Math.cos(Ra*Math.PI/180).toFixed(4)};
|
|
85
|
+
vec3 tipUpPad(vec3 p, float halfWidth, float up) {
|
|
86
|
+
if (up < 0.5) return p;
|
|
87
|
+
float hingeZ = (${il.toFixed(2)}) * halfWidth + ${al.toFixed(2)};
|
|
88
|
+
float dy = p.y - ${Aa.toFixed(2)};
|
|
89
|
+
float dz = p.z - hingeZ;
|
|
90
|
+
return vec3(p.x,
|
|
91
|
+
${Aa.toFixed(2)} + dz * TIP_SIN + dy * TIP_COS,
|
|
92
|
+
hingeZ + dz * TIP_COS - dy * TIP_SIN);
|
|
93
|
+
}
|
|
94
|
+
vec3 tipUpNormal(vec3 n, float up) {
|
|
95
|
+
if (up < 0.5) return n;
|
|
96
|
+
return vec3(n.x, n.z * TIP_SIN + n.y * TIP_COS, n.z * TIP_COS - n.y * TIP_SIN);
|
|
97
|
+
}`,pc=`
|
|
74
98
|
float glyphEq(float glyph, float expected) {
|
|
75
99
|
return 1.0 - step(0.25, abs(glyph - expected));
|
|
76
100
|
}
|
|
@@ -103,7 +127,9 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
103
127
|
else if (bench > 0.5) { p.x *= 1.10; p.z *= 0.82; }
|
|
104
128
|
} else if (partId < 2.5) {
|
|
105
129
|
if (stool > 0.5) return vec3(0.0);
|
|
106
|
-
|
|
130
|
+
// A dining chair's back is a panel held clear of the seat on its two rear
|
|
131
|
+
// legs: open under it, where an auditorium seat is closed to the pad.
|
|
132
|
+
if (dining > 0.5) { p.x *= 0.78; p.y = ${dn.toFixed(2)} - (${dn.toFixed(2)} - p.y) * ${ol.toFixed(2)}; }
|
|
107
133
|
else if (folding > 0.5) { p.x *= 0.90; p.y = 0.45 + (p.y - 0.45) * 0.72; }
|
|
108
134
|
else if (bench > 0.5) { p.x *= 1.10; p.y = 0.45 + (p.y - 0.45) * 0.62; }
|
|
109
135
|
} else if (partId < 3.5) {
|
|
@@ -115,11 +141,31 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
115
141
|
if (max(max(dining, folding), bench) < 0.5) return vec3(0.0);
|
|
116
142
|
if (folding > 0.5) p.x *= 0.88;
|
|
117
143
|
if (bench > 0.5) p.x *= 1.10;
|
|
118
|
-
|
|
119
|
-
|
|
144
|
+
if (dining > 0.5) {
|
|
145
|
+
// Slim legs set in under the seat. The rear pair stand behind the pad and
|
|
146
|
+
// carry on up into the foot of the back, so the back is held by the
|
|
147
|
+
// chair's own frame and daylight shows between it and the seat.
|
|
148
|
+
p.x = sign(p.x) * (${el.toFixed(2)} + (abs(p.x) - 0.72) * ${Wr.toFixed(2)});
|
|
149
|
+
if (p.z > 0.0) p.z = ${tl.toFixed(2)} + (p.z - 0.59) * ${Wr.toFixed(2)};
|
|
150
|
+
else {
|
|
151
|
+
p.z = ${nl.toFixed(2)} + (p.z + 0.59) * ${Wr.toFixed(2)};
|
|
152
|
+
if (p.y > 0.2) p.y = ${rl.toFixed(2)};
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
} else if (partId < 6.5) {
|
|
156
|
+
// The spine joins the back to the seat, so it goes where the back goes:
|
|
157
|
+
// as wide as that furniture's back, and gone where there is no back.
|
|
158
|
+
// A dining chair's back stands on its rear legs instead (see the legs).
|
|
159
|
+
if (max(stool, dining) > 0.5) return vec3(0.0);
|
|
160
|
+
if (folding > 0.5) p.x *= 0.90;
|
|
161
|
+
else if (bench > 0.5) p.x *= 1.10;
|
|
162
|
+
} else if (partId < 7.5) {
|
|
163
|
+
// Armrest standards are fixed auditorium seating; every other furniture
|
|
164
|
+
// family either has its own arms or has none.
|
|
165
|
+
if (generic < 0.5) return vec3(0.0);
|
|
120
166
|
}
|
|
121
167
|
return p;
|
|
122
|
-
}`,
|
|
168
|
+
}`,TS=1.5,No=`
|
|
123
169
|
uniform vec4 uSeeThrough; // xyz = the seats looked at, w = cone radius there; 0 = off
|
|
124
170
|
bool seeThroughCut(vec3 p, vec3 eye) {
|
|
125
171
|
if (uSeeThrough.w <= 0.0) return false;
|
|
@@ -128,11 +174,11 @@ bool seeThroughCut(vec3 p, vec3 eye) {
|
|
|
128
174
|
if (len < 1.0) return false;
|
|
129
175
|
vec3 dir = axis / len;
|
|
130
176
|
float t = dot(p - eye, dir);
|
|
131
|
-
if (t <= 0.0 || t > len - ${
|
|
177
|
+
if (t <= 0.0 || t > len - ${TS.toFixed(2)}) return false;
|
|
132
178
|
vec3 onLine = eye + dir * t;
|
|
133
179
|
if (p.y < onLine.y - 0.25) return false;
|
|
134
180
|
return length(p - onLine) < uSeeThrough.w * t / len;
|
|
135
|
-
}`,
|
|
181
|
+
}`,kS=`#version 300 es
|
|
136
182
|
precision highp float;
|
|
137
183
|
in vec3 position;
|
|
138
184
|
in vec3 normal;
|
|
@@ -170,13 +216,60 @@ void main() {
|
|
|
170
216
|
vNormalWorld = normalize(mat3(modelMatrix) * normal);
|
|
171
217
|
vColor = color;
|
|
172
218
|
gl_Position = projectionMatrix * mv;
|
|
173
|
-
}`,
|
|
219
|
+
}`,Sd=`
|
|
174
220
|
bool roomWallHidden(float material, vec3 normalWorld, vec3 posWorld, vec3 eye, vec2 roomCentre) {
|
|
175
221
|
if (abs(material - 6.0) > 0.5) return false;
|
|
176
222
|
vec3 n = normalize(normalWorld);
|
|
177
223
|
if (abs(n.y) > 0.5) return true;
|
|
178
224
|
return dot(n.xz, eye.xz - posWorld.xz) * dot(n.xz, roomCentre - posWorld.xz) <= 0.0;
|
|
179
|
-
}`,
|
|
225
|
+
}`,wd=`
|
|
226
|
+
uniform vec3 uTop;
|
|
227
|
+
uniform vec3 uBottom;
|
|
228
|
+
uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
|
|
229
|
+
uniform vec3 uZenith;
|
|
230
|
+
uniform vec3 uHorizon;
|
|
231
|
+
// uv: the pixel's place on screen, 0..1. dir: its line of sight, used only under a sky.
|
|
232
|
+
vec3 backdrop(vec2 uv, vec3 dir) {
|
|
233
|
+
vec3 col = mix(uBottom, uTop, uv.y);
|
|
234
|
+
vec2 c = uv - 0.5;
|
|
235
|
+
col *= 1.0 - dot(c, c) * 0.16; // soft vignette
|
|
236
|
+
// Above the horizon an open-air venue has a sky, not the chart's flat
|
|
237
|
+
// backdrop: from a seat, the stands used to meet a black void. Below the
|
|
238
|
+
// horizon (every overview) nothing changes.
|
|
239
|
+
if (uSky > 0.5) {
|
|
240
|
+
vec3 sky = mix(uHorizon, uZenith, pow(clamp(dir.y, 0.0, 1.0), 0.45));
|
|
241
|
+
// Reaching a little below the horizon too: from a low seat the far stands
|
|
242
|
+
// top out right at it, and a sliver of backdrop showed as a dark band.
|
|
243
|
+
// Every overview looks further down than this (at least ~24 degrees).
|
|
244
|
+
col = mix(col, sky, smoothstep(-0.22, 0.03, dir.y));
|
|
245
|
+
}
|
|
246
|
+
return col;
|
|
247
|
+
}`,LS=`
|
|
248
|
+
// A fixed 4 by 4 threshold pattern: a net thinned by it reads as a fine mesh,
|
|
249
|
+
// where random grain would read as dirt.
|
|
250
|
+
float orderedThreshold(vec2 pixel) {
|
|
251
|
+
const float m[16] = float[16](0.0, 8.0, 2.0, 10.0, 12.0, 4.0, 14.0, 6.0, 3.0, 11.0, 1.0, 9.0, 15.0, 7.0, 13.0, 5.0);
|
|
252
|
+
ivec2 i = ivec2(mod(pixel, 4.0));
|
|
253
|
+
return (m[i.x + i.y * 4] + 0.5) / 16.0;
|
|
254
|
+
}
|
|
255
|
+
const float NET_MESH_M = 0.12; // one mesh of a goal net
|
|
256
|
+
const float NET_CORD = 0.07; // half a cord's width, in meshes (drawn heavier than life)
|
|
257
|
+
const float NET_VEIL = 0.3; // how much of a distant net shows
|
|
258
|
+
// place: the point's place on its panel, metres (carried where a colour would be).
|
|
259
|
+
float netShown(vec2 place) {
|
|
260
|
+
vec2 mesh = place / NET_MESH_M;
|
|
261
|
+
vec2 w = fwidth(mesh); // meshes per pixel
|
|
262
|
+
vec2 toCord = 0.5 - abs(fract(mesh) - 0.5);
|
|
263
|
+
vec2 cord = 1.0 - smoothstep(NET_CORD - w, NET_CORD + w, toCord);
|
|
264
|
+
// Cords while a mesh is a dozen pixels or more; a veil once it is under six.
|
|
265
|
+
float crisp = 1.0 - smoothstep(0.08, 0.16, max(w.x, w.y));
|
|
266
|
+
return mix(NET_VEIL, max(cord.x, cord.y), crisp);
|
|
267
|
+
}
|
|
268
|
+
// A part a few centimetres thick: in full while a pixel covers 2.5 cm of it or
|
|
269
|
+
// less, gone by 4.5. pixelM: the world size of this pixel, metres.
|
|
270
|
+
float slenderShown(float pixelM) {
|
|
271
|
+
return 1.0 - smoothstep(0.025, 0.045, pixelM);
|
|
272
|
+
}`,OS=`#version 300 es
|
|
180
273
|
precision highp float;
|
|
181
274
|
in vec3 vColor;
|
|
182
275
|
in vec3 vNormalWorld;
|
|
@@ -186,6 +279,8 @@ in vec3 vPosWorld;
|
|
|
186
279
|
in float vDim;
|
|
187
280
|
in float vMaterial;
|
|
188
281
|
uniform vec3 uKeyDir; // WORLD space, unit, points at the light
|
|
282
|
+
uniform vec3 uKeyColor; // the look's tint of the key light (1 = white)
|
|
283
|
+
uniform vec3 uAmbientColor; // ...and of the ambient and fill
|
|
189
284
|
uniform float uStructureDetail;
|
|
190
285
|
uniform float uRoughness;
|
|
191
286
|
uniform vec3 uDeckColor;
|
|
@@ -195,9 +290,12 @@ uniform sampler2D tVenueShadow;
|
|
|
195
290
|
uniform mat4 uShadowMatrix;
|
|
196
291
|
uniform vec3 cameraPosition;
|
|
197
292
|
uniform vec2 uRoomCentre;
|
|
293
|
+
uniform vec2 uViewport; // drawing buffer size, pixels
|
|
198
294
|
out vec4 fragColor;
|
|
199
|
-
${
|
|
200
|
-
${
|
|
295
|
+
${Sd}
|
|
296
|
+
${No}
|
|
297
|
+
${wd}
|
|
298
|
+
${LS}
|
|
201
299
|
// Stable world-space variation; no textures or per-frame random grain.
|
|
202
300
|
float turfHash(vec2 p) {
|
|
203
301
|
vec3 q = fract(vec3(p.xyx) * 0.1031);
|
|
@@ -238,6 +336,36 @@ void main() {
|
|
|
238
336
|
if (vDim > 0.5) discard;
|
|
239
337
|
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
240
338
|
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
339
|
+
// Stage light (material 12, stageDressing.ts): the drape behind a stage and
|
|
340
|
+
// the lamps along it. It is light, not a surface: it is drawn in exactly its
|
|
341
|
+
// own colour, whatever the venue's rig does, and only from the side it faces,
|
|
342
|
+
// so the overview from behind a stage still looks over a low backdrop.
|
|
343
|
+
if (abs(vMaterial - 12.0) < 0.5) {
|
|
344
|
+
if (dot(vNormalWorld, cameraPosition - vPosWorld) <= 0.0) discard;
|
|
345
|
+
fragColor = vec4(vColor, 1.0);
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
// A step nosing (material 7, see sectionAisles.ts) is a 5 cm strip. It is
|
|
349
|
+
// drawn in full only while a pixel covers about a centimetre of it or less,
|
|
350
|
+
// so it is four or five pixels deep, and it is gone by three: a short
|
|
351
|
+
// screen-door band between the two, never a thin line. Drawn at every
|
|
352
|
+
// distance, the first nosing thinned to a dash on every step and made a
|
|
353
|
+
// zig-zag down each section edge. The tread it lies on is underneath, so a
|
|
354
|
+
// dropped fragment shows the plain step.
|
|
355
|
+
if (abs(vMaterial - 7.0) < 0.5) {
|
|
356
|
+
float nosingPixel = max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld)));
|
|
357
|
+
float nosingShown = 1.0 - smoothstep(0.011, 0.016, nosingPixel);
|
|
358
|
+
float nosingStipple = fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453);
|
|
359
|
+
if (nosingStipple >= nosingShown) discard;
|
|
360
|
+
}
|
|
361
|
+
// Sport fittings: a slender part thins out like a nosing, a net is cords up
|
|
362
|
+
// close and a veil further off (see FITTINGS_GLSL).
|
|
363
|
+
bool net = abs(vMaterial - 10.0) < 0.5;
|
|
364
|
+
if (abs(vMaterial - 11.0) < 0.5) {
|
|
365
|
+
float shown = slenderShown(max(length(dFdx(vPosWorld)), length(dFdy(vPosWorld))));
|
|
366
|
+
if (fract(sin(dot(gl_FragCoord.xy, vec2(12.9898, 78.233))) * 43758.5453) >= shown) discard;
|
|
367
|
+
}
|
|
368
|
+
if (net && orderedThreshold(gl_FragCoord.xy) >= netShown(vColor.rg)) discard;
|
|
241
369
|
// Row treads (material 3) and risers (material 2) are chart truth: the
|
|
242
370
|
// stepped deck IS the stand, at every distance. What must not survive at
|
|
243
371
|
// whole-venue scale is the risers' darker shade \u2014 hundreds of sub-pixel dark
|
|
@@ -255,6 +383,8 @@ void main() {
|
|
|
255
383
|
// Risers are baked at 0.72 of their tread (see tiers.ts bandColors); lift
|
|
256
384
|
// them back to the tread colour as detail fades out.
|
|
257
385
|
vec3 vColorRung = vColor * mix(mix(1.0 / 0.72, 1.0, uStructureDetail), 1.0, 1.0 - riser);
|
|
386
|
+
// A net's vertex colour is its place on the panel, not a colour.
|
|
387
|
+
if (net) vColorRung = vec3(0.90, 0.92, 0.95);
|
|
258
388
|
// Concrete remains visible at overview instead of painting the entire
|
|
259
389
|
// seating deck like upholstery. Keep a category tint for navigation;
|
|
260
390
|
// filtering retains its existing shell color cues.
|
|
@@ -276,6 +406,22 @@ void main() {
|
|
|
276
406
|
* mix(0.10, 0.055, concreteSurface) * fine;
|
|
277
407
|
vColorRung *= 1.0 + variation;
|
|
278
408
|
}
|
|
409
|
+
if (abs(vMaterial - 13.0) < 0.5 && vNormalWorld.y > 0.5) {
|
|
410
|
+
// A standing area's floor (objectBuilders.ts STANDING_FLOOR_MATERIAL) is
|
|
411
|
+
// event flooring in the area's own colour: panels 1.2 m square in a
|
|
412
|
+
// staggered bond, a fine joint between them, each panel a shade apart.
|
|
413
|
+
// Joints and shades fade out before a panel is a few pixels wide, so a
|
|
414
|
+
// distant field is one even colour and never a moire.
|
|
415
|
+
vec2 panel = vPosWorld.xz / 1.2;
|
|
416
|
+
vec2 footprint = fwidth(panel);
|
|
417
|
+
float resolved = 1.0 - smoothstep(0.035, 0.11, max(footprint.x, footprint.y));
|
|
418
|
+
panel.x += 0.5 * mod(floor(panel.y), 2.0);
|
|
419
|
+
vec2 toJoint = 0.5 - abs(fract(panel) - 0.5);
|
|
420
|
+
vec2 line = 1.0 - smoothstep(vec2(0.0), max(footprint, vec2(0.012)), toJoint);
|
|
421
|
+
float shade = turfHash(floor(panel)) - 0.5;
|
|
422
|
+
vColorRung *= 1.0 + resolved * (shade * 0.07 - max(line.x, line.y) * 0.20);
|
|
423
|
+
vColorRung *= 1.0 + (turfNoise(vPosWorld.xz * 0.32) - 0.5) * 0.07;
|
|
424
|
+
}
|
|
279
425
|
// Unresolved row faces need the same lighting, not merely the same paint:
|
|
280
426
|
// alternating vertical/horizontal normals otherwise recreate a moire comb.
|
|
281
427
|
float rowOverview = max(tread, riser) * (1.0 - uStructureDetail);
|
|
@@ -294,14 +440,17 @@ void main() {
|
|
|
294
440
|
// The fill keeps the turned faces from going charcoal: at 0.10 a wall facing
|
|
295
441
|
// away from the sun kept about half its colour, and the walls under every
|
|
296
442
|
// tier and box read as dark blocks (owner, 2026-09-24).
|
|
297
|
-
|
|
443
|
+
// The look tints the light, never the surface: the same concrete under an
|
|
444
|
+
// amber house and under floodlights (see looks.ts). White for no look.
|
|
445
|
+
vec3 base = vColorRung * ((0.34 + 0.26 * hemi) * mix(0.72, 1.0, visibility) * uAmbientColor
|
|
446
|
+
+ key * 0.60 * uKeyColor + fill * 0.26 * uAmbientColor);
|
|
298
447
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
299
448
|
// Material 1 is a powered display and keeps its authored emission treatment.
|
|
300
449
|
// Every architectural material uses the venue roughness token; 0.78 maps to
|
|
301
450
|
// exactly the historical rim strength so an unthemed chart does not shift.
|
|
302
451
|
float poweredMaterial = 1.0 - step(0.5, abs(vMaterial - 1.0));
|
|
303
452
|
float sheen = mix(clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0), 1.0, poweredMaterial);
|
|
304
|
-
float concreteSheen = abs(vMaterial - 5.0) < 0.5 ? 0.45 : 1.0;
|
|
453
|
+
float concreteSheen = (abs(vMaterial - 5.0) < 0.5 || abs(vMaterial - 13.0) < 0.5) ? 0.45 : 1.0;
|
|
305
454
|
base += vec3(0.26, 0.31, 0.38) * fres * 0.16 * sheen * (1.0 - rowOverview) * concreteSheen; // cool rim, restrained
|
|
306
455
|
// Bright, saturated authored screen faces should read as powered displays,
|
|
307
456
|
// not painted slabs. Vertex colour is deliberately the material signal here:
|
|
@@ -327,9 +476,18 @@ void main() {
|
|
|
327
476
|
+ vec3(0.62, 0.46, 0.20) * band * 0.28
|
|
328
477
|
+ vec3(0.20, 0.10, 0.34) * focalHalo;
|
|
329
478
|
base = mix(base, display, poweredDisplay * verticalFace * 0.92);
|
|
479
|
+
// The site's open land (material 8 at the paving, rising to 9 at its outer
|
|
480
|
+
// edge: bounds.ts emitSite) dissolves into the backdrop behind it, so the
|
|
481
|
+
// venue stands on ground that has no rim. Matched to the backdrop pixel for
|
|
482
|
+
// pixel: a rim painted one fixed colour showed as a pale disc.
|
|
483
|
+
if (vMaterial > 7.5 && vMaterial < 9.5) {
|
|
484
|
+
float out_ = smoothstep(0.0, 1.0, clamp(vMaterial - 8.0, 0.0, 1.0));
|
|
485
|
+
base = mix(base, backdrop(gl_FragCoord.xy / uViewport, normalize(vPosWorld - cameraPosition)), out_);
|
|
486
|
+
}
|
|
330
487
|
fragColor = vec4(base, 1.0);
|
|
331
|
-
}`,
|
|
332
|
-
${
|
|
488
|
+
}`,Pd=`
|
|
489
|
+
${pc}
|
|
490
|
+
${dc}
|
|
333
491
|
vec4 seatSurface(vec3 source, float radius) {
|
|
334
492
|
vec4 origin = modelViewMatrix * vec4(iOffset, 1.0);
|
|
335
493
|
if (iPhysicalSeat < 0.5) {
|
|
@@ -343,12 +501,13 @@ vec4 seatSurface(vec3 source, float radius) {
|
|
|
343
501
|
if (surface < 0.5) return origin;
|
|
344
502
|
vec3 p = glyphChairPosition(source, surface, iGlyph);
|
|
345
503
|
p.xz *= iChairWidth;
|
|
346
|
-
if (surface
|
|
504
|
+
if (surface < 1.5) p = tipUpPad(p, iChairWidth, iTipUp);
|
|
505
|
+
if (surface > 1.5) p.z -= max(p.y - ${sn.toFixed(2)}, 0.0) * ${Ko.toFixed(2)} * glyphBackRake(iGlyph);
|
|
347
506
|
float c = cos(iYaw), s = sin(iYaw);
|
|
348
507
|
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
349
508
|
return modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
350
509
|
}
|
|
351
|
-
`,
|
|
510
|
+
`,FS=`#version 300 es
|
|
352
511
|
precision highp float;
|
|
353
512
|
in float surface;
|
|
354
513
|
in float iYaw;
|
|
@@ -362,6 +521,7 @@ in vec3 iColor; // per-instance state colour (resolved CPU-side)
|
|
|
362
521
|
in float iMaxRadius; // per-instance world-radius ceiling (seat pitch derived)
|
|
363
522
|
in float iHasChair;
|
|
364
523
|
in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
|
|
524
|
+
in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
|
|
365
525
|
in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
|
|
366
526
|
in float iFloor; // owning floor index
|
|
367
527
|
in float iSection; // owning section index, -1 = none
|
|
@@ -388,9 +548,9 @@ out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
|
|
|
388
548
|
out float vPhysicalSeat;
|
|
389
549
|
out float vPixelRadius;
|
|
390
550
|
uniform vec3 cameraPosition;
|
|
391
|
-
${
|
|
392
|
-
${
|
|
393
|
-
${
|
|
551
|
+
${ta}
|
|
552
|
+
${Pd}
|
|
553
|
+
${No}
|
|
394
554
|
void main() {
|
|
395
555
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
396
556
|
vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
|
|
@@ -412,8 +572,9 @@ void main() {
|
|
|
412
572
|
mv = seatSurface(position, r);
|
|
413
573
|
// Match the shell's non-uniform width/depth scale before its back rake.
|
|
414
574
|
vec3 n = vec3(normal.x / iChairWidth, normal.y, normal.z / iChairWidth);
|
|
415
|
-
if (surface > 1.5) n.y += n.z * ${
|
|
575
|
+
if (surface > 1.5) n.y += n.z * ${Ko.toFixed(2)} * glyphBackRake(iGlyph);
|
|
416
576
|
n = normalize(n);
|
|
577
|
+
if (surface > 0.5 && surface < 1.5) n = tipUpNormal(n, iTipUp);
|
|
417
578
|
vSeatNormal = vec3(n.x * cos(iYaw) + n.z * sin(iYaw), n.y, -n.x * sin(iYaw) + n.z * cos(iYaw));
|
|
418
579
|
vSeatHeight = position.y;
|
|
419
580
|
vSeatSurface = step(1.5, surface);
|
|
@@ -424,18 +585,20 @@ void main() {
|
|
|
424
585
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
425
586
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
426
587
|
gl_Position = projectionMatrix * mv;
|
|
427
|
-
}`,
|
|
588
|
+
}`,Ad=`
|
|
428
589
|
float seatSilhouette(vec2 uv, float physical) {
|
|
429
590
|
// Solid furniture owns its silhouette in geometry. Only empty bays need
|
|
430
591
|
// a fragment mask; cutting physical faces would open holes in the volume.
|
|
431
592
|
return mix(max(abs(uv.x), abs(uv.y)), 0.0, physical);
|
|
432
593
|
}
|
|
433
|
-
`,
|
|
594
|
+
`,DS=`#version 300 es
|
|
434
595
|
precision highp float;
|
|
435
596
|
in vec3 vSeatNormal;
|
|
436
597
|
in float vSeatHeight;
|
|
437
598
|
in float vSeatSurface;
|
|
438
599
|
uniform vec3 uKeyDir;
|
|
600
|
+
uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
|
|
601
|
+
uniform vec3 uAmbientColor;
|
|
439
602
|
in vec2 vUv;
|
|
440
603
|
in vec3 vColor;
|
|
441
604
|
in float vBudget;
|
|
@@ -450,7 +613,7 @@ uniform float uSeatDetail; // 0 for venue/area overview; 1 in section/row/sea
|
|
|
450
613
|
uniform vec3 uFadeColor;
|
|
451
614
|
uniform float uRoughness;
|
|
452
615
|
out vec4 fragColor;
|
|
453
|
-
${
|
|
616
|
+
${Ad}
|
|
454
617
|
void main() {
|
|
455
618
|
if (vDim > 0.5) discard;
|
|
456
619
|
// Same screen-door dissolve as the structure rung (uStructureDetail): the
|
|
@@ -471,7 +634,15 @@ void main() {
|
|
|
471
634
|
float fill = max(dot(N, normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z))), 0.0);
|
|
472
635
|
float ao = mix(0.58, 1.0, clamp(vSeatHeight / 0.92, 0.0, 1.0));
|
|
473
636
|
float partShade = mix(1.10, 0.80, vSeatSurface);
|
|
474
|
-
vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) + key * 0.28 + fill * 0.16);
|
|
637
|
+
vec3 c = vColor * (partShade * ao * (0.60 + 0.30 * hemi) * uAmbientColor + key * 0.28 * uKeyColor + fill * 0.16 * uAmbientColor);
|
|
638
|
+
// The far seat is two boxes, and a box face is one flat value. Each face
|
|
639
|
+
// darkens toward its own edges instead, so the pad and the back read as
|
|
640
|
+
// cushions and the row matches the rounded near chair it hands over to (see
|
|
641
|
+
// seatChair.ts) without a single extra triangle. Only once a seat is several
|
|
642
|
+
// pixels across: below that the falloff would be sub-pixel noise.
|
|
643
|
+
vec2 edge = vUv * vUv;
|
|
644
|
+
float cushion = (1.0 - edge.x * edge.x) * (1.0 - edge.y * edge.y);
|
|
645
|
+
c *= mix(1.0, mix(0.78, 1.06, cushion), vPhysicalSeat * smoothstep(3.0, 7.0, vPixelRadius));
|
|
475
646
|
c = mix(c, uFadeColor, uSeatFade);
|
|
476
647
|
// Accommodation ring \u2014 the 3D echo of the coloured ring 2D draws around every
|
|
477
648
|
// accessible seat. Painted INSIDE the dot's own radius rather than outside it,
|
|
@@ -515,11 +686,11 @@ void main() {
|
|
|
515
686
|
c = mix(c, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
516
687
|
}
|
|
517
688
|
fragColor = vec4(c, alpha);
|
|
518
|
-
}`,
|
|
689
|
+
}`,NS=`#version 300 es
|
|
519
690
|
precision highp float;
|
|
520
691
|
in vec3 position; // local: x/z in units of the seat radius, y in METRES
|
|
521
692
|
in vec3 normal;
|
|
522
|
-
in float part; // 0..
|
|
693
|
+
in float part; // 0..7 furniture modules (see CHAIR_PART)
|
|
523
694
|
in vec3 iOffset; // per-instance world deck point (identical to the dot's)
|
|
524
695
|
in vec3 iColor; // per-instance state colour
|
|
525
696
|
in float iRadius; // per-instance horizontal half-width, world metres
|
|
@@ -527,9 +698,11 @@ in float iYaw; // per-instance facing, radians (local +Z -> facing dir)
|
|
|
527
698
|
in vec3 iRing; // accommodation ring colour; (0,0,0) = not accessible
|
|
528
699
|
in float iFloor;
|
|
529
700
|
in float iSection; // owning section index, -1 = none
|
|
530
|
-
in float
|
|
701
|
+
in float iTaken; // 1 = sold or held: not for sale
|
|
531
702
|
in float iPhysicalSeat;// 1 = chair; 0 = empty wheelchair bay
|
|
532
703
|
in float iGlyph; // stable SEAT_GLYPH_ORDER index
|
|
704
|
+
in vec4 iArmrests; // xy / zw = world offsets (x, z) of the two armrests; 0 = none
|
|
705
|
+
in float iTipUp; // 1 = an empty tip-up seat, drawn folded against its back
|
|
533
706
|
uniform mat4 modelViewMatrix;
|
|
534
707
|
uniform mat4 projectionMatrix;
|
|
535
708
|
uniform float uChairFull;
|
|
@@ -548,14 +721,14 @@ out float vHeight; // local height in metres, for the vertical occlusion ramp
|
|
|
548
721
|
out vec3 vRing;
|
|
549
722
|
out float vDim;
|
|
550
723
|
out float vSectionFade;
|
|
551
|
-
out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
|
|
552
|
-
out vec3 vOccupantTint;
|
|
553
724
|
out float vTaken; // 1 = sold or held: not for sale
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
${
|
|
725
|
+
out vec3 vLocal; // x/z in chair half-widths, y in metres: where on the chair
|
|
726
|
+
out vec3 vViewWorld;// from the surface to the eye, world space (not unit)
|
|
727
|
+
${ta}
|
|
728
|
+
${pc}
|
|
729
|
+
${dc}
|
|
557
730
|
uniform vec3 cameraPosition;
|
|
558
|
-
${
|
|
731
|
+
${No}
|
|
559
732
|
void main() {
|
|
560
733
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
561
734
|
vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
|
|
@@ -569,80 +742,68 @@ void main() {
|
|
|
569
742
|
// chairs, but nobody gets a short one (people are the same height at every
|
|
570
743
|
// seat pitch).
|
|
571
744
|
vec3 p = position;
|
|
572
|
-
|
|
573
|
-
//
|
|
574
|
-
// One instanced mesh draws both an empty seat and a taken one, because the
|
|
575
|
-
// alternative \u2014 a second geometry and a second draw call gathered per frame \u2014
|
|
576
|
-
// would double the near-field cost to show what is already known per instance.
|
|
577
|
-
// An unoccupied seat collapses its person to a point at the seat, which the
|
|
578
|
-
// rasteriser discards, exactly as the chair itself collapses at w=0.
|
|
579
|
-
float occupant = step(9.5, part);
|
|
580
|
-
float taken = step(0.0, iSeed);
|
|
581
|
-
vTaken = taken;
|
|
582
|
-
vOccupant = occupant;
|
|
745
|
+
vTaken = step(0.5, iTaken);
|
|
583
746
|
p = glyphChairPosition(p, part, iGlyph);
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
p.xz *= 0.92 + 0.16 * fract(iSeed * 7.13);
|
|
594
|
-
// People only appear once they are large enough to read as people. At
|
|
595
|
-
// section/overview distance their tiny dark geometry aliases into radial
|
|
596
|
-
// streaks; seat dots already communicate held/booked state there.
|
|
597
|
-
p *= occupantWeight(depth);
|
|
598
|
-
}
|
|
747
|
+
// Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
|
|
748
|
+
// two, told apart by the side of x = 0 they are built on; each is recentred
|
|
749
|
+
// on its own axis here and stood at its world offset after the yaw below.
|
|
750
|
+
vec2 armrestAt = vec2(0.0);
|
|
751
|
+
if (part > 6.5 && part < 7.5) {
|
|
752
|
+
bool shared = position.x > 0.0;
|
|
753
|
+
armrestAt = shared ? iArmrests.xy : iArmrests.zw;
|
|
754
|
+
if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
|
|
755
|
+
else if (dot(p, p) > 0.0) p.x += shared ? -${Tn.toFixed(2)} : ${Tn.toFixed(2)};
|
|
599
756
|
}
|
|
757
|
+
if (iPhysicalSeat < 0.5) p = vec3(0.0); // sellable space, but no physical chair
|
|
600
758
|
float localHeight = p.y;
|
|
759
|
+
vLocal = p;
|
|
601
760
|
p.xz *= iRadius;
|
|
761
|
+
// A seat in a fixed row hangs between its armrest standards, as a real
|
|
762
|
+
// tip-up does: no post under the middle of it. An accessible seat keeps the
|
|
763
|
+
// pedestal, which is what carries its ring colour at close range.
|
|
764
|
+
if (part < 0.5 && iGlyph < 1.5 && dot(iArmrests, iArmrests) > 0.0 && dot(iRing, iRing) < 0.001) p = vec3(0.0);
|
|
765
|
+
// The pad of an empty tip-up seat stands folded against the back. Its height
|
|
766
|
+
// for the occlusion ramp is where it now stands, not where it lay.
|
|
767
|
+
bool padPart = part > 0.5 && part < 1.5;
|
|
768
|
+
if (padPart) { p = tipUpPad(p, iRadius, iTipUp); localHeight = p.y; }
|
|
602
769
|
// 2. Lean the back. Done here rather than in the base mesh so the lean is a
|
|
603
770
|
// real angle in METRES \u2014 baked into the mesh it would scale with the seat's
|
|
604
771
|
// width and the same chair would lean 20 degrees on a wide stadium row and
|
|
605
772
|
// 6 on a tight theatre one.
|
|
606
|
-
// Only the
|
|
607
|
-
// now also catches the occupant \u2014 leaning a person by the panel's rule would
|
|
608
|
-
// translate their head backwards by a rake measured from the panel's base.
|
|
773
|
+
// Only the back and the spine that carries it rake.
|
|
609
774
|
float resolvedRake = uBackRake * glyphBackRake(iGlyph);
|
|
610
|
-
|
|
775
|
+
// (And a leg, where it rises past the back's base: a dining chair's rear legs.)
|
|
776
|
+
float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5)) ? max(p.y - uBackBase, 0.0) * resolvedRake : 0.0;
|
|
611
777
|
p.z -= rake;
|
|
612
778
|
// Fixed-size detail swap: no miniature chair inside a larger fallback.
|
|
613
779
|
p *= step(0.01, w);
|
|
614
780
|
vChairWeight = w;
|
|
615
781
|
float c = cos(iYaw), s = sin(iYaw);
|
|
616
782
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
783
|
+
// A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
|
|
784
|
+
rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
|
|
617
785
|
// Normals under the same two transforms, in reverse and inverted-transposed.
|
|
618
786
|
// The xz scale is non-uniform, so an axis-aligned normal does NOT survive it
|
|
619
787
|
// unchanged; and the rake is a shear, whose normal transform adds a y term.
|
|
620
788
|
// Skipping either lights the raked back as though it were still vertical.
|
|
621
789
|
vec3 n = vec3(normal.x / iRadius, normal.y, normal.z / iRadius);
|
|
622
|
-
if (part > 1.5 && part < 2.5) n.y += resolvedRake * n.z;
|
|
790
|
+
if ((part > 1.5 && part < 2.5) || (part > 5.5 && part < 6.5)) n.y += resolvedRake * n.z;
|
|
623
791
|
n = normalize(n);
|
|
792
|
+
if (padPart) n = tipUpNormal(n, iTipUp);
|
|
624
793
|
vec3 rn = vec3(n.x * c + n.z * s, n.y, -n.x * s + n.z * c);
|
|
625
794
|
vec4 mv = modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
626
795
|
vPosView = mv.xyz;
|
|
796
|
+
vViewWorld = cameraPosition - (iOffset + rp);
|
|
627
797
|
vNormalWorld = rn;
|
|
628
798
|
vNormalView = normalize(mat3(modelViewMatrix) * rn);
|
|
629
799
|
vColor = iColor;
|
|
630
|
-
// Occupant colour, resolved here so the fragment stage needs no extra
|
|
631
|
-
// varyings beyond this one. A person is NOT painted in the seat's state
|
|
632
|
-
// colour: a sold seat is red, and a hall of red people reads as a warning,
|
|
633
|
-
// not an audience. Hair/clothing for the body, a warm tone for the head,
|
|
634
|
-
// both varied by the same per-person hash.
|
|
635
|
-
float t = fract(iSeed * 3.71);
|
|
636
|
-
vec3 clothes = mix(vec3(0.18, 0.22, 0.30), vec3(0.42, 0.29, 0.34), t);
|
|
637
|
-
vec3 skin = mix(vec3(0.52, 0.38, 0.29), vec3(0.86, 0.70, 0.58), fract(iSeed * 11.3));
|
|
638
|
-
vOccupantTint = (part > 10.5) ? skin : clothes;
|
|
639
800
|
vPart = part;
|
|
640
801
|
vHeight = localHeight;
|
|
641
802
|
vRing = iRing;
|
|
642
803
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
643
804
|
vSectionFade = (uFocusSection < -0.5 || abs(iSection - uFocusSection) < 0.5) ? 0.0 : 1.0;
|
|
644
805
|
gl_Position = projectionMatrix * mv;
|
|
645
|
-
}`,
|
|
806
|
+
}`,BS=`#version 300 es
|
|
646
807
|
precision highp float;
|
|
647
808
|
in vec3 vColor;
|
|
648
809
|
in vec3 vNormalWorld;
|
|
@@ -653,10 +814,12 @@ in float vHeight;
|
|
|
653
814
|
in vec3 vRing;
|
|
654
815
|
in float vDim;
|
|
655
816
|
in float vSectionFade;
|
|
656
|
-
in float vOccupant;
|
|
657
|
-
in vec3 vOccupantTint;
|
|
658
817
|
in float vTaken;
|
|
818
|
+
in vec3 vLocal;
|
|
819
|
+
in vec3 vViewWorld;
|
|
659
820
|
uniform vec3 uKeyDir;
|
|
821
|
+
uniform vec3 uKeyColor; // the look's light, at the seats' share (looks.ts)
|
|
822
|
+
uniform vec3 uAmbientColor;
|
|
660
823
|
uniform vec3 uFadeColor;
|
|
661
824
|
uniform float uRoughness;
|
|
662
825
|
in float vChairWeight;
|
|
@@ -672,55 +835,68 @@ void main() {
|
|
|
672
835
|
vec3 fillDir = normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z));
|
|
673
836
|
float fill = max(dot(N, fillDir), 0.0);
|
|
674
837
|
vec3 tint = vColor;
|
|
675
|
-
if (vOccupant > 0.5) tint = vOccupantTint;
|
|
676
|
-
// The crowd in taken seats is one crisp, dark tone, not the seat's muted
|
|
677
|
-
// grey: on a light venue that grey went pale, and the people read as soft
|
|
678
|
-
// grey blobs (owner, 2026-09-25: "not crisp"). Dark silhouettes with the rim
|
|
679
|
-
// below read as an audience at every distance; the head is a step lighter so
|
|
680
|
-
// it separates from the shoulders.
|
|
681
|
-
if (vOccupant > 0.5 && vTaken > 0.5) {
|
|
682
|
-
// A little per-person variety (the clothing hash), so a full stand reads
|
|
683
|
-
// as people and not as one moulded block.
|
|
684
|
-
float vary = dot(vOccupantTint, vec3(0.33)) - 0.3;
|
|
685
|
-
tint = (vPart > 10.5 ? vec3(0.31, 0.32, 0.36) : vec3(0.19, 0.22, 0.27)) + vary * 0.12;
|
|
686
|
-
}
|
|
687
838
|
// The accommodation ring, kept legible once the dot (which drew it) is gone:
|
|
688
839
|
// an accessible seat's support is painted in the ring colour, so the marker
|
|
689
840
|
// survives to close range instead of vanishing exactly when the buyer arrives.
|
|
690
841
|
float ringMask = step(0.001, dot(vRing, vRing));
|
|
691
842
|
float supportPart = max(1.0 - step(0.5, vPart),
|
|
692
843
|
step(4.5, vPart) * (1.0 - step(5.5, vPart)));
|
|
844
|
+
// The frame is a frame. The pedestal and legs were the upholstery's colour at
|
|
845
|
+
// half strength, so a red seat stood on a dark-red post and the whole chair
|
|
846
|
+
// read as one moulded block. Real seating is fabric on a graphite frame; the
|
|
847
|
+
// little tint that stays keeps the frame in the venue's light, not a cut-out.
|
|
848
|
+
// The spine (6) and the armrest standards (7) are frame as well.
|
|
849
|
+
float framePart = step(5.5, vPart) * (1.0 - step(7.5, vPart));
|
|
850
|
+
float frame = max(supportPart, framePart);
|
|
851
|
+
// An armrest takes none of its seat's colour: it is shared with the seat
|
|
852
|
+
// next door, which may be another colour.
|
|
853
|
+
float armrestPart = step(6.5, vPart) * (1.0 - step(7.5, vPart));
|
|
854
|
+
tint = mix(tint, mix(vec3(0.17, 0.18, 0.20), tint, 0.12 * (1.0 - armrestPart)) * 2.0, frame);
|
|
693
855
|
if (supportPart > 0.5 && ringMask > 0.5) tint = vRing;
|
|
694
856
|
// Tonal separation keeps the modular silhouettes readable without textures.
|
|
695
|
-
|
|
696
|
-
// of the pad's sheen, so a head does not read as a polished box.
|
|
697
|
-
float furnitureShade = vPart < 0.5 ? 0.50
|
|
857
|
+
float partShade = vPart < 0.5 ? 0.50
|
|
698
858
|
: (vPart < 1.5 ? 1.10
|
|
699
859
|
: (vPart < 2.5 ? 0.80
|
|
700
860
|
: (vPart < 3.5 ? 0.72
|
|
701
861
|
: (vPart < 4.5 ? 0.90 : 0.55))));
|
|
702
|
-
float partShade = vOccupant > 0.5 ? 0.95 : furnitureShade;
|
|
703
862
|
// Cheap vertical occlusion: a chair is in a dense row, so the closer a surface
|
|
704
863
|
// sits to the deck the less sky it can actually see. This is the depth cue \u2014
|
|
705
864
|
// without it the pad top, the back and the deck all resolve to the same flat
|
|
706
865
|
// value and the row loses its form entirely.
|
|
707
|
-
|
|
708
|
-
//
|
|
709
|
-
|
|
866
|
+
float ao = mix(0.58, 1.0, clamp(vHeight / 0.92, 0.0, 1.0));
|
|
867
|
+
// The crease. Where the back meets the pad neither can see the sky: the foot
|
|
868
|
+
// of the back and the rear of the pad darken toward the join. This is the
|
|
869
|
+
// line that makes two cushions read as one chair, and it is what the flat
|
|
870
|
+
// panels were missing most.
|
|
871
|
+
float padPart = step(0.5, vPart) * (1.0 - step(1.5, vPart));
|
|
872
|
+
float backPart = step(1.5, vPart) * (1.0 - step(2.5, vPart));
|
|
873
|
+
float crease = mix(1.0, mix(0.70, 1.0, smoothstep(-0.95, -0.15, vLocal.z)), padPart)
|
|
874
|
+
* mix(1.0, mix(0.74, 1.0, smoothstep(0.0, 0.20, vLocal.y - ${sn.toFixed(2)})), backPart);
|
|
875
|
+
// The seam. On a tight row neighbouring pads meet edge to edge, and without a
|
|
876
|
+
// line between them the row is one long bench. Each pad darkens toward its
|
|
877
|
+
// own sides, which draws that line whether or not there is a gap to see.
|
|
878
|
+
crease *= mix(1.0, mix(1.0, 0.72, smoothstep(0.58, 0.90, abs(vLocal.x))), padPart);
|
|
879
|
+
ao *= crease;
|
|
710
880
|
// Chairs follow the structure's balance (see SOLID_FRAG): more sun, less
|
|
711
881
|
// ambient, so seat pads, backs and arms separate instead of reading as one
|
|
712
882
|
// coloured mass.
|
|
713
|
-
vec3 base = tint * partShade * ao * (0.52 + 0.26 * hemi)
|
|
883
|
+
vec3 base = tint * (partShade * ao * (0.52 + 0.26 * hemi) * uAmbientColor + key * 0.40 * uKeyColor + fill * 0.14 * uAmbientColor);
|
|
714
884
|
float fres = pow(1.0 - max(dot(normalize(vNormalView), V), 0.0), 3.0);
|
|
715
885
|
// A restrained furniture rim keeps the low-poly edges from looking outlined.
|
|
716
|
-
// Occupant silhouettes retain their existing stronger separation.
|
|
717
886
|
float sheen = clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0);
|
|
718
|
-
base += vec3(0.26, 0.31, 0.38) * fres *
|
|
719
|
-
//
|
|
720
|
-
//
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
887
|
+
base += vec3(0.26, 0.31, 0.38) * fres * 0.24 * sheen;
|
|
888
|
+
// A soft highlight where a cushion turns toward the light. Broad and weak:
|
|
889
|
+
// it is upholstery catching the sun, not a polished shell.
|
|
890
|
+
vec3 halfway = normalize(uKeyDir + normalize(vViewWorld));
|
|
891
|
+
float gloss = pow(max(dot(N, halfway), 0.0), 18.0) * (padPart + backPart);
|
|
892
|
+
base += (tint * 0.35 + vec3(0.10)) * gloss * 0.42 * clamp(sheen, 0.5, 1.5);
|
|
893
|
+
// Not for sale: the chair goes one muted grey, a step toward the venue. The
|
|
894
|
+
// chair's category tint made a taken seat look like any other at a glance
|
|
895
|
+
// (owner report, 2026-09-23); now only the seats a buyer can take wear full
|
|
896
|
+
// colour. With its pad down among folded neighbours, that grey IS the taken
|
|
897
|
+
// seat: no figure sits in it (owner, 2026-11-11).
|
|
898
|
+
// (Not the armrest: it is shared with the seat next door, which may be free.)
|
|
899
|
+
if (vTaken > 0.5 && armrestPart < 0.5) {
|
|
724
900
|
float takenLum = dot(base, vec3(0.299, 0.587, 0.114));
|
|
725
901
|
base = mix(vec3(takenLum), uFadeColor, 0.35) * 0.92;
|
|
726
902
|
}
|
|
@@ -731,45 +907,137 @@ void main() {
|
|
|
731
907
|
base = mix(base, mix(vec3(lum), vec3(0.93), 0.35), 0.45);
|
|
732
908
|
}
|
|
733
909
|
fragColor = vec4(base, 1.0);
|
|
734
|
-
}`,
|
|
910
|
+
}`,HS=`#version 300 es
|
|
735
911
|
precision highp float;
|
|
736
912
|
in vec2 position;
|
|
737
913
|
out vec2 vUv;
|
|
738
914
|
void main() {
|
|
739
915
|
vUv = position * 0.5 + 0.5;
|
|
740
916
|
gl_Position = vec4(position, 0.999, 1.0);
|
|
741
|
-
}`,
|
|
917
|
+
}`,GS=`#version 300 es
|
|
742
918
|
precision highp float;
|
|
743
919
|
in vec2 vUv;
|
|
744
|
-
|
|
745
|
-
uniform vec3 uBottom;
|
|
746
|
-
uniform float uSky; // 1 for an open-air venue, see SceneModel.outdoor
|
|
747
|
-
uniform vec3 uZenith;
|
|
748
|
-
uniform vec3 uHorizon;
|
|
920
|
+
${wd}
|
|
749
921
|
uniform mat4 uInvViewProj;
|
|
922
|
+
uniform float uHouse; // 1 for an indoor venue, see SceneModel.house
|
|
923
|
+
uniform vec4 uHouseShape; // the wall: centre x, centre z, half-width x, half-width z (world metres)
|
|
924
|
+
uniform vec2 uHouseLevels; // floor y, ceiling y
|
|
925
|
+
uniform vec3 uHouseCeiling;
|
|
926
|
+
uniform vec3 uHouseWall;
|
|
927
|
+
uniform vec3 uHouseLamp;
|
|
928
|
+
uniform float uHouseTheatre; // 1 for a theatre's room: pilasters, wall lights, a dado and a cornice
|
|
929
|
+
uniform vec3 uEye; // camera, world metres
|
|
750
930
|
out vec4 fragColor;
|
|
931
|
+
|
|
932
|
+
// One house light to a bay of the ceiling, and the bay's own width, metres.
|
|
933
|
+
const float HOUSE_BAY_M = 7.0;
|
|
934
|
+
const float HOUSE_LAMP_BAYS = 0.055; // lamp radius, in bays
|
|
935
|
+
const float HOUSE_COURSE_M = 3.2; // height of one course of wall panels
|
|
936
|
+
// A theatre's wall, metres: a pilaster about every bay, a wall light in the
|
|
937
|
+
// middle of each bay on every second course, a dado at its foot and a cornice
|
|
938
|
+
// under the ceiling.
|
|
939
|
+
const float THEATRE_BAY_M = 5.0;
|
|
940
|
+
const float THEATRE_PILASTER_M = 0.26; // half its width
|
|
941
|
+
const float THEATRE_LIGHT_AT_M = 2.6; // the lowest row, above the floor
|
|
942
|
+
const float THEATRE_LIGHT_ROWS_M = 6.4; // between rows
|
|
943
|
+
const float THEATRE_LIGHT_M = 0.11; // a light's radius
|
|
944
|
+
const float THEATRE_DADO_M = 1.0;
|
|
945
|
+
const float THEATRE_CORNICE_M = 0.45;
|
|
946
|
+
|
|
751
947
|
void main() {
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
// Above the horizon an open-air venue has a sky, not the chart's flat
|
|
757
|
-
// backdrop: from a seat, the stands used to meet a black void. Below the
|
|
758
|
-
// horizon (every overview) nothing changes.
|
|
759
|
-
if (uSky > 0.5) {
|
|
948
|
+
// This pixel's line of sight. A venue with neither a sky nor a room skips
|
|
949
|
+
// it: its backdrop is the flat gradient.
|
|
950
|
+
vec3 dir = vec3(0.0, -1.0, 0.0);
|
|
951
|
+
if (uSky > 0.5 || uHouse > 0.5) {
|
|
760
952
|
vec2 ndc = vUv * 2.0 - 1.0;
|
|
761
953
|
vec4 near = uInvViewProj * vec4(ndc, -1.0, 1.0);
|
|
762
954
|
vec4 far = uInvViewProj * vec4(ndc, 1.0, 1.0);
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
955
|
+
dir = normalize(far.xyz / far.w - near.xyz / near.w);
|
|
956
|
+
}
|
|
957
|
+
// The gradient and, for an open-air venue, the sky. A venue never has both
|
|
958
|
+
// a sky and a room, so the room below paints over the plain gradient.
|
|
959
|
+
vec3 col = backdrop(vUv, dir);
|
|
960
|
+
// An indoor venue has a room, not the chart's flat backdrop: from a seat the
|
|
961
|
+
// stands used to end in a void (see scene/model/house.ts). Painted here, so
|
|
962
|
+
// it is behind everything drawn. Only from inside the room and under its
|
|
963
|
+
// ceiling: every overview stands outside or above, and is unchanged.
|
|
964
|
+
if (uHouse > 0.5) {
|
|
965
|
+
// Where the line of sight would meet the ceiling, and where it would leave
|
|
966
|
+
// the elliptical wall. Worked out for every pixel before the branch on
|
|
967
|
+
// what it actually hits, so each pattern's pixel footprint (fwidth) is
|
|
968
|
+
// defined everywhere.
|
|
969
|
+
float headroom = uHouseLevels.y - uEye.y;
|
|
970
|
+
float tCeiling = headroom / max(dir.y, 1e-4);
|
|
971
|
+
vec2 onCeiling = uEye.xz + dir.xz * tCeiling - uHouseShape.xy;
|
|
972
|
+
vec2 bay = onCeiling / HOUSE_BAY_M;
|
|
973
|
+
float bayPixel = max(fwidth(bay.x), fwidth(bay.y)); // bays per pixel
|
|
974
|
+
vec2 eye = (uEye.xz - uHouseShape.xy) / uHouseShape.zw;
|
|
975
|
+
vec2 across = dir.xz / uHouseShape.zw;
|
|
976
|
+
float wa = dot(across, across), wb = dot(eye, across), wk = dot(eye, eye) - 1.0;
|
|
977
|
+
float tWall = wa > 1e-9 ? (-wb + sqrt(max(0.0, wb * wb - wa * wk))) / wa : 1e9;
|
|
978
|
+
float course = (uEye.y + dir.y * tWall - uHouseLevels.x) / HOUSE_COURSE_M;
|
|
979
|
+
float coursePixel = fwidth(course); // courses per pixel
|
|
980
|
+
vec3 onWall = uEye + dir * min(tWall, 1.0e4);
|
|
981
|
+
float wallPixel = max(length(dFdx(onWall)), length(dFdy(onWall))); // metres per pixel
|
|
982
|
+
float inside = smoothstep(0.0, 0.05, -wk) * smoothstep(0.0, 3.0, headroom);
|
|
983
|
+
if (inside > 0.0) {
|
|
984
|
+
if (dir.y > 1e-4 && tCeiling < tWall) {
|
|
985
|
+
// The ceiling: darker into the cove where it meets the wall, a faint
|
|
986
|
+
// line between bays, one house light to a bay. Far away, where a bay
|
|
987
|
+
// is a pixel or less, lamps and lines give way to their average.
|
|
988
|
+
float edge = length(onCeiling / uHouseShape.zw);
|
|
989
|
+
vec3 room = uHouseCeiling * mix(1.0, 0.7, smoothstep(0.5, 1.0, edge));
|
|
990
|
+
float detail = 1.0 - smoothstep(0.06, 0.3, bayPixel);
|
|
991
|
+
vec2 cell = fract(bay) - 0.5;
|
|
992
|
+
float r = length(cell);
|
|
993
|
+
float lamp = 1.0 - smoothstep(HOUSE_LAMP_BAYS - bayPixel, HOUSE_LAMP_BAYS + bayPixel, r);
|
|
994
|
+
float glow = exp(-r * r * 46.0);
|
|
995
|
+
vec2 toLine = 0.5 - abs(cell);
|
|
996
|
+
float line = 1.0 - smoothstep(0.012 - bayPixel, 0.012 + bayPixel, min(toLine.x, toLine.y));
|
|
997
|
+
// A joint is a shadow line: plain on a dark ceiling, slight on a pale one.
|
|
998
|
+
room *= 1.0 - mix(0.16, 0.05, dot(uHouseCeiling, vec3(0.2126, 0.7152, 0.0722))) * line * detail;
|
|
999
|
+
room += uHouseLamp * mix(0.05, lamp + 0.22 * glow, detail);
|
|
1000
|
+
col = mix(col, room, inside);
|
|
1001
|
+
} else {
|
|
1002
|
+
// The wall, floor to ceiling: lit from the floor, darkening toward the
|
|
1003
|
+
// cove, with the faint joint of each course of panels. Below the
|
|
1004
|
+
// floor there is nothing to paint: the ground is drawn there.
|
|
1005
|
+
float h = course * HOUSE_COURSE_M / max(1.0, uHouseLevels.y - uHouseLevels.x);
|
|
1006
|
+
vec3 room = uHouseWall * mix(1.06, 0.6, smoothstep(0.3, 1.0, h));
|
|
1007
|
+
float joint = 1.0 - smoothstep(0.014 - coursePixel, 0.014 + coursePixel, 0.5 - abs(fract(course) - 0.5));
|
|
1008
|
+
room *= 1.0 - 0.14 * joint * (1.0 - smoothstep(0.08, 0.35, coursePixel));
|
|
1009
|
+
if (uHouseTheatre > 0.5) {
|
|
1010
|
+
// A theatre's wall. All of it is paint on the backdrop: nothing
|
|
1011
|
+
// stands in the room. Far away, where a light is a pixel or less,
|
|
1012
|
+
// the detail gives way to the plain wall.
|
|
1013
|
+
float fine = 1.0 - smoothstep(0.05, 0.22, wallPixel);
|
|
1014
|
+
float tall = uHouseLevels.y - uHouseLevels.x;
|
|
1015
|
+
float up = course * HOUSE_COURSE_M;
|
|
1016
|
+
vec2 at = eye + across * tWall; // on the wall, as a unit circle
|
|
1017
|
+
float girth = 6.2831853 * sqrt(0.5 * dot(uHouseShape.zw, uHouseShape.zw));
|
|
1018
|
+
float bays = max(8.0, floor(girth / THEATRE_BAY_M));
|
|
1019
|
+
float bayM = girth / bays;
|
|
1020
|
+
float along = (fract(atan(at.y, at.x) / 6.2831853 * bays) - 0.5) * bayM; // metres from the bay's middle
|
|
1021
|
+
float pilaster = 1.0 - smoothstep(THEATRE_PILASTER_M - wallPixel, THEATRE_PILASTER_M + wallPixel, 0.5 * bayM - abs(along));
|
|
1022
|
+
room *= 1.0 + 0.2 * pilaster * fine;
|
|
1023
|
+
room *= mix(1.0, 0.74, (1.0 - smoothstep(THEATRE_DADO_M - wallPixel, THEATRE_DADO_M + wallPixel, up)) * fine);
|
|
1024
|
+
float cornice = smoothstep(tall - THEATRE_CORNICE_M - wallPixel, tall - THEATRE_CORNICE_M + wallPixel, up);
|
|
1025
|
+
room = mix(room, uHouseWall * 1.3, 0.7 * cornice * fine);
|
|
1026
|
+
// The wall lights: a small bright lamp and the wash it throws up and down the wall.
|
|
1027
|
+
float row = max(0.0, floor((up - THEATRE_LIGHT_AT_M) / THEATRE_LIGHT_ROWS_M + 0.5));
|
|
1028
|
+
float rowAt = THEATRE_LIGHT_AT_M + row * THEATRE_LIGHT_ROWS_M;
|
|
1029
|
+
float hangs = step(rowAt + 1.6, tall); // none in the cornice
|
|
1030
|
+
vec2 off = vec2(along, up - rowAt);
|
|
1031
|
+
float lampAt = 1.0 - smoothstep(THEATRE_LIGHT_M - wallPixel, THEATRE_LIGHT_M + wallPixel, length(off));
|
|
1032
|
+
float wash = exp(-(off.x * off.x * 1.3 + off.y * off.y * 0.26));
|
|
1033
|
+
room += uHouseLamp * hangs * mix(0.012, 0.85 * lampAt + 0.17 * wash, fine);
|
|
1034
|
+
}
|
|
1035
|
+
col = mix(col, room, inside * smoothstep(-0.02, 0.0, h));
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
770
1038
|
}
|
|
771
1039
|
fragColor = vec4(col, 1.0);
|
|
772
|
-
}`,
|
|
1040
|
+
}`,VS=`#version 300 es
|
|
773
1041
|
precision highp float;
|
|
774
1042
|
in float surface;
|
|
775
1043
|
in float iYaw;
|
|
@@ -782,6 +1050,7 @@ in vec3 iOffset;
|
|
|
782
1050
|
in float iMaxRadius;
|
|
783
1051
|
in float iHasChair;
|
|
784
1052
|
in float iPhysicalSeat;
|
|
1053
|
+
in float iTipUp;
|
|
785
1054
|
in float iFloor;
|
|
786
1055
|
uniform mat4 modelViewMatrix;
|
|
787
1056
|
uniform mat4 projectionMatrix;
|
|
@@ -798,9 +1067,9 @@ out float vDotWeight;
|
|
|
798
1067
|
out float vHidden;
|
|
799
1068
|
flat out vec3 vPick;
|
|
800
1069
|
uniform vec3 cameraPosition;
|
|
801
|
-
${
|
|
802
|
-
${
|
|
803
|
-
${
|
|
1070
|
+
${ta}
|
|
1071
|
+
${Pd}
|
|
1072
|
+
${No}
|
|
804
1073
|
void main() {
|
|
805
1074
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
806
1075
|
int id = gl_InstanceID + 1; // 0 reserved for no-hit
|
|
@@ -815,7 +1084,7 @@ void main() {
|
|
|
815
1084
|
vPhysicalSeat = iPhysicalSeat;
|
|
816
1085
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
817
1086
|
gl_Position = projectionMatrix * mv;
|
|
818
|
-
}`,
|
|
1087
|
+
}`,zS=`#version 300 es
|
|
819
1088
|
precision highp float;
|
|
820
1089
|
in vec2 vUv;
|
|
821
1090
|
in float vPhysicalSeat;
|
|
@@ -823,7 +1092,7 @@ in float vDotWeight;
|
|
|
823
1092
|
in float vHidden;
|
|
824
1093
|
flat in vec3 vPick;
|
|
825
1094
|
out vec4 fragColor;
|
|
826
|
-
${
|
|
1095
|
+
${Ad}
|
|
827
1096
|
void main() {
|
|
828
1097
|
if (vHidden > 0.5) discard;
|
|
829
1098
|
if (vDotWeight <= 0.99) discard;
|
|
@@ -831,16 +1100,17 @@ void main() {
|
|
|
831
1100
|
float d = seatSilhouette(vUv, vPhysicalSeat);
|
|
832
1101
|
if (d > 1.0) discard; // hit-mask matches chair/bay shape
|
|
833
1102
|
fragColor = vec4(vPick, 1.0);
|
|
834
|
-
}`,
|
|
1103
|
+
}`,US=`#version 300 es
|
|
835
1104
|
precision highp float;
|
|
836
1105
|
in vec3 position;
|
|
837
1106
|
in float part;
|
|
838
1107
|
in vec3 iOffset;
|
|
839
1108
|
in float iRadius;
|
|
840
1109
|
in float iYaw;
|
|
841
|
-
in float iSeed;
|
|
842
1110
|
in float iPhysicalSeat;
|
|
843
1111
|
in float iGlyph;
|
|
1112
|
+
in vec4 iArmrests;
|
|
1113
|
+
in float iTipUp;
|
|
844
1114
|
in float iPickIndex;
|
|
845
1115
|
in float iFloor;
|
|
846
1116
|
uniform mat4 modelViewMatrix;
|
|
@@ -854,10 +1124,10 @@ flat out vec3 vPick;
|
|
|
854
1124
|
out float vChairWeight;
|
|
855
1125
|
out float vHidden;
|
|
856
1126
|
uniform vec3 cameraPosition;
|
|
857
|
-
${
|
|
858
|
-
${
|
|
859
|
-
${
|
|
860
|
-
${
|
|
1127
|
+
${ta}
|
|
1128
|
+
${pc}
|
|
1129
|
+
${dc}
|
|
1130
|
+
${No}
|
|
861
1131
|
void main() {
|
|
862
1132
|
if (seeThroughCut(iOffset, cameraPosition)) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
863
1133
|
int id = int(iPickIndex + 0.5); // already global index + 1
|
|
@@ -868,22 +1138,21 @@ void main() {
|
|
|
868
1138
|
float depth = max(viewDepth, 0.001);
|
|
869
1139
|
float w = viewDepth > 0.05 ? chairWeight(length(anchor.xyz)) : 0.0;
|
|
870
1140
|
vec3 p = position;
|
|
871
|
-
float occupant = step(9.5, part);
|
|
872
|
-
float taken = step(0.0, iSeed);
|
|
873
1141
|
p = glyphChairPosition(p, part, iGlyph);
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
}
|
|
1142
|
+
// Armrest standards (see fixedRowSeating in seatInstances.ts). The mesh holds
|
|
1143
|
+
// two, told apart by the side of x = 0 they are built on; each is recentred
|
|
1144
|
+
// on its own axis here and stood at its world offset after the yaw below.
|
|
1145
|
+
vec2 armrestAt = vec2(0.0);
|
|
1146
|
+
if (part > 6.5 && part < 7.5) {
|
|
1147
|
+
bool shared = position.x > 0.0;
|
|
1148
|
+
armrestAt = shared ? iArmrests.xy : iArmrests.zw;
|
|
1149
|
+
if (dot(armrestAt, armrestAt) <= 0.0) p = vec3(0.0);
|
|
1150
|
+
else if (dot(p, p) > 0.0) p.x += shared ? -${Tn.toFixed(2)} : ${Tn.toFixed(2)};
|
|
884
1151
|
}
|
|
1152
|
+
if (iPhysicalSeat < 0.5) p = vec3(0.0);
|
|
885
1153
|
p.xz *= iRadius;
|
|
886
|
-
|
|
1154
|
+
if (part > 0.5 && part < 1.5) p = tipUpPad(p, iRadius, iTipUp);
|
|
1155
|
+
float rake = ((part > 1.5 && part < 2.5) || (part > 4.5 && part < 6.5))
|
|
887
1156
|
? max(p.y - uBackBase, 0.0) * uBackRake * glyphBackRake(iGlyph)
|
|
888
1157
|
: 0.0;
|
|
889
1158
|
p.z -= rake;
|
|
@@ -891,8 +1160,10 @@ void main() {
|
|
|
891
1160
|
vChairWeight = w;
|
|
892
1161
|
float c = cos(iYaw), s = sin(iYaw);
|
|
893
1162
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
1163
|
+
// A collapsed armrest (p = 0) must stay collapsed, so the offset rides on w.
|
|
1164
|
+
rp.xz += armrestAt * step(0.01, w) * step(0.0001, dot(p, p));
|
|
894
1165
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
895
|
-
}`,
|
|
1166
|
+
}`,WS=`#version 300 es
|
|
896
1167
|
precision highp float;
|
|
897
1168
|
flat in vec3 vPick;
|
|
898
1169
|
in float vHidden;
|
|
@@ -902,7 +1173,7 @@ void main() {
|
|
|
902
1173
|
if (vHidden > 0.5) discard;
|
|
903
1174
|
if (vChairWeight < 0.01) discard;
|
|
904
1175
|
fragColor = vec4(vPick, 1.0);
|
|
905
|
-
}`,
|
|
1176
|
+
}`,jS=`#version 300 es
|
|
906
1177
|
precision highp float;
|
|
907
1178
|
in vec3 position;
|
|
908
1179
|
in vec3 normal;
|
|
@@ -917,12 +1188,14 @@ out float vMaterial;
|
|
|
917
1188
|
out vec3 vNormalWorld;
|
|
918
1189
|
out vec3 vPosWorld;
|
|
919
1190
|
void main() {
|
|
920
|
-
|
|
1191
|
+
// What is drawn hides what is behind it: the venue-wide solids (floor -2)
|
|
1192
|
+
// stay in a single-level view, so they stay in its depth too.
|
|
1193
|
+
vHidden = (floorIndex > -1.5 && uFocusFloor > -0.5 && abs(floorIndex - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
921
1194
|
vMaterial = materialIndex;
|
|
922
1195
|
vNormalWorld = mat3(modelMatrix) * normal;
|
|
923
1196
|
vPosWorld = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
924
1197
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
925
|
-
}
|
|
1198
|
+
}`,XS=`#version 300 es
|
|
926
1199
|
precision highp float;
|
|
927
1200
|
in float vHidden;
|
|
928
1201
|
in float vMaterial;
|
|
@@ -931,14 +1204,22 @@ in vec3 vPosWorld;
|
|
|
931
1204
|
uniform vec3 cameraPosition;
|
|
932
1205
|
uniform vec2 uRoomCentre;
|
|
933
1206
|
out vec4 fragColor;
|
|
934
|
-
${
|
|
935
|
-
${
|
|
1207
|
+
${Sd}
|
|
1208
|
+
${No}
|
|
936
1209
|
void main() {
|
|
937
1210
|
if (vHidden > 0.5) discard;
|
|
938
1211
|
if (roomWallHidden(vMaterial, vNormalWorld, vPosWorld, cameraPosition, uRoomCentre)) discard;
|
|
939
1212
|
if (seeThroughCut(vPosWorld, cameraPosition)) discard;
|
|
940
|
-
|
|
941
|
-
|
|
1213
|
+
// Nets and slender fittings (materials 10 and 11) never swallow a tap: a
|
|
1214
|
+
// buyer behind the goal picks a seat through the net. Nor does stage light
|
|
1215
|
+
// (12), which from behind is not there at all.
|
|
1216
|
+
if (vMaterial > 9.5 && vMaterial < 12.5) discard;
|
|
1217
|
+
// A standing area's floor (material 13, its top face) says so in alpha: see
|
|
1218
|
+
// pick/encode.ts STANDING_FLOOR_PICK_ALPHA. Black like every solid, so seats
|
|
1219
|
+
// behind it still read as no hit.
|
|
1220
|
+
float floorMark = (abs(vMaterial - 13.0) < 0.5 && vNormalWorld.y > 0.5) ? ${(fc/255).toFixed(6)} : 1.0;
|
|
1221
|
+
fragColor = vec4(0.0, 0.0, 0.0, floorMark);
|
|
1222
|
+
}`;function Rd(e){return new Pn.Program(e,{vertex:VS,fragment:zS,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uSeatRadius:{value:cn},uSeatScale:{value:1},uMinPixels:{value:io},uPixelToWorld:{value:.002},uChairFull:{value:qo},uChairNone:{value:ao},uFocusFloor:{value:-1}}})}function Ed(e){return new Pn.Program(e,{vertex:US,fragment:WS,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uChairFull:{value:qo},uChairNone:{value:ao},uBackRake:{value:Ko},uBackBase:{value:sn},uFocusFloor:{value:-1}}})}function Id(e){return new Pn.Program(e,{vertex:jS,fragment:XS,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uFocusFloor:{value:-1},uRoomCentre:{value:new Float32Array([0,0])}}})}function _d(e,t=.78,n=[.63,.66,.65]){return new Pn.Program(e,{vertex:kS,fragment:OS,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uDeckColor:{value:new Float32Array(n)},uSectionFilter:{value:0},uRoughness:{value:t},uRoomCentre:{value:new Float32Array([0,0])},uViewport:{value:new Float32Array([1,1])},uTop:{value:new Float32Array([0,0,0])},uBottom:{value:new Float32Array([0,0,0])},uSky:{value:0},uZenith:{value:new Float32Array([0,0,0])},uHorizon:{value:new Float32Array([0,0,0])}}})}function Cd(e){return new Pn.Program(e,{vertex:FS,fragment:DS,transparent:!0,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uSeatRadius:{value:cn},uSeatScale:{value:1},uMinPixels:{value:io},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFocusSection:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:qo},uChairNone:{value:ao}}})}function Td(e,t=.78){return new Pn.Program(e,{vertex:NS,fragment:BS,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeeThrough:{value:[0,0,0,0]},uKeyDir:{value:new Float32Array([-.48,.78,.4])},uKeyColor:{value:new Float32Array([1,1,1])},uAmbientColor:{value:new Float32Array([1,1,1])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:qo},uChairNone:{value:ao},uBackRake:{value:Ko},uBackBase:{value:sn},uFocusFloor:{value:-1},uFocusSection:{value:-1},uRoughness:{value:t}}})}function kd(e,t,n,o,r){return new Pn.Program(e,{vertex:HS,fragment:GS,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(t)},uBottom:{value:new Float32Array(n)},uSky:{value:o?1:0},uZenith:{value:new Float32Array(o?.zenith??[0,0,0])},uHorizon:{value:new Float32Array(o?.horizon??[0,0,0])},uInvViewProj:{value:new Float32Array(16)},uHouse:{value:r?1:0},uHouseShape:{value:new Float32Array(r?[...r.centre,...r.radii]:[0,0,1,1])},uHouseLevels:{value:new Float32Array(r?[r.floorY,r.ceilingY]:[0,1])},uHouseCeiling:{value:new Float32Array(r?.ceiling??[0,0,0])},uHouseWall:{value:new Float32Array(r?.wall??[0,0,0])},uHouseLamp:{value:new Float32Array(r?.lamp??[0,0,0])},uHouseTheatre:{value:r?.theatre?1:0},uEye:{value:new Float32Array(3)}}})}var St=require("ogl"),KS=45,YS=.16;function Ld(e,t,n,o){let r=Math.max(3,n.radius*1.04),i=e.getParameter(e.MAX_TEXTURE_SIZE),a=r<=KS||i<2048?1024:2048,s=!!o&&2*r/a<=YS,[c,l,u]=n.center,m=new St.Camera(e,{left:-r,right:r,bottom:-r,top:r,near:.1,far:r*6});m.position.set(c-r*1.44,l+r*2.34,u+r*1.2),m.lookAt([c,l,u]);let h=new St.RenderTarget(e,{width:a,height:a,depthTexture:!0,minFilter:e.NEAREST,magFilter:e.NEAREST}),f=new St.Program(e,{cullFace:!1,vertex:`#version 300 es
|
|
942
1223
|
in vec3 position;
|
|
943
1224
|
in float materialIndex;
|
|
944
1225
|
uniform mat4 modelViewMatrix;
|
|
@@ -949,9 +1230,87 @@ void main() {
|
|
|
949
1230
|
in float vMaterial;
|
|
950
1231
|
out vec4 fragColor;
|
|
951
1232
|
void main() {
|
|
952
|
-
|
|
1233
|
+
// ...nor do nets and slender sport fittings (10, 11): a net is mostly air.
|
|
1234
|
+
if (abs(vMaterial - 6.0) < 0.5 || (vMaterial > 9.5 && vMaterial < 12.5)) discard;
|
|
953
1235
|
fragColor = vec4(1.0);
|
|
954
|
-
}`}),
|
|
1236
|
+
}`}),d=new St.Transform,p=new St.Mesh(e,{geometry:t,program:f});p.frustumCulled=!1,p.setParent(d);let b=s?new St.Program(e,{cullFace:!1,vertex:`#version 300 es
|
|
1237
|
+
in vec3 position;
|
|
1238
|
+
in float surface;
|
|
1239
|
+
in vec3 iOffset;
|
|
1240
|
+
in float iYaw;
|
|
1241
|
+
in float iChairWidth;
|
|
1242
|
+
in float iPhysicalSeat;
|
|
1243
|
+
uniform mat4 modelViewMatrix;
|
|
1244
|
+
uniform mat4 projectionMatrix;
|
|
1245
|
+
void main() {
|
|
1246
|
+
if (iPhysicalSeat < 0.5 || surface < 0.5) { gl_Position = vec4(2.0, 2.0, 2.0, 1.0); return; }
|
|
1247
|
+
vec3 p = position;
|
|
1248
|
+
if (surface < 1.5 && p.y < 0.40) p.y = 0.02;
|
|
1249
|
+
p.xz *= iChairWidth;
|
|
1250
|
+
float c = cos(iYaw), s = sin(iYaw);
|
|
1251
|
+
vec3 rotated = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
1252
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rotated, 1.0);
|
|
1253
|
+
}`,fragment:`#version 300 es
|
|
1254
|
+
precision highp float;
|
|
1255
|
+
out vec4 fragColor;
|
|
1256
|
+
void main() { fragColor = vec4(1.0); }`}):null;if(b&&o){let P=new St.Mesh(e,{geometry:o,program:b});P.frustumCulled=!1,P.setParent(d)}let y=e.getParameter(e.COLOR_CLEAR_VALUE),g=e.isEnabled(e.DITHER);try{e.disable(e.DITHER),e.clearColor(1,1,1,1),e.renderer.render({scene:d,camera:m,target:h})}finally{g&&e.enable(e.DITHER),e.clearColor(y[0],y[1],y[2],y[3]),f.remove(),b?.remove()}let v=new St.Mat4().multiply(m.projectionMatrix,m.viewMatrix);return{texture:h.depthTexture,matrix:v,seatsCast:s,dispose(){for(let P of h.textures)e.deleteTexture(P.texture);e.deleteTexture(h.depthTexture.texture),e.deleteFramebuffer(h.buffer),h.depthBuffer&&e.deleteRenderbuffer(h.depthBuffer)}}}var $S=.65,ZS=new Set(["dimmed","sold","held"]);function Fd(e,t,n){let o=new Set,r=!1;for(let i of e){let a=t.get(i.sectionId);if(!a||!a.length){o.add(i.sectionId);continue}let s=!1;for(let c of a){let l=ct[n[c]]??"available";if(!ZS.has(l)){s=!0;break}}s?o.add(i.sectionId):r=!0}return{lit:o,anyUnlit:r}}var Od=new WeakMap;function Dd(e){let t=Od.get(e);if(t)return e.color.set(t),t;let n=e.color.slice();return Od.set(e,n),n}function bc(e,t,n,o,r,i){let a=[];for(let s of e){let c=r===null||r.has(s.sectionId);if(o.get(s.sectionId)===c)continue;o.set(s.sectionId,c);let l=(s.start+s.count)*3;for(let u=s.start*3;u<l;u++)t[u]=c?n[u]:n[u]+(i[u%3]-n[u])*$S;a.push(s)}return a}var Go=require("ogl"),gc=[[.16,.2,.3],[.3,.14,.16],[.2,.26,.2],[.34,.3,.24],[.42,.42,.46],[.12,.12,.14],[.5,.36,.16],[.24,.3,.42]],Kn=[[.78,.6,.48],[.56,.4,.3],[.36,.25,.19],[.86,.7,.58]],yc=[[.08,.07,.06],[.2,.13,.08],[.36,.24,.13],[.62,.5,.3],[.5,.5,.5]],na=32,Nd=1.6,Bd=2.2,qS=0,Ho=1,Hd=2,xc=3,Mc=[{part:qS,y:[0,.47],halfWidth:[.105,.15],halfDepth:[.085,.1]},{part:Ho,y:[.47,.8],halfWidth:[.15,.225],halfDepth:[.1,.115]},{part:Ho,y:[.8,.845],halfWidth:[.225,.065],halfDepth:[.115,.06]}],Bo=6,Lr={y:[.855,.95],halfWidth:[.075,.092],halfDepth:[.085,.1]},QS={y:[.95,1],halfWidth:[.092,.05],halfDepth:[.1,.055]},An={hips:{y:.47,inside:.004},shoulders:{y:.8,inside:.001}};function JS(){let e=[],t=(f,d,p,b,y="out")=>{let v=d[0]-f[0],P=(d[1]-f[1])*1.64,w=d[2]-f[2],x=p[0]-f[0],S=(p[1]-f[1])*1.64,A=p[2]-f[2],M=P*A-w*S,E=w*x-v*A,T=v*S-P*x,k=Math.hypot(M,E,T)||1;M/=k,E/=k,T/=k;let _=(f[0]+d[0]+p[0])*M+(f[2]+d[2]+p[2])*T,R=y==="down"?E>0:_<0||_===0&&E<0,C=R?[-M,-E,-T]:[M,E,T],O=R!==(y==="lining");e.push(O?{a:f,b:p,c:d,normal:C,part:b,lining:y==="lining"}:{a:f,b:d,c:p,normal:C,part:b,lining:y==="lining"})},n=(f,d,p,b)=>f===4?[[-p,d,-b],[p,d,-b],[p,d,b],[-p,d,b]]:Array.from({length:f},(y,g)=>{let v=2*Math.PI*(g+.5)/f;return[Math.sin(v)*p,d,-Math.cos(v)*b]}),o=(f,d,p,b="out")=>{let y=n(f,d.y[0],d.halfWidth[0],d.halfDepth[0]),g=n(f,d.y[1],d.halfWidth[1],d.halfDepth[1]);for(let v=0;v<f;v++){let P=(v+1)%f;t(y[v],y[P],g[P],p(v),b),t(y[v],g[P],g[v],p(v),b)}return g};for(let f of Mc)o(4,f,()=>f.part);let r=n(Bo,Lr.y[0],Lr.halfWidth[0],Lr.halfDepth[0]);o(Bo,Lr,f=>{let d=r[f],p=r[(f+1)%Bo];return d[2]+p[2]<-Lr.halfDepth[0]?xc:Hd});let i=o(Bo,QS,()=>xc);for(let f=1;f<Bo-1;f++)t(i[0],i[f],i[f+1],xc);let a=Mc[1],s=Mc[2],c=s.halfWidth[0]-An.shoulders.inside,l=s.halfDepth[0]-An.shoulders.inside,u=a.halfWidth[0]-An.hips.inside,m=a.halfDepth[0]-An.hips.inside;o(4,{y:[An.shoulders.y,s.y[1]],halfWidth:[c,s.halfWidth[1]],halfDepth:[l,s.halfDepth[1]]},()=>Ho,"lining"),o(4,{y:[An.hips.y,An.shoulders.y],halfWidth:[u,c],halfDepth:[m,l]},()=>Ho,"lining");let h=n(4,An.hips.y,u,m);t(h[0],h[1],h[2],Ho),t(h[0],h[2],h[3],Ho);for(let f=1;f<Bo-1;f++)t(r[0],r[f],r[f+1],Hd,"down");return e}var Or=e=>e.map(t=>Math.round(t*1e6)).join(",");function ew(e="flat",t="last"){let n=JS(),o=[],r=[],i=[],a=[],s=(c,l,u)=>(o.push(...c),r.push(...l),i.push(u),i.length-1);if(e==="indexed"){let c=new Map;for(let l of n)for(let u of[l.a,l.b,l.c]){let m=`${Or(u)}|${Or(l.normal)}|${l.part}`,h=c.get(m);h===void 0&&(h=s(u,l.normal,l.part),c.set(m,h)),a.push(h)}}else{let c=new Map,l=p=>{let b=c.get(Or(p));return b===void 0&&(b=s(p,[0,1,0],0),c.set(Or(p),b)),b},u=new Map;for(let p of n){let b=[p.a,p.b,p.c].map(l),y=`${Or(p.normal)}|${p.part}`,g=u.get(y);g?(g.triangles.push(p),g.shared=g.shared.filter(v=>b.includes(v))):u.set(y,{triangles:[p],shared:b})}let m=[...u.values()],h=new Map,f=(p,b)=>{for(let y of m[p].shared){if(b.has(y))continue;b.add(y);let g=h.get(y);if(g===void 0||f(g,b))return h.set(y,p),!0}return!1};m.forEach((p,b)=>f(b,new Set));let d=new Map;for(let[p,b]of h)d.set(b,p);m.forEach((p,b)=>{let y=p.triangles[0],g=d.get(b),v=g;if(v===void 0){let P=p.shared[0];v=P===void 0?void 0:s([o[P*3],o[P*3+1],o[P*3+2]],y.normal,y.part)}for(let P of p.triangles){let w=[P.a,P.b,P.c].map(l),x=v===void 0?2:w.indexOf(g??p.shared[0]);x<0&&(x=2);let S=v??s(P.c,P.normal,P.part);r.splice(S*3,3,...P.normal),i[S]=P.part;let A=[w[(x+1)%3],w[(x+2)%3]];a.push(...t==="first"?[S,A[0],A[1]]:[A[0],A[1],S])}})}return{position:new Float32Array(o),normal:new Float32Array(r),part:new Float32Array(i),index:new Uint16Array(a),vertices:i.length,triangles:n.length}}var vc=e=>e.map(([t,n,o])=>`vec3(${t.toFixed(3)}, ${n.toFixed(3)}, ${o.toFixed(3)})`).join(", "),Gd=e=>`#version 300 es
|
|
1257
|
+
precision highp float;
|
|
1258
|
+
in vec3 position;
|
|
1259
|
+
in vec3 normal;
|
|
1260
|
+
in float part; // 0 legs, 1 body, 2 skin, 3 hair
|
|
1261
|
+
in vec3 iOffset; // feet, world metres
|
|
1262
|
+
in vec2 iFacing; // unit, world (x, z)
|
|
1263
|
+
in float iHeight;
|
|
1264
|
+
in float iTone; // hair * ${na} + clothes * ${Kn.length} + skin
|
|
1265
|
+
in float iFloor;
|
|
1266
|
+
uniform mat4 modelMatrix;
|
|
1267
|
+
uniform mat4 modelViewMatrix;
|
|
1268
|
+
uniform mat4 projectionMatrix;
|
|
1269
|
+
uniform vec3 cameraPosition;
|
|
1270
|
+
uniform float uFocusFloor; // -1 = show every floor
|
|
1271
|
+
uniform vec3 uKeyDir;
|
|
1272
|
+
uniform vec3 uKeyColor;
|
|
1273
|
+
uniform vec3 uAmbientColor;
|
|
1274
|
+
${e?"flat ":""}out vec3 vColor;
|
|
1275
|
+
const vec3 CLOTHES[${gc.length}] = vec3[${gc.length}](${vc(gc)});
|
|
1276
|
+
const vec3 SKIN[${Kn.length}] = vec3[${Kn.length}](${vc(Kn)});
|
|
1277
|
+
const vec3 HAIR[${yc.length}] = vec3[${yc.length}](${vc(yc)});
|
|
1278
|
+
void main() {
|
|
1279
|
+
// A figure that must not show is dropped whole, here: on another level than the one in focus, or
|
|
1280
|
+
// nearer the eye than its own distance between ${Nd.toFixed(1)} and ${Bd.toFixed(1)} m. No pixel is ever discarded.
|
|
1281
|
+
vec4 chest = modelMatrix * vec4(iOffset + vec3(0.0, iHeight * 0.7, 0.0), 1.0);
|
|
1282
|
+
float own = fract(52.9829189 * fract(dot(iOffset.xz, vec2(0.06711056, 0.00583715))));
|
|
1283
|
+
bool onLevel = uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5;
|
|
1284
|
+
if (!onLevel || distance(cameraPosition, chest.xyz) < mix(${Nd.toFixed(1)}, ${Bd.toFixed(1)}, own)) {
|
|
1285
|
+
vColor = vec3(0.0);
|
|
1286
|
+
gl_Position = vec4(2.0, 2.0, 2.0, 1.0);
|
|
1287
|
+
return;
|
|
1288
|
+
}
|
|
1289
|
+
vec2 f = iFacing;
|
|
1290
|
+
vec2 r = vec2(-f.y, f.x);
|
|
1291
|
+
vec3 local = iOffset + vec3(r.x * position.x + f.x * position.z, position.y * iHeight, r.y * position.x + f.y * position.z);
|
|
1292
|
+
vec3 n = vec3(r.x * normal.x + f.x * normal.z, normal.y, r.y * normal.x + f.y * normal.z);
|
|
1293
|
+
int tone = int(iTone + 0.5);
|
|
1294
|
+
int look = tone - (tone / ${na}) * ${na};
|
|
1295
|
+
vec3 clothes = CLOTHES[look / ${Kn.length}];
|
|
1296
|
+
vec3 base = part > 2.5 ? HAIR[tone / ${na}]
|
|
1297
|
+
: part > 1.5 ? SKIN[look - (look / ${Kn.length}) * ${Kn.length}]
|
|
1298
|
+
: part > 0.5 ? clothes : clothes * 0.62;
|
|
1299
|
+
// A flat face has one colour, so the venue's light is worked out here, once a vertex, not once a pixel.
|
|
1300
|
+
vec3 N = normalize(mat3(modelMatrix) * n);
|
|
1301
|
+
float hemi = 0.5 + 0.5 * N.y;
|
|
1302
|
+
float key = max(dot(N, uKeyDir), 0.0);
|
|
1303
|
+
vec3 fillDir = normalize(vec3(-uKeyDir.x, 0.25, -uKeyDir.z));
|
|
1304
|
+
float fill = max(dot(N, fillDir), 0.0);
|
|
1305
|
+
vColor = base * ((0.34 + 0.26 * hemi) * uAmbientColor + key * 0.60 * uKeyColor + fill * 0.26 * uAmbientColor);
|
|
1306
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(local, 1.0);
|
|
1307
|
+
}`,Vd=e=>`#version 300 es
|
|
1308
|
+
precision highp float;
|
|
1309
|
+
${e?"flat ":""}in vec3 vColor;
|
|
1310
|
+
out vec4 fragColor;
|
|
1311
|
+
void main() {
|
|
1312
|
+
fragColor = vec4(vColor, 1.0);
|
|
1313
|
+
}`,oC=Gd(!0),rC=Vd(!0);function zd(e,t,n,o="flat"){let r=o==="flat"?e.getExtension("WEBGL_provoking_vertex"):null;r?.provokingVertexWEBGL(r.FIRST_VERTEX_CONVENTION_WEBGL);let i=r?"first":"last",a=ew(o,i),s=new Go.Geometry(e,{position:{size:3,data:a.position},normal:{size:3,data:a.normal},part:{size:1,data:a.part},index:{data:a.index},iOffset:{size:3,data:t.iPosition,instanced:1},iFacing:{size:2,data:t.iFacing,instanced:1},iHeight:{size:1,data:t.iHeight,instanced:1},iTone:{size:1,data:t.iTone,instanced:1},iFloor:{size:1,data:t.iFloor,instanced:1}});s.instancedCount=t.count;let c=new Go.Program(e,{vertex:Gd(o==="flat"),fragment:Vd(o==="flat"),cullFace:e.BACK,frontFace:e.CW,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:n.uniforms.uKeyDir,uKeyColor:n.uniforms.uKeyColor,uAmbientColor:n.uniforms.uAmbientColor,uFocusFloor:n.uniforms.uFocusFloor}}),l=new Go.Mesh(e,{geometry:s,program:c});return l.frustumCulled=!1,{mesh:l,kind:o,provoking:i,dispose:()=>{s.remove(),c.remove()}}}function Ud(e){let t=null;try{if(t=e(),tw(t.mesh.program))return t}catch{}try{t?.dispose()}catch{}return null}function tw(e){let t=e;return t.uniformLocations instanceof Map&&t.attributeLocations instanceof Map}var nw=ct.map(e=>e==="available"||e==="dimmed"),Wd=ct.indexOf("selected");function ow(e,t){return[0,1,2].map(n=>e[n]*.15+.75+t[n]*.1)}function jd(e,t,n,o,r,i){for(let a=n;a<n+o;a++){let s=i&&t[a]===0,c=i&&t[a]===Wd?ow([i[a*3],i[a*3+1],i[a*3+2]],r[Wd]??r[0]):s?null:r[t[a]]??r[0];e[a*3]=c?c[0]:i[a*3],e[a*3+1]=c?c[1]:i[a*3+1],e[a*3+2]=c?c[2]:i[a*3+2]}}var rw=new Float32Array([-1,-1,3,-1,-1,3]);function Xd(e,t){let n=Dd(t.solids),o=new it.Transform,r=new it.Transform,i=new it.Geometry(e,{position:{size:2,data:rw}}),a=kd(e,t.theme.background.top,t.theme.background.bottom,t.outdoor?t.theme.sky:null,t.house&&t.theme.house?{...t.house,...t.theme.house}:null),s=new it.Mesh(e,{geometry:i,program:a});s.frustumCulled=!1,s.setParent(r);let c=new it.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}}),l=_d(e,t.theme.materials.roughness,t.theme.structure.tierTop);t.room&&l.uniforms.uRoomCentre.value.set(t.room.centre);for(let ne of["uTop","uBottom","uSky","uZenith","uHorizon"])l.uniforms[ne]=a.uniforms[ne];let u=new it.Mesh(e,{geometry:c,program:l});u.frustumCulled=!1,u.setParent(o);let m=t.crowd,h=m?Ud(()=>zd(e,m,l)):null;h?.mesh.setParent(o);let f=h?1:0,d=Cd(e),p=new Float32Array(t.seats.count*3),b=ct.map(ne=>t.theme.seatStates[ne]),y=t.seats.iCategory.slice(),g=Kt(t.theme.structure);for(let ne=0;ne<t.seats.count;ne++){if(t.seats.iPhysicalSeat[ne]<.5)continue;let W=t.theme.materials.seat??gl([y[ne*3],y[ne*3+1],y[ne*3+2]],g);y.set(W,ne*3)}jd(p,t.seats.iState,0,t.seats.count,b,y);let v=ul(),P=new Uint8Array(t.seats.count),w=new Uint8Array(t.seats.count);for(let ne=0;ne<t.seats.count;ne++){let W=t.seats.iArmrests[ne*4]!==0||t.seats.iArmrests[ne*4+1]!==0;w[ne]=W&&t.seats.iPhysicalSeat[ne]>=.5&&t.seats.iGlyph[ne]<1.5?1:0}let x=new Float32Array(t.seats.count),S=(ne,W)=>{for(let K=ne;K<ne+W;K++)x[K]=w[K]&&nw[t.seats.iState[K]]?1:0};S(0,t.seats.count);let A=new it.Geometry(e,{position:{size:3,data:v.position},normal:{size:3,data:v.normal},uv:{size:2,data:v.uv},index:{size:1,data:v.index},surface:{size:1,data:v.surface},iYaw:{size:1,data:t.seats.iYaw,instanced:1},iChairWidth:{size:1,data:t.seats.iChairWidth,instanced:1},iGlyph:{size:1,data:t.seats.iGlyph,instanced:1},iOffset:{size:3,data:t.seats.iPosition,instanced:1},iColor:{size:3,data:p,instanced:1},iMaxRadius:{size:1,data:t.seats.iMaxRadius,instanced:1},iHasChair:{size:1,data:P,type:e.UNSIGNED_BYTE,usage:e.DYNAMIC_DRAW,instanced:1},iPhysicalSeat:{size:1,data:t.seats.iPhysicalSeat,instanced:1},iTipUp:{size:1,data:x,usage:e.DYNAMIC_DRAW,instanced:1},iRing:{size:3,data:t.seats.iRing,instanced:1},iFloor:{size:1,data:t.seats.iFloor,instanced:1},iSection:{size:1,data:t.seats.iSection,instanced:1}}),M=new it.Mesh(e,{geometry:A,program:d});M.frustumCulled=!1,t.seats.count>0&&M.setParent(o);let E=Ld(e,c,t.renderBounds,t.seats.count>0?A:null);l.uniforms.tVenueShadow={value:E.texture},l.uniforms.uShadowMatrix={value:E.matrix};let T=A.attributes.iColor,k=t.theme.structure.ground,_=new Map(t.sectionSolidRanges.map(ne=>[ne.sectionId,!0])),R=new Map((t.areaSolidRanges??[]).map(ne=>[ne.sectionId,!0])),C=ne=>{if(!ne.length)return;let W=c.attributes.color,K=W.buffer;if(!K){W.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,K);for(let Q of ne){let ve=t.solids.color.subarray(Q.start*3,(Q.start+Q.count)*3);e.bufferSubData(e.ARRAY_BUFFER,Q.start*3*Float32Array.BYTES_PER_ELEMENT,ve)}},O=sl(),B=Td(e,t.theme.materials.roughness),F=ai,N=new Float32Array(F*3),V=new Float32Array(F*3),H=new Float32Array(F),L=new Float32Array(F),G=new Float32Array(F),j=new Float32Array(F*3),D=new Float32Array(F),U=new Float32Array(F),$=new Float32Array(F),Z=new Float32Array(F*4),te=new Float32Array(F),X=new Float32Array(F),me=new Float32Array(F),re=new it.Geometry(e,{position:{size:3,data:O.position},normal:{size:3,data:O.normal},part:{size:1,data:O.part},index:{data:O.index},iOffset:{size:3,data:N,instanced:1},iColor:{size:3,data:V,instanced:1},iRadius:{size:1,data:H,instanced:1},iYaw:{size:1,data:L,instanced:1},iGlyph:{size:1,data:G,instanced:1},iRing:{size:3,data:j,instanced:1},iFloor:{size:1,data:D,instanced:1},iSection:{size:1,data:U,instanced:1},iPhysicalSeat:{size:1,data:$,instanced:1},iArmrests:{size:4,data:Z,instanced:1},iTipUp:{size:1,data:te,instanced:1},iTaken:{size:1,data:me,instanced:1},iPickIndex:{size:1,data:X,instanced:1}}),ce=ne=>ne.map(W=>1+(W-1)*tu);l.uniforms.uKeyColor.value.set(t.theme.light.key),l.uniforms.uAmbientColor.value.set(t.theme.light.ambient);for(let ne of[d,B])ne.uniforms.uKeyColor.value.set(ce(t.theme.light.key)),ne.uniforms.uAmbientColor.value.set(ce(t.theme.light.ambient));let J=new it.Mesh(e,{geometry:re,program:B});J.frustumCulled=!1;let ae=0,ie=!1,ge=!1,Ae=null,be=null,ke=null,Ke=new Int32Array(0),Be=()=>{let ne=t.seats;for(let W=0;W<ae;W++){let K=Ke[W];me[W]=ql(ne.iState[K]),te[W]=x[K],V[W*3]=p[K*3],V[W*3+1]=p[K*3+1],V[W*3+2]=p[K*3+2]}re.attributes.iColor.needsUpdate=!0,re.attributes.iTipUp.needsUpdate=!0,re.attributes.iTaken.needsUpdate=!0},Fe={main:o,background:r,backgroundProgram:a,seatProgram:d,solidProgram:l,chairProgram:B,seatGeometry:A,chairGeometry:re,solidGeometry:c,drawCalls:3+f,setNearSeats(ne,W){let K=Math.min(W,F,ne.length);if(yd(P,ne,K),A.attributes.iHasChair.needsUpdate=!0,Ke=ne,ae=K,K===0){J.parent&&J.setParent(null),re.instancedCount=0,Fe.drawCalls=3+f+(ie?1:0);return}let Q=t.seats;for(let ve=0;ve<K;ve++){let Ee=ne[ve];N[ve*3]=Q.iPosition[Ee*3],N[ve*3+1]=Q.iPosition[Ee*3+1],N[ve*3+2]=Q.iPosition[Ee*3+2],H[ve]=Q.iChairWidth[Ee],L[ve]=Q.iYaw[Ee],G[ve]=Q.iGlyph[Ee],j[ve*3]=Q.iRing[Ee*3],j[ve*3+1]=Q.iRing[Ee*3+1],j[ve*3+2]=Q.iRing[Ee*3+2],D[ve]=Q.iFloor[Ee],U[ve]=Q.iSection[Ee],$[ve]=Q.iPhysicalSeat[Ee],Z.set(Q.iArmrests.subarray(Ee*4,Ee*4+4),ve*4),X[ve]=Ee+1}Be(),re.attributes.iOffset.needsUpdate=!0,re.attributes.iRadius.needsUpdate=!0,re.attributes.iYaw.needsUpdate=!0,re.attributes.iGlyph.needsUpdate=!0,re.attributes.iRing.needsUpdate=!0,re.attributes.iFloor.needsUpdate=!0,re.attributes.iSection.needsUpdate=!0,re.attributes.iPhysicalSeat.needsUpdate=!0,re.attributes.iArmrests.needsUpdate=!0,re.attributes.iTaken.needsUpdate=!0,re.attributes.iPickIndex.needsUpdate=!0,re.instancedCount=K,J.parent||J.setParent(o),Fe.drawCalls=4+f+(ie?1:0)},nearSeatCount(){return ae},setSectionShellLit(ne){l.uniforms.uSectionFilter.value=ne===null?0:1;let W=bc(t.sectionSolidRanges,t.solids.color,n,_,ne,k);C(W)},setAreaFloorsQuiet(ne){let W=t.areaSolidRanges;if(!W?.length)return;let K=new Set(W.map(Q=>Q.sectionId).filter(Q=>!ne.has(Q)));C(bc(W,t.solids.color,n,R,K,k))},uploadSeatStateRuns(ne){if(!ne.length)return;for(let Q of ne)S(Q.start,Q.length);let W=A.attributes.iTipUp;if(!W.buffer)W.needsUpdate=!0;else{e.bindBuffer(e.ARRAY_BUFFER,W.buffer);for(let Q of ne)e.bufferSubData(e.ARRAY_BUFFER,Q.start*Float32Array.BYTES_PER_ELEMENT,x.subarray(Q.start,Q.start+Q.length))}for(let Q of ne)jd(p,t.seats.iState,Q.start,Q.length,b,y);ae&&Be();let K=T.buffer;if(!K){T.needsUpdate=!0;return}e.bindBuffer(e.ARRAY_BUFFER,K);for(let Q of ne){let ve=p.subarray(Q.start*3,(Q.start+Q.length)*3);e.bufferSubData(e.ARRAY_BUFFER,Q.start*3*Float32Array.BYTES_PER_ELEMENT,ve)}},dispose(){ge=!0,E.dispose(),i.remove(),a.remove(),c.remove(),l.remove(),h?.dispose(),A.remove(),d.remove(),re.remove(),B.remove(),Ae?.remove(),be?.remove(),ke?.texture&&e.deleteTexture(ke.texture)}},Ge=t.productionElements.find(ne=>ne.contentImageUrl&&ne.contentPlane);if(Ge?.contentImageUrl&&Ge.contentPlane?.length===4&&typeof Image<"u"){let ne=new Image;ne.crossOrigin="anonymous",ne.onload=()=>{if(ge)return;let W=Ge.contentPlane;Ae=new it.Geometry(e,{position:{size:3,data:new Float32Array(W.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(Ge.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),ke=new it.Texture(e,{image:ne,generateMipmaps:!0,wrapS:e.CLAMP_TO_EDGE,wrapT:e.CLAMP_TO_EDGE,flipY:!1}),be=new it.Program(e,{vertex:`#version 300 es
|
|
955
1314
|
precision highp float;
|
|
956
1315
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
957
1316
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -959,4 +1318,4 @@ void main() {
|
|
|
959
1318
|
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
|
|
960
1319
|
precision highp float;
|
|
961
1320
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
962
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:te},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let oe=new Ne.Mesh(e,{geometry:q,program:$});oe.frustumCulled=!1,oe.setParent(n),Y.screenProgram=$,G=!0,Y.drawCalls=3+(D?1:0)+1},J.src=K.contentImageUrl}return Y}var Mt=require("ogl");function ex(e,t,n){let o=e+(t<<8)+(n<<16);return o===0?-1:o-1}function Dm(e,t,n,o,r,i){let a=-1,s=1/0;for(let c=0;c<n;c++)for(let l=0;l<t;l++){let u=(c*t+l)*4,m=ex(e[u],e[u+1],e[u+2]);if(m<0||m>=i)continue;let f=l-o,d=c-r,h=f*f+d*d;h<s&&(s=h,a=m)}return a}function Nm(e,t,n,o,r,i){let a=e-n.left,s=t-n.top,c=Math.round(a*o),l=Math.round((n.height-s)*o);return{x:Math.max(0,Math.min(r-1,c)),y:Math.max(0,Math.min(i-1,l))}}var tx=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],Ir=class{constructor(t,n,o,r,i){this.seatScene=new Mt.Transform;this.chairScene=new Mt.Transform;this.solidScene=new Mt.Transform;this.target=null;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=wm(this.gl),this.chairProg=Pm(this.gl),this.depthProg=Am(this.gl);let a=new Mt.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new Mt.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new Mt.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of tx)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new Mt.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),f=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,f);let[d,h,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(d,h,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*f*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,f,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),Dm(b,m,f,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Bm(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,Kn(o.state)):n.push(o);return n}function Vm(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:ze[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var Bt=require("ogl");function nx(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function Gm(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function ox(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Hm(e){let t=Math.hypot(e[0],e[1],e[2]);return t>1e-6?[e[0]/t,e[1]/t,e[2]/t]:[0,0,0]}function Sa(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function wa(e,t){return Math.max(0,Math.min(1,e+t))}function zm(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,f=m*a,d=[0,0,0];for(let h=0;h<3;h++)d[h]=.5*(2*c[h]+(-s[h]+l[h])*a+(2*s[h]-5*c[h]+4*l[h]-u[h])*m+(-s[h]+3*c[h]-3*l[h]+u[h])*f);return d}function Pa(e,t,n,o,r){let i=Hm(nx(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=Gm(Gm(t,ox(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=Hm(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function Aa(e,t,n=35,o=28){let r=Sa(t),i=zm(e,r),a=Sa(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function Xm(e,t,n){let o=e.position.clone(),r=new Bt.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new Bt.Vec3(n[0],n[1],n[2]));let i=new Bt.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var Rr=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new Bt.Quat;this.endQuat=new Bt.Quat;this.outQuat=new Bt.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=Aa(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,wa(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var Ym=Jr,rx=.12,ix=1.6,Km=.12;function $m(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,f=null;for(let d=0;d*3<e.length;d++){if(d===t)continue;let h=e[d*3]-o,p=e[d*3+2]-i,b=h*l+p*u;b<.3||b>1.6||Math.abs(h*u-p*l)>.6||b<m&&(m=b,f=r-e[d*3+1])}return f}var ax=.25,sx=1.5;function Zm(e,t,n=0,o,r,i=!1){let a=[t.x*_,n+sx,t.y*_],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?ix:Ym):Number.isFinite(o)?n+o:n+Ym,u=a[0]-e[0],m=a[2]-e[2],f=Math.hypot(u,m),d=f>.001?Math.min(rx,f*ax):0,h=f>.001?u/f:0,p=f>.001?m/f:0;return{eye:[e[0]+h*d,l,e[2]+p*d],focal:s}}var Vt=Math.PI/180,cx=45,Ia=80,Er=70,lx=1,ux=.99;function mx(e,t){if(!(e<lx))return Ia;if(!(Number.isFinite(t)&&t>0))return Er;let n=2*Math.atan(t/(2*Cr*ux)/Math.max(.05,e))/Vt;return Math.max(Er,Math.min(Ia,n))}var fx=.25,Cr=1,dx=.25,hx=12*Vt,px=.2,bx=1.5,qm=.8,Qm=6,rf=1.9,yx=2/3,gx=.12,xx=.9,Mx=1.2,vx=2,af=.05,Sx=6;function sf(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+qm,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let h of e)o=Math.min(o,h.cx-h.halfX),r=Math.max(r,h.cx+h.halfX),i=Math.min(i,h.cz-h.halfZ),a=Math.max(a,h.cz+h.halfZ),s=Math.max(s,h.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,Qm))/2,m=Math.max(l,Math.min(c,Qm))/2,f=(o+r)/2,d=(i+a)/2;return{min:[f-u,n,d-m],max:[f+u,Math.max(n+qm,s),d+m]}}function wx(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+rf,e.max[2]]}}function Ra(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+bx,t+px,t+rf*yx),(e.min[2]+e.max[2])/2]}function cf(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function Jm(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let f=0;f<8;f++){let d=(f&1?n.max[0]:n.min[0])-e[0],h=(f&2?n.max[1]:n.min[1])-e[1],p=(f&4?n.max[2]:n.min[2])-e[2],b=Math.max(af,d*o+h*r+p*i),y=(d*s+p*c)/b;y<u&&(u=y),y>m&&(m=y)}return m-u}function ef(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,f=s*r,d=1/0,h=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],y=(p&2?n.max[1]:n.min[1])-e[1],M=(p&4?n.max[2]:n.min[2])-e[2],S=Math.max(af,b*o+y*r+M*i),A=(b*u+y*m+M*f)/S;A<d&&(d=A),A>h&&(h=A)}return h-d}function _r(e,t){return Math.tan(e*Vt/2)*Math.max(.05,t)}function tf(e,t,n){let o=mx(n,e),r=c=>Math.max(cx,Math.min(o,c)),i=c=>2*Math.atan(c)/Vt,a=Number.isFinite(e)&&e>0?r(i(e/(2*fx)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*gx))));return e/(2*_r(s,n))>Cr?a:s}function lf(e,t,n,o={}){let r=Ra(t),i=[e[0],e[1],e[2]],a=0,s=0,c=h=>{if(!(h>0))return;let p=cf(i,r);i[0]+=p.x*h,i[2]+=p.z*h,s+=h},l=o.preserveEye?0:t.max[1]+dx-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(hx)));let u=wx(t),m=Jm(i,r,t),f=tf(m,ef(i,r,u),n),d=m/(2*_r(f,n));for(let h=0;!o.preserveEye&&h<Sx&&d>Cr;h++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(d)?d/Cr:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=Jm(i,r,t),f=tf(m,ef(i,r,u),n),d=m/(2*_r(f,n))}return{eye:i,focal:r,fov:f,raisedM:a,pulledBackM:s,stageFrameWidth:d}}function Px(e,t,n){let o=Math.tan(t*Vt/2),r=_r(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var Ax=.7,nf=.5,Ix=.8;function of(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/Vt}function Rx(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-nf)+s[l]*nf));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function uf(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=cf(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=vx*(t.rowDepthM??xx),l=[e.eye[0]+i.x*c,e.eye[1]+Mx,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-Ax,e.eye[2]],m=Rx(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(Ia,Math.max(e.fov,2*Math.max(of(l,m,u),of(l,m,r))/Ix))});let f=(p,b,y,M)=>{let S=Px(y,e.fov,n)*1.08,A=S*Math.sin(M*Vt),x=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,g=Math.max(A,x-b[1]),w=S*Math.cos(M*Vt);return{name:p,eye:[b[0]+i.x*w,b[1]+g,b[2]+i.z*w],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(f("section",t.section.center,t.section.radius,35)),s.push(f("venue",o.center,Math.max(1,o.radius),40));let d=[],h=-1/0;for(let p of s){let b=a(p.eye);d.length&&b<=h+.5||(d.push(p),h=b)}return d}var hf=require("ogl"),wo=Math.PI/180,Ea=320,mf=70*wo,Ex=32*wo,Cx=24*wo,ff=.0026,_x=.22,Tx=.006,Lx=180,kx=900,Ox=1100,Fx=4,Xe=(e,t,n)=>Math.max(t,Math.min(n,e)),df=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function pf(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=Ea,f=null,d=()=>{f&&(clearTimeout(f),f=null)},h=!1,p=[0,0],b=0,y=!1,M=null,S=null,A=new Map,x=!1,g=0,w=0,v=0,P=0,R=()=>r&&o.length?o[Xe(Math.round(i),0,o.length-1)].name:null,k=()=>{let T=R();T!==M&&(M=T,e.onStopChange?.(T))},F=()=>{if(!r||!o.length)return;let T=o[Xe(Math.floor(i),0,o.length-1)],B=o[Xe(Math.ceil(i),0,o.length-1)],D=Xe(i-Math.floor(i),0,1),G=(ee,ne)=>ee+(ne-ee)*D,U=[G(T.eye[0],B.eye[0]),G(T.eye[1],B.eye[1]),G(T.eye[2],B.eye[2])],q=[G(T.focal[0],B.focal[0]),G(T.focal[1],B.focal[1]),G(T.focal[2],B.focal[2])],$=q[0]-U[0],te=q[1]-U[1],Q=q[2]-U[2],X=Math.hypot($,te,Q)||1,Y=Math.atan2($,Q),K=Math.asin(Xe(te/X,-1,1)),J=Y+a,ce=Xe(K+s,-80*wo,80*wo),oe=Math.cos(ce)*X;$=Math.sin(J)*oe,te=Math.sin(ce)*X,Q=Math.cos(J)*oe,n.position.set(U[0],U[1],U[2]),n.fov=G(T.fov,B.fov),n.updateProjectionMatrix(),n.lookAt(new hf.Vec3(U[0]+$,U[1]+te,U[2]+Q)),e.onApplied?.()},E=()=>{if(!r||!o.length)return;let T=Xe(Math.round(i),0,o.length-1);if(e.reducedMotion()){h=!1,i=T,F(),k(),e.requestRender();return}if(Math.abs(T-i)<.001){h=!1,k();return}c=i,l=T,u=performance.now(),m=Ea,h=!0,e.requestRender()},I=T=>{!r||o.length<2||(d(),h=!1,i=Xe(i+T,0,o.length-1),F(),k(),e.requestRender())},C=(T,B)=>{r&&(d(),h=!1,y=!1,a=Xe(a-T*ff,-mf,mf),s=Xe(s-B*ff,-Cx,Ex),F(),e.requestRender())},L=T=>{r&&(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size===1?(x=!0,P=0,g=T.clientX,w=T.clientY):A.size===2&&(x=!1,v=N()))},N=()=>{let T=[...A.values()];return T.length<2?0:Math.hypot(T[0].x-T[1].x,T[0].y-T[1].y)},O=T=>{if(!r||!A.has(T.pointerId))return;if(A.set(T.pointerId,{x:T.clientX,y:T.clientY}),A.size>=2){let G=N();v>0&&I((v-G)*Tx),v=G;return}if(!x)return;let B=T.clientX-g,D=T.clientY-w;g=T.clientX,w=T.clientY,P+=Math.abs(B)+Math.abs(D),!(P<=Fx)&&C(B,D)},H=T=>{A.delete(T.pointerId)&&(A.size<2&&(v=0),A.size===0&&(x=!1,E()))},j=T=>{if(!r)return;T.preventDefault();let B=T.deltaMode===1?16:T.deltaMode===2?100:1,D=Xe(T.deltaY*B/100,-2,2);I(D*_x),S&&clearTimeout(S),S=setTimeout(()=>{S=null,E()},Lx)},V=()=>{d(),r&&(r=!1,h=!1,y=!1,o=[],A.clear(),x=!1,S&&(clearTimeout(S),S=null),M!==null&&(M=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",L),t.addEventListener("pointermove",O),t.addEventListener("pointerup",H),t.addEventListener("pointercancel",H),t.addEventListener("wheel",j,{passive:!1}),{get active(){return r},enter(T,B=0){if(T.length<2){V();return}d(),o=T,r=!0,i=e.reducedMotion()?0:Xe(B,0,T.length-1),i>0&&(f=setTimeout(()=>{f=null,r&&(c=i,l=0,u=performance.now(),m=Ox,h=!0,e.requestRender())},kx)),a=0,s=0,h=!1,y=!1,M=null,F(),k(),e.requestRender()},exit:V,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(y=!1,a=0,s=0,F(),e.requestRender(),!0):(p=[a,s],b=performance.now(),y=!0,e.requestRender(),!0):!1},update(T){if(!r)return!1;let B=!1;if(y){let D=Xe((T-b)/Ea,0,1),G=1-df(D);a=p[0]*G,s=p[1]*G,D>=1?(y=!1,a=0,s=0):B=!0}if(h){let D=Xe((T-u)/m,0,1);i=c+(l-c)*df(D),D>=1?(h=!1,i=l,k()):B=!0}return F(),B},currentStop:R,dispose(){V(),t.removeEventListener("pointerdown",L),t.removeEventListener("pointermove",O),t.removeEventListener("pointerup",H),t.removeEventListener("pointercancel",H),t.removeEventListener("wheel",j)}}}function bf(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}var La=null;function Cf(){return La??=Promise.resolve().then(()=>(Ef(),Rf)).catch(e=>{throw La=null,e}),La}var _f=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),Nr=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=_f(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(_f()-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 Tf(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function Lf(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,f,d=!1)=>{if(l(),e.isDisposed())return null;let h=document.createElement("div");h.setAttribute("role","group"),Object.assign(h.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let y=r.get(m),M=y?.sectionId?n.sections.find(R=>R.id===y.sectionId):void 0,S=y?.label??m;h.setAttribute("aria-label",`Explore views near ${M?.label?`${M.label}, `:""}seat ${S}`);let A=document.createElement("span");A.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",M?.label,S].filter(Boolean).join(" \xB7 "),Object.assign(A.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&h.appendChild(A);let x=document.createElement("div");Object.assign(x.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),h.appendChild(x);let g=y?.rowId?i.get(y.rowId):void 0,w=g?.indexOf(m)??-1,v=w>=0?[g?.[w-1],g?.[w+1]]:[void 0,void 0],P=(R,k,F,E=!1)=>{let I=document.createElement("button");I.type="button",I.textContent=R,I.setAttribute("aria-label",k),Object.assign(I.style,{minHeight:"44px",padding:E?"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"}),E||(I.style.minWidth="44px"),E&&(I.dataset.panoramaTrigger=""),I.addEventListener("click",F),x.appendChild(I)};if(b&&v[0]){let R=r.get(v[0])?.label??v[0];P("\u2039",`View previous seat ${R}`,()=>{e.flyToSeat(v[0])})}if(b&&o.getSeatView){let R=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";P(d?`\u21BB Retry ${R}`:`\u25C9 ${R}`,`${d?"Retry":R} from seat ${S}`,()=>{if(e.isDisposed()||f!==e.flightGen()){l();return}l(),e.openPanorama(m,400,f)},!0)}if(b&&v[1]){let R=r.get(v[1])?.label??v[1];P("\u203A",`View next seat ${R}`,()=>{e.flyToSeat(v[1])})}return!x.childElementCount&&!p?null:(t.appendChild(h),s=h,c(),h)},remove:l,layout:c}}var Zx={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function kf(e){let{container:t,orbit:n,isNarrow:o}=e,r={...Zx,...e.labels??{}},i=(x,g)=>{x.setAttribute("aria-label",g),x.title=g},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let f=document.createElement("button");f.type="button",f.textContent="\u2212",i(f,r.zoomOut);let d=document.createElement("button");d.type="button",d.textContent="+",i(d,r.zoomIn);for(let x of[u,m,f,d])x.className="sl-3d-icon-control",Object.assign(x.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});c.append(u,m),l.append(d,f);let h=null,p=()=>{let x=n.dragAction();if(x===h)return;h=x;let g=x==="orbit";u.setAttribute("aria-pressed",String(g)),m.setAttribute("aria-pressed",String(!g)),u.style.background=g?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=g?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=g?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=x=>{n.setPrimaryDragMode(x),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let y=()=>{let{atMin:x,atMax:g}=n.dollyLimitState();d.disabled!==x&&(d.disabled=x),f.disabled!==g&&(f.disabled=g)};f.addEventListener("click",()=>{n.zoomBy($n),y()}),d.addEventListener("click",()=>{n.zoomBy(ln),y()}),a.append(c,l),b("auto"),t.appendChild(a);let M=e.enabled!==!1,S=()=>{let x=o();a.style.display=s||!M?"none":"flex",a.style.right=x?"12px":"14px",a.style.bottom=x?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=x?"none":"flex",d.style.display=x?"none":"",f.style.display=x?"none":""};return S(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:y,setSeatViewLocked:x=>{s=x,n.setInteractionEnabled(!x),S()},seatViewLocked:()=>s,layout:S}}var qx=.5,Of=12,Ff=20,Qx=28;function Jx(e,t,n){return!(e>0)||!(n>0)?0:qx*n/(2*e*Math.tan(t*Math.PI/360))}function Df(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:f,focusSectionCamera:d,setSelection:h,ensureSeatView:p}=e,b=0,y=0,M=0,S=-1,A=!1,x=!1,g=E=>{e.seatViewLocked()||S===-1&&(S=E.pointerId,b=E.clientX,y=E.clientY,M=performance.now(),A=!1,x=a.active,a.active&&(s.cinematicCancelled(),f(),i.onViewTargetChange?.(null)))},w=E=>{E.pointerId===S&&Math.hypot(E.clientX-b,E.clientY-y)>u&&(A=!0)},v=(E,I,C,L,N)=>{let O=t.canvas.getBoundingClientRect(),H=t.canvas.clientWidth||O.width||1,j=t.canvas.clientHeight||O.height||1,V=E-O.left,T=I-O.top,B=L*L,D=-1,G=B,U=1/0;for(let q of r){if(C&&q.sectionId!==C)continue;let $=o.seats.idToIndex.get(q.id);if($===void 0)continue;if(N){let J=Math.round(o.seats.iState[$]??0);if(J!==0&&J!==3)continue}let te=$*3,Q=gt(n.camera.projectionViewMatrix,[o.seats.iPosition[te],o.seats.iPosition[te+1]+.55,o.seats.iPosition[te+2]],H,j);if(!Q.visible)continue;let X=Q.x-V,Y=Q.y-T,K=X*X+Y*Y;(K<G||Math.abs(K-G)<1&&Q.depth<U)&&(D=$,G=K,U=Q.depth)}return D},P=(E,I)=>{let C=e.gpu(),L=e.pick();if(!C||!L)return-1;L.syncFromSeatProgram(C.seatProgram);let N=t.canvas.getBoundingClientRect(),O=t.renderer.dpr,{x:H,y:j}=Nm(E,I,N,O,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),V=Math.max(2,Math.round(8*O));return L.pick(n.camera,H,j,V)},R=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,k=(E,I=Of)=>{let C=n.camera?.position;if(!C)return!1;let L=E*3,N=Math.hypot(C.x-o.seats.iPosition[L],C.y-o.seats.iPosition[L+1],C.z-o.seats.iPosition[L+2]);return Jx(N,n.fovY,R())>=I};return{onDown:g,onMove:w,onUp:E=>{if(E.pointerId!==S)return;let I=!A&&performance.now()-M<m;if(S=-1,x){x=!1;return}let C=e.gpu(),L=e.pick();if(!I||!C||!L)return;let N=P(E.clientX,E.clientY),O=E.pointerType==="touch"||E.pointerType==="pen",H=O?Ff:Of,j=N>=0&&k(N,H),V=!1;if(e.focusedSectionId()&&N>=0){let D=c[N],G=D?l.get(D):void 0;if(G&&G!==e.focusedSectionId()&&d(G,{keepCamera:j})){if(!j)return;V=!0}}if(e.focusedSectionId()&&N<0&&(N=v(E.clientX,E.clientY,e.focusedSectionId(),44,!1)),e.focusedSectionId()&&N<0){let D=v(E.clientX,E.clientY,null,72,!1),G=D>=0?c[D]:void 0,U=G?l.get(G):void 0;if(U&&U!==e.focusedSectionId()&&d(U))return}if(!e.focusedSectionId()){N<0&&(N=v(E.clientX,E.clientY,null,42,!1));let D=N>=0?c[N]:void 0,G=D?l.get(D):void 0;if(G&&d(G,{keepCamera:j})){if(!j)return;V=!0}}if(N<0||N>=c.length){e.selection().size&&(h([]),i.onViewTargetChange?.(null));return}let T=c[N];if(O&&e.focusedSectionId()&&!V&&!k(N,Ff)){e.focusSeatCamera(T,{seatPx:Qx,viewportHeightPx:R()});return}let B=ze[Math.round(o.seats.iState[N]??0)]??"available";if(B!=="available"&&B!=="selected"){i.onSeatInspect?.(T,B);return}if(e.selection().has(T)&&e.selection().size===1){h([]),i.onViewTargetChange?.(null),i.onSeatPick?.(T);return}h([T]),p(T),s.seatPicked(T,l.get(T)),i.onSeatPick?.(T)}}}var Br=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let d=0;d<this.count;d++){let h=t[d*3],p=t[d*3+2];h<n&&(n=h),h>r&&(r=h),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=d=>{let h=Math.min(this.cols-1,Math.max(0,Math.floor((t[d*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[d*3+2]-o)/this.cell)))*this.cols+h};for(let d=0;d<this.count;d++)l[u(d)+1]++;for(let d=0;d<c;d++)l[d+1]+=l[d];let m=new Int32Array(this.count),f=l.slice(0,c);for(let d=0;d<this.count;d++)m[f[u(d)]++]=d;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),f=Math.ceil(o/this.cell)+1,d=this.iPosition,h=0;for(let p=0;p<=f&&h<c;p++){let b=m-p,y=m+p,M=u-p,S=u+p;for(let A=b;A<=y&&h<c;A++){if(A<0||A>=this.rows)continue;let x=A===b||A===y;for(let g=M;g<=S&&h<c;g++){if(!x&&g!==M&&g!==S){g=S-1;continue}if(g<0||g>=this.cols)continue;let w=A*this.cols+g;for(let v=a[w],P=a[w+1];v<P&&h<c;v++){let R=s[v],k=d[R*3]-t,F=d[R*3+2]-n,E=i===void 0?0:d[R*3+1]-i;k*k+E*E+F*F<=l&&(r[h++]=R)}}}}return h}};var Vr=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Bo);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new Br(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<mi)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>ui){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,ui,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function Nf(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var Gr=require("ogl");function Bf(){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 Vf(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,f=-1,d=(R,k,F=28)=>{r.camera.position.set(R[0],R[1],R[2]),r.camera.lookAt(new Gr.Vec3(k[0],k[1],k[2])),r.camera.fov=F,r.camera.updateProjectionMatrix()},h=document.createElement("button");h.className="sl-3d-overview-control sl-3d-icon-control",h.type="button",h.replaceChildren(Bf());let p=o.navLabels?.fitView??"Show whole venue";h.setAttribute("aria-label",p),h.title=p,Object.assign(h.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let b=()=>{h.firstElementChild||h.replaceChildren(Bf())};b();let y=R=>{f=R;let k=e.gpu();k&&(k.seatProgram.uniforms.uFocusFloor.value=R,k.solidProgram.uniforms.uFocusFloor.value=R,k.chairProgram.uniforms.uFocusFloor.value=R),e.showSectionSeatLabels(null)},M=null,S=!1,A=()=>{if(M=null,S=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),h.style.display="",c.setVisible(!0),e.setFrozen(!1);let R=f>=0?n.floors[f]:null;if(e.setNearFieldDetailEnabled(!!R),e.setSeatViewLocked(!1),x(),e.removeArriveChip(),e.setNavigationMode("auto"),R){let k=R.focalWorld[0]-R.center[0],F=R.focalWorld[2]-R.center[2],E=Math.hypot(k,F)>R.radius*.12?Math.atan2(k,F):l,I={center:R.center,radius:R.radius,box:R.box},C={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(I,!1,E,!1,C):r.frameSoft(I,E,!1,C)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},x=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},g=R=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let k=n.seats.idToIndex.get(R);if(k===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(R),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),h.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let F=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(F),e.setSeatViewLocked(!1);let E=++m;F?e.showArriveChip(R,E):e.removeArriveChip();let{eye:I,focal:C}=e.resolvedSeatViewPose(R,k),L=o.arriveAtSeatEye?e.seatViewArrival(R,k):null,N=L&&L.stops.length>1&&L.stops[1].name==="row"?L.stops[1]:null,O=L?L.focal:C,H=[r.camera.position.x,r.camera.position.y,r.camera.position.z],j=Pa(H,L?.eye??I,O,n.bounds.center,n.bounds.radius),V=N?N.eye:L?L.eye:o.arriveAtSeatEye?I:j.finalPos,T=L?L.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?Er:65:28,B=[j.waypoints[0],j.waypoints[1],V];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),d(V,O,T),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),L&&e.enterSeatView(L.stops),e.showArriveChip(R,E),Promise.resolve();let D=new Gr.Quat().copy(r.camera.quaternion),G=Xm(r.camera,V,O);s.requestRender();let U=F?700:2500;return i.start(B,D,G,U,T).then(()=>{e.isDisposed()||E!==m||(e.setSeatStepping(!1),a.cinematicPlayed(U),r.resumeAfterFlight(O),e.setSeatViewLocked(o.arriveAtSeatEye===!0),L&&e.enterSeatView(L.stops,N?1:0),s.requestRender(),e.showArriveChip(R,E))})},w=(R,k)=>{let F=n.sections.find(E=>E.id===R);if(!F||F.seatCount===0)return!1;if(M=R,S=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&f!==F.floorIndex&&y(F.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(R),!k?.keepCamera){let E=Nf(F),I={polarDeg:E.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:E.center,radius:E.radius},!1,r.currentAzimuth,!1,I):r.glideTo({center:E.center,radius:E.radius},I)}return o.onSectionFocusChange?.(R),s.requestRender(),!0},v=(R,k)=>{if(e.isDisposed()||!e.gpu())return!1;let F=n.seats.idToIndex.get(R);if(F===void 0)return!1;let E=F*3,I=[n.seats.iPosition[E],n.seats.iPosition[E+1]+.55,n.seats.iPosition[E+2]],C=k?eM(k,r.fovY,r.camera.aspect||1):Gf;return S=!0,e.setSeeThrough?.(I),e.reducedMotion()?r.frame({center:I,radius:C},!1,void 0,!1,ka):r.frameSoft({center:I,radius:C},void 0,!1,ka),s.requestRender(),!0},P=()=>{if(e.isNarrow?.()&&S&&M&&w(M)){s.requestRender();return}A()};return h.addEventListener("click",P),{overviewChip:h,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>f,applyFloorFocus:y,placeCameraFinal:d,cancelFlight:x,focusOverview:A,flyToSeat:g,focusSectionCamera:w,focusSeatCamera:v}}var Gf=4.5;function eM(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=tM*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/ka.margin;return Math.max(nM,Math.min(Gf,a))}var tM=.5,nM=1.5,ka={polarDeg:48,margin:1.25};function Ao(e,t){let{doc:n,report:o}=xr(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(d=>[d.id,d.role])),l=d=>d.map(h=>h.type==="shape"&&c.has(h.id)?{...h,role:c.get(h.id)}:h),u=e.floors?.map(d=>({...d,objects:l(d.objects)})),m=new Float64Array(t.length).fill(Number.NaN),f=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((d,h)=>{d.eyeHeightM!==void 0&&(m[h]=d.eyeHeightM),d.focalPoint&&(f[h*2]=d.focalPoint.x,f[h*2+1]=d.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:f}}let i=new Map(yn(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function Oa(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function Hf(e){let t=e.estimate===!1?null:Ao(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:Oa(e.seats,t)},estimate:t}:{input:e}}function Fa(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let f=0;f<t;f++){let d=f*3,h=gt(n,[e[d],e[d+1]+c,e[d+2]],o,r);if(!h.visible)continue;let p=h.x-i,b=h.y-a,y=p*p+b*b;(y<u-4||y<u+4&&h.depth<m)&&(l=f,u=Math.min(u,y),m=h.depth)}return l}var rM={};function zf(e){let t=performance.now(),{input:n,estimate:o}=Hf(e);return{model:Ln(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function oM(e){let t=yn(e.doc);return{...zf({...e,seats:t}),seats:t}}function Uf(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",rM.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage(e)})}function jf(e){return Uf(e,()=>zf(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function Wf(e){return Uf(e,()=>oM(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var iM=40,aM=48,sM=Math.PI/180,cM=6,lM=500,uM=6;function mM(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Ao(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:Oa(t.seats,r)});let i=t.prepared?.model??Ln(t),a=new Nr(n.onAnalytics),s=new Array(i.seats.count);for(let[z,W]of i.seats.idToIndex)s[W]=z;let c=new Map(t.seats.map(z=>[z.id,z])),l=new Map;for(let z of t.seats){if(!z.rowId)continue;let W=l.get(z.rowId);W?W.push(z.id):l.set(z.rowId,[z.id])}let u=new Map,m=[0,0,0,0];function f(){if(b)for(let z of[b.seatProgram,b.solidProgram,b.chairProgram])z.uniforms.uSeeThrough.value=m}t.seats.forEach((z,W)=>{u.set(z.id,i.seatSectionIds?.[W]??z.sectionId)});let d=new Map;for(let[z,W]of i.seats.idToIndex){let Z=u.get(z);if(!Z)continue;let se=d.get(Z);se?se.push(W):d.set(Z,[W])}let h=()=>{if(!b||!i.sectionSolidRanges.length)return;let{lit:z,anyUnlit:W}=Tm(i.sectionSolidRanges,d,i.seats.iState);b.setSectionShellLit(W?z:null)},p=t.doc.floors?.some(W=>(W.baseHeightM??0)>0)?!0:(t.doc.floors?.flatMap(W=>W.objects)??t.doc.objects).some(W=>W.type==="section"&&((W.height??0)>0||(W.rake??0)>0)),b=null,y=null,M=null,S=!1,A=!1,x=!1,g=new Map,w=null,v=null,P=null,R=new Map,k=null,F=()=>{P===null&&(P=e.style.zIndex,e.style.zIndex="20")},E=()=>{P!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=P),P=null)},I=!1,C=()=>I?je.focusedFloor():-1,L=()=>{b=Fm(B.gl,i),y?.dispose(),y=sm(B.gl,[1,1,1],i.theme.seatStates.selected),Va(!1),h(),re(),M=new Ir(B.renderer,b.seatGeometry,b.chairGeometry,b.solidGeometry,i.seats.count),B.setClearColor(i.theme.background.top),M.setRestoreClear(i.theme.background.top),M.setRoomCentre(i.room?.centre),b.seatProgram.uniforms.uSeatRadius.value=St*i.theme.seatScale,b.seatProgram.uniforms.uFocusFloor.value=C(),b.solidProgram.uniforms.uFocusFloor.value=C(),b.chairProgram.uniforms.uFocusFloor.value=C(),b.screenProgram&&(b.screenProgram.uniforms.uFocusFloor.value=C()),f(),O.forceRegather()},N=!1,O=new Vr({model:i,orbit:()=>D,gpu:()=>b}),H=!1,j=new Map,V=24,T=z=>O.setDetailEnabled(z),B=new Fo(e,{onContextLost:()=>{x||a.contextLost(),S=!0,Ie.stop(),b=null,M=null},onContextRestored:()=>{L(),S=!1,x||a.contextRestored(),Ie.requestRender()}}),D=new Do(B.gl,B.canvas,()=>Ie.requestRender(),()=>a.orbitEngaged());D.setAspect(B.aspect);let G=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="section"&&z.physical3dProvenance?.surfaceKind?.status==="inferred"),U=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(G&&i.stages.length===0))return Ja(i.focalWorld,i.seats.iPosition,i.bounds)})(),q=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="shape"&&z.stageKind?.startsWith("pitch-")),$=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:q?36:48,margin:1.05},te=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;D.frame(i.bounds,!te&&n.skipInitialOverviewAnimation!==!0,U,n.portraitOverviewCrop===!0,$);let Q=new Rr(D.camera),X=Tf(e),Y=es(e,i),K=new wr(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),J=i.labels,ce=()=>Ru(J,i.floors.length,C());K.setLabels(ce()),K.setOverviewDistance(D.targetDistance);let oe=()=>{let z=new Map,W=ze.indexOf("available");for(let Z of J){if(!Z.wheelchairSeats)continue;let se=0;for(let me of Z.wheelchairSeats)i.seats.iState[me]===W&&se++;se>0&&z.set(Z.id,se)}return K.setWheelchairFree(z)};oe();let ee=null,ne=()=>[...g.keys()].flatMap(z=>{let W=i.seats.idToIndex.get(z),Z=W===void 0?void 0:t.seats[W];if(W===void 0||Z?.id!==z)return[];let se=W*3;return[{id:`seat:${z}`,kind:"seat",seatWidthM:i.seats.iChairWidth[W]*2,text:Z.displayLabel||Z.label,anchor:[i.seats.iPosition[se],i.seats.iPosition[se+1]+1.05,i.seats.iPosition[se+2]],pinBase:Hr(se)}]}),he=-1,re=()=>{b&&(he=ee?i.sections.findIndex(z=>z.id===ee):-1,b.seatProgram.uniforms.uFocusSection.value=he,b.chairProgram.uniforms.uFocusSection.value=he)},ve=z=>{if(ee=z,re(),K.setForcedDense(!!z),!z){let ie=ne(),ke=new Set(ie.map(Ce=>Ce.id));K.setLabels([...ce().filter(Ce=>!ke.has(Ce.id)),...ie]);return}let W=t.seats.filter(ie=>u.get(ie.id)===z),Z=new Set(W.map(ie=>ie.id)),se=new Set(W.map(ie=>ie.rowId)),me=new Set(g.keys()),Se=new Set(W.filter(ie=>me.has(ie.id)).map(ie=>ie.id)),Me=ce().filter(ie=>ie.kind!=="row"&&ie.kind!=="seat"&&ie.kind!=="access"||ie.kind==="access"&&Z.has(ie.id.slice(7))||(ie.kind==="row"?se.has(ie.id.slice(4)):Z.has(ie.id.slice(5))));if(i.seatCount<=6e3&&Se.size===0){K.setLabels(Me);return}let Ee=W,He=new Set(Ee.map(ie=>`seat:${ie.id}`)),Ke=Ee.flatMap(ie=>{let ke=i.seats.idToIndex.get(ie.id);if(ke===void 0)return[];let Ce=ke*3;return[{id:`seat:${ie.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[ke]*2,rowId:ie.rowId,text:me.has(ie.id)?ie.displayLabel||ie.label:ha(ie.displayLabel||ie.label),anchor:[i.seats.iPosition[Ce],i.seats.iPosition[Ce+1]+(me.has(ie.id)?1.05:.55),i.seats.iPosition[Ce+2]],...me.has(ie.id)?{pinBase:Hr(Ce)}:{}}]});K.setLabels([...Me.filter(ie=>!He.has(ie.id)),...Ke])};L();let we=null,ot=null,ut=new Xf.Mat4,Ye=z=>{if(S||!b||A)return!1;let W=bf({flying:Q.active,panoramaMounted:w!==null,seatViewActive:we?.active===!0}),Z=W==="orbit"?he:-1;b.seatProgram.uniforms.uFocusSection.value=Z,b.chairProgram.uniforms.uFocusSection.value=Z;let se=H?!1:W==="cinematic"?Q.update(performance.now()):W==="seatView"?we.update(performance.now()):W==="orbit"?D.update():!1;ot?.syncZoomLimits(),ot?.syncNavigationMode();let me=C()>=0?i.floors[C()]:null,Se=me?.radius??i.bounds.radius,Me=Cs(D.currentDistance,Se),Ee=N?{center:[D.camera.position.x,D.camera.position.y,D.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;D.updateClipping(Ee);let He=me?.center??i.renderBounds.center,Ke=me?.radius??i.renderBounds.radius,ie=(De,qr)=>Math.hypot(D.camera.position.x-De[0],D.camera.position.y-De[1],D.camera.position.z-De[2])<=qr*(O.detailVisible?1.8:1.55),ke=ie(He,Ke);if(!ke&&ee){let De=i.sections.find(qr=>qr.id===ee);De&&(ke=ie(De.center,Math.max(12,De.radius*2)))}O.detailVisible=ke;let Ce=b.seatProgram.uniforms;Ce.uSeatScale.value=Me.scale,Ce.uSeatFade.value=Me.fade;let it=!!me&&_s(me.seatCount,B.canvas.clientWidth||1,B.canvas.clientHeight||1),jt=Ts(i.seats.count,Se,D.currentDistance,D.camera.fov,B.canvas.clientHeight||1),Gn=O.detailVisible||it||jt?1:0,Hn=O.detailVisible||C()>=0||i.floors.length>1?1:0;O.ease(z,Gn,Hn),Ce.uSeatDetail.value=O.seatDetailMix;let Eo=Gn===0&&O.seatDetailMix<.01;b.seatGeometry.setDrawRange(Eo?ei:0,Eo?ss:ei),b.solidProgram.uniforms.uStructureDetail.value=O.structureDetailMix,Ce.uMinPixels.value=Me.minPixels,Ce.uPixelToWorld.value=2*Math.tan(D.camera.fov*sM/2)/Math.max(1,B.pixelHeight),O.update(O.detailVisible),i.outdoor&&(ut.copy(D.camera.projectionViewMatrix).inverse(),b.backgroundProgram.uniforms.uInvViewProj.value.set(ut)),B.renderer.render({scene:b.background,clear:!0}),B.renderer.render({scene:b.main,camera:D.camera,clear:!1});let zn=y?y.update(performance.now(),[D.camera.position.x,D.camera.position.y,D.camera.position.z],w!==null,W==="seatView"):!1;if(y&&B.renderer.render({scene:y.root,camera:D.camera,clear:!1}),Y){let De=D.camera.worldMatrix;Y.update(W==="seatView"?[D.camera.position.x,D.camera.position.y,D.camera.position.z]:null,[-De[8],-De[9],-De[10]])}K.update(D.camera.projectionViewMatrix,B.canvas.clientWidth||1,B.canvas.clientHeight||1,D.currentDistance,Se,[D.camera.position.x,D.camera.position.y,D.camera.position.z]);let rn=se||zn||O.seatDetailMix!==Gn||O.structureDetailMix!==Hn;return rt(!rn),rn},rt=ws(e),Ie=new No(Ye),Ht=typeof ResizeObserver<"u"?new ResizeObserver(()=>Zr.resize()):null;Ht?.observe(e),D.setZoomPointResolver((z,W)=>{let Z=B.canvas.getBoundingClientRect(),se=B.canvas.clientWidth||Z.width,me=B.canvas.clientHeight||Z.height;if(!(se>0)||!(me>0))return null;D.camera.updateMatrixWorld();let Se=Fa(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,se,me,z-Z.left,W-Z.top,iM);if(Se<0)return null;let Me=Se*3;return[i.seats.iPosition[Me],i.seats.iPosition[Me+1]+.5,i.seats.iPosition[Me+2]]});function Hr(z){return[i.seats.iPosition[z],i.seats.iPosition[z+1]+.5,i.seats.iPosition[z+2]]}K.setSeatNumberRow(null);let mt=null,zt=0,zr=null,Da=()=>{zt=0;let z=null,W=null;if(mt&&!we?.active&&!Q.active){let me=B.canvas.getBoundingClientRect(),Se=B.canvas.clientWidth||me.width,Me=B.canvas.clientHeight||me.height;if(Se>0&&Me>0){let Ee=Fa(i.seats.iPosition,i.seats.count,D.camera.projectionViewMatrix,Se,Me,mt.x-me.left,mt.y-me.top,aM);z=Ee>=0?t.seats[Ee]?.rowId??null:null;let He=Ee>=0?t.seats[Ee]?.id??null:null;if(W=He,mt.mouse&&!mt.pressing&&!!ee&&!!He&&u.get(He)===ee){let ie=e.getBoundingClientRect();zr=He,n.onSeatHover?.(He,{x:mt.x-ie.left,y:mt.y-ie.top})}else Na()}}else Na();let Z=mt?.mouse?W:null,se=K.setSeatNumberSeat(Z);(K.setSeatNumberRow(z)||se)&&Ie.requestRender()};function Na(){zr!==null&&(zr=null,n.onSeatHover?.(null,null))}let Io=z=>{mt={x:z.clientX,y:z.clientY,mouse:z.pointerType==="mouse",pressing:z.type==="pointerdown"},zt||(zt=requestAnimationFrame(Da))},Ba=z=>{z.pointerType==="mouse"&&(mt=null,zt||(zt=requestAnimationFrame(Da)))};B.canvas.addEventListener("pointermove",Io),B.canvas.addEventListener("pointerdown",Io),B.canvas.addEventListener("pointerleave",Ba);function Va(z){if(!y)return;let W=[];for(let Z of g.keys()){let se=i.seats.idToIndex.get(Z);if(se===void 0)continue;let me=se*3;W.push({id:Z,position:Hr(me)})}y.setSeats(W,performance.now(),z)}let Ga=z=>{let W=me=>{let Se=i.seats.idToIndex.get(me);return Se===void 0?void 0:i.seats.iState[Se]},{updates:Z,next:se}=Vm(g,z,W);if(g=se,K.setSelectedSeatIds(g.keys()),Va(!Nn()),Ie.requestRender(),ve(ee),Z.length){let me=gi(i.seats,Z);b&&b.uploadSeatStateRuns(me),h(),Ie.requestRender()}},Nn=()=>k!==null?k:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Yf=8,Ha=z=>{if(!n.getSeatView)return null;let W=R.get(z);if(!W)for(W=Promise.resolve(n.getSeatView(z)),R.set(z,W),W.catch(()=>{R.get(z)===W&&R.delete(z)});R.size>Yf;){let Z=R.keys().next().value;if(Z===void 0)break;R.delete(Z)}return W},za=sf(i.stages,i.focalWorld,i.bounds.groundY??0),Ua=Ra(za),Ur=(z,W)=>{let Z=c.get(z),se=Math.max(0,Math.round(i.seats.iFloor[W]??0)),me=t.doc.floors?.[se],Se=i.floors[se],Me=me?.focalPoint??t.doc.focalPoint,Ee=Se?{x:Se.focalWorld[0]/_,y:Se.focalWorld[2]/_}:Me,He=Z?.focalPoint?{x:Z.focalPoint.x+Ee.x-Me.x,y:Z.focalPoint.y+Ee.y-Me.y}:Ee,Ke=[i.seats.iPosition[W*3],i.seats.iPosition[W*3+1],i.seats.iPosition[W*3+2]],ie=$m(i.seats.iPosition,W,Ua),ke=ie!==null&&Math.abs(ie)<Km;return Zm(Ke,He,me?.baseHeightM??0,Z?.eyeHeightM,Ua,ke)},jr=()=>(e.clientWidth||B.canvas.clientWidth)<=520,Wr=null,ja=null,Kf=async(z,W,Z)=>{if(!n.getSeatView||x||Z!==je.flightGen())return;let se;try{se=await Cf()}catch{if(a.panoramaFailed(z,"mount"),!x&&Z===je.flightGen()){let me=Yr(z,Z,!0);requestAnimationFrame(()=>me?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(x||Z!==je.flightGen()||!Wr))return ja??=se.createOpenPanorama(Wr),ja(z,W,Z)},Xr=Lf({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:jr,isDisposed:()=>x,flightGen:()=>je.flightGen(),flyToSeat:z=>$a(z),openPanorama:(z,W,Z)=>Kf(z,W,Z)}),Yr=Xr.show,Kr=Xr.remove,$f=Xr.layout,Ut=kf({container:e,orbit:D,isNarrow:jr,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ot=Ut;let Zf=Ut.element,Bn=Ut.setNavigationMode,qf=Ut.layout,Qf=Ut.utilityControls,Vn=null,Wa=!1,Ro=z=>{Ut.setSeatViewLocked(z),z||we?.exit()};we=pf({canvas:B.canvas,camera:D.camera,requestRender:()=>Ie.requestRender(),reducedMotion:Nn,onStopChange:z=>{let W=z??(Wa?"seat":null);Vn=W;try{n.onSeatViewStopChange?.(W)}catch{}},onApplied:()=>{x||D.syncFromCamera()}});let Xa=i.sections.reduce((z,W)=>W.seatCount>0&&W.box?Math.max(z,W.box.max[1]):z,-1/0),Ya=(z,W)=>{let{eye:Z}=Ur(z,W),se=(e.clientWidth||B.canvas.clientWidth||1)/Math.max(1,e.clientHeight||B.canvas.clientHeight||1),me=lf(Z,za,se,{preserveEye:!0});if(n.seatViewStops===!1)return{...me,stops:[]};let Se=u.get(z),Me=Se?i.sections.find(Ee=>Ee.id===Se):void 0;return{...me,stops:uf(me,{aspect:se,seatingTopY:Number.isFinite(Xa)?Xa:i.bounds.box.max[1],section:Me&&Me.seatCount>0?{center:Me.center,radius:Me.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},je=Vf({isNarrow:jr,setSeeThrough:z=>{m=z?[z[0],z[1],z[2],uM]:[0,0,0,0],f(),Ie.requestRender()},container:e,model:i,opts:n,orbit:D,cinematic:Q,analytics:a,loop:Ie,labelOverlay:K,stageAzimuth:U,overviewFraming:$,gpu:()=>b,isDisposed:()=>x,panorama:()=>w,setPanorama:z=>{w=z},setPanoramaSphereVisible:z=>{N=z},panoramaLoadAbort:()=>v,setPanoramaLoadAbort:z=>{v=z},setFrozen:z=>{A=z},restorePanoramaLayer:E,reducedMotion:Nn,resolvedSeatViewPose:Ur,showSectionSeatLabels:ve,setNearFieldDetailEnabled:T,setSeatViewLocked:Ro,setNavigationMode:Bn,showArriveChip:Yr,removeArriveChip:Kr,inSeatView:()=>Vn!==null,setSeatStepping:z=>{Wa=z},seatViewArrival:(z,W)=>n.arriveAtSeatEye?Ya(z,W):null,enterSeatView:(z,W)=>we?.enter(z,W)});I=!0;let $r=je.overviewChip,Jf=je.layoutOverviewChip,ed=je.applyFloorFocus,td=je.focusOverview,Ka=je.cancelFlight,$a=je.flyToSeat,Za=je.focusSectionCamera;Qf.appendChild($r),Wr={container:e,model:i,opts:n,analytics:a,orbit:D,loop:Ie,seatsById:c,ensureSeatView:Ha,resolvedSeatViewPose:Ur,gpu:()=>b,gl:B.gl,isContextLost:()=>S,isDisposed:()=>x,flightGen:()=>je.flightGen(),setPanorama:z=>{w=z},getLoadAbort:()=>v,setLoadAbort:z=>{v=z},setPanoramaSphereVisible:z=>{N=z,z&&we?.exit()},setFrozen:z=>{A=z},raisePanoramaLayer:F,restorePanoramaLayer:E,getOverviewChip:()=>$r,labelOverlay:K,reducedMotion:Nn,removeArriveChip:Kr,showArriveChip:Yr};let Rt=Df({glctx:B,orbit:D,model:i,seats:t.seats,opts:n,cinematic:Q,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:cM,tapMs:lM,gpu:()=>b,pick:()=>M,seatViewLocked:()=>Ut.seatViewLocked(),focusedSectionId:()=>ee,selection:()=>g,cancelFlight:Ka,focusSectionCamera:Za,focusSeatCamera:je.focusSeatCamera,setSelection:Ga,ensureSeatView:Ha});B.canvas.addEventListener("pointerdown",Rt.onDown),B.canvas.addEventListener("pointermove",Rt.onMove),B.canvas.addEventListener("pointerup",Rt.onUp),B.canvas.addEventListener("pointercancel",Rt.onUp),Ie.requestRender();let Zr={setAvailability(z){let W=Bm(g,z),Z=gi(i.seats,W);Z.length&&b&&b.uploadSeatStateRuns(Z),h(),Z.length&&oe(),Ie.requestRender()},setSelection:Ga,setNavigationMode:Bn,zoomIn(){D.zoomBy(ln),Ie.requestRender()},zoomOut(){D.zoomBy($n),Ie.requestRender()},flyToSeat:$a,focusOverview:td,seatViewStop:()=>Vn,recentreSeatView:()=>we?.recentre()??!1,resize(){let{width:z,height:W}=B.resize();D.setAspect(z/Math.max(1,W)),$f(),qf(),Jf(),Ie.requestRender()},stats(){return{...Ie.stats(),drawCalls:b?b.drawCalls:0,fallbackTriangles:b?b.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(z=1280){if(S||!b||typeof document>"u")return null;Ye(0);let W=B.canvas,Z=Math.min(1,z/Math.max(W.width,W.height,1)),se=document.createElement("canvas");se.width=Math.max(1,Math.round(W.width*Z)),se.height=Math.max(1,Math.round(W.height*Z));let me=se.getContext("2d");return me?(me.drawImage(W,0,0,se.width,se.height),se.toDataURL("image/jpeg",.82)):null},captureSeatView(z,W=480){if(S||!b||A||typeof document>"u"||Q.active||w!==null||we?.active)return null;let Z=j.get(z);if(Z)return Z;let se=i.seats.idToIndex.get(z);if(se===void 0)return null;let{eye:me,focal:Se,fov:Me}=Ya(z,se),Ee=D.snapshot(),He=[O.seatDetailMix,O.structureDetailMix],Ke=null;try{H=!0,D.camera.position.set(me[0],me[1],me[2]),D.camera.perspective({fov:Me,aspect:D.camera.aspect}),D.camera.lookAt(Se),D.camera.updateMatrixWorld(),D.syncFromCamera(),O.seatDetailMix=1,O.structureDetailMix=1,O.forceRegather(),Ye(0);let ie=B.canvas,ke=Math.min(ie.width,Math.round(ie.height*16/9)),Ce=Math.round(ke*9/16),it=document.createElement("canvas");it.width=Math.max(1,Math.round(W)),it.height=Math.max(1,Math.round(W*9/16));let jt=it.getContext("2d");jt&&(jt.drawImage(ie,(ie.width-ke)/2,(ie.height-Ce)/2,ke,Ce,0,0,it.width,it.height),Ke=it.toDataURL("image/jpeg",.8))}finally{H=!1,Ee(),O.seatDetailMix=He[0],O.structureDetailMix=He[1],O.forceRegather(),Ye(0)}if(Ke)for(j.set(z,Ke);j.size>V;)j.delete(j.keys().next().value);return Ke},getQualityEvidence(){let z=Ie.stats(),W=B.canvas.clientWidth||1,Z=B.canvas.clientHeight||1,se=i.bounds.center,me=gt(D.camera.projectionViewMatrix,[se[0],i.bounds.box.min[1],se[2]],W,Z),Se=gt(D.camera.projectionViewMatrix,[se[0],i.bounds.box.max[1],se[2]],W,Z),Me=i.bounds.box,Ee=[Me.min[0],Me.max[0]].flatMap(ie=>[Me.min[1],Me.max[1]].flatMap(ke=>[Me.min[2],Me.max[2]].map(Ce=>gt(D.camera.projectionViewMatrix,[ie,ke,Ce],W,Z)))).filter(ie=>Number.isFinite(ie.x)&&Number.isFinite(ie.y)&&Number.isFinite(ie.depth)),He=Ee.length?(()=>{let ie=Math.min(...Ee.map(De=>De.x)),ke=Math.max(...Ee.map(De=>De.x)),Ce=Math.min(...Ee.map(De=>De.y)),it=Math.max(...Ee.map(De=>De.y)),jt=Math.max(0,ie),Gn=Math.min(W,ke),Hn=Math.max(0,Ce),Eo=Math.min(Z,it),zn=Math.max(0,Gn-jt),rn=Math.max(0,Eo-Hn);return{box:{x:jt,y:Hn,width:zn,height:rn},horizontalFillRatio:zn/W,verticalFillRatio:rn/Z,visibleAreaRatio:zn*rn/(W*Z),clippedEdges:[...Ce<0?["top"]:[],...ke>W?["right"]:[],...it>Z?["bottom"]:[],...ie<0?["left"]:[]]}})():void 0,Ke=String(B.gl.getParameter(B.gl.VERSION)??"");return{viewport:{width:W,height:Z},context:{webgl2:/webgl\s*2/i.test(Ke),lost:S},frame:{rendered:z.rendered,idle:z.idle},camera:{position:[D.camera.position.x,D.camera.position.y,D.camera.position.z],distance:D.currentDistance,verticalFovDeg:D.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:p,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:me.visible&&Se.visible?Math.abs(me.y-Se.y):0},labels:K.qualityEvidence(),framing:He,...Vn?{seatView:{fovDeg:D.camera.fov,stop:Vn}}:{}}},getQualityReport(){return Pr(Zr.getQualityEvidence())},loseContextForTest(){B.simulateContextLossCycle()},floors(){return i.floors},focusFloor(z){if(z!==null&&!i.floors.some(Z=>Z.index===z))return!1;let W=z??-1;if(T(z!==null),Ro(!1),ed(W),Bn("orbit"),z===null)Q.cancel(),Nn()?D.frame(i.bounds,!1,U,n.portraitOverviewCrop===!0,$):D.frameSoft(i.bounds,U,n.portraitOverviewCrop===!0,$),K.setOverviewDistance(D.targetDistance);else{let Z=i.floors[z];if(Z.seatCount>0){Q.cancel();let se=Z.focalWorld[0]-Z.center[0],me=Z.focalWorld[2]-Z.center[2],Se=Math.hypot(se,me)>Z.radius*.12?Math.atan2(se,me):U;D.frame({center:Z.center,radius:Z.radius,box:Z.box},!1,Se,!1,{polarDeg:58,margin:1.12}),K.setOverviewDistance(D.targetDistance)}}return Ie.requestRender(),!0},zones(){return i.zones},focusZone(z){let W=i.zones.find(Se=>Se.id===z);if(!W||W.seatCount===0)return!1;T(!1),Ro(!1),Q.cancel(),Bn("orbit"),ve(null),n.onSectionFocusChange?.(null);let Z=W.focalWorld[0]-W.center[0],se=W.focalWorld[2]-W.center[2],me=Math.hypot(Z,se)>W.radius*.12?Math.atan2(Z,se):void 0;return D.frame({center:W.center,radius:W.radius*1.25},!1,me),Ie.requestRender(),!0},sections(){return i.sections},focusSection(z){return Za(z)},rows(z){return z?i.rows.filter(W=>W.sectionId===z):i.rows},seatsInRow(z){return t.seats.filter(W=>W.rowId===z).map(W=>({id:W.id,label:W.displayLabel||W.label}))},focusRow(z){let W=i.rows.find(Z=>Z.id===z);return!W||W.seatCount===0?!1:(T(!0),Ro(!1),Q.cancel(),Bn("pan"),W.sectionId&&(ve(W.sectionId),n.onSectionFocusChange?.(W.sectionId)),D.frame({center:W.center,radius:Math.max(2.5,W.radius*.65)}),Ie.requestRender(),!0)},setReducedMotionForTest(z){k=z},dispose(){x=!0,Y?.dispose(),rt(!1),Kr(),$r.remove(),Zf.remove(),Ka(),we?.dispose(),Ie.stop(),K.dispose(),Ht?.disconnect(),w&&(w.dispose(),w=null),E(),X(),B.canvas.removeEventListener("pointerdown",Rt.onDown),B.canvas.removeEventListener("pointermove",Rt.onMove),B.canvas.removeEventListener("pointerup",Rt.onUp),B.canvas.removeEventListener("pointercancel",Rt.onUp),B.canvas.removeEventListener("pointermove",Io),B.canvas.removeEventListener("pointerdown",Io),B.canvas.removeEventListener("pointerleave",Ba),zt&&cancelAnimationFrame(zt),D.dispose(),M&&M.dispose(),b&&b.dispose(),b=null,y?.dispose(),y=null,M=null,B.dispose()}};return a.opened(i.seatCount,p,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),Zr}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|
|
1321
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ke},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let K=new it.Mesh(e,{geometry:Ae,program:be});K.frustumCulled=!1,K.setParent(o),Fe.screenProgram=be,ie=!0,Fe.drawCalls=3+f+(ae?1:0)+1},ne.src=Ge.contentImageUrl}return Fe}var on=require("ogl");var iw=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],oa=class{constructor(t,n,o,r,i){this.seatScene=new on.Transform;this.chairScene=new on.Transform;this.solidScene=new on.Transform;this.target=null;this.floorAtLastPick=!1;this.restoreClear=[0,0,0];this.renderer=t,this.gl=t.gl,this.maxIndex=i,this.seatProg=Rd(this.gl),this.chairProg=Ed(this.gl),this.depthProg=Id(this.gl);let a=new on.Mesh(this.gl,{geometry:n,program:this.seatProg});a.frustumCulled=!1,a.setParent(this.seatScene);let s=new on.Mesh(this.gl,{geometry:o,program:this.chairProg});s.frustumCulled=!1,s.setParent(this.chairScene);let c=new on.Mesh(this.gl,{geometry:r,program:this.depthProg});c.frustumCulled=!1,c.setParent(this.solidScene)}standingFloorAtLastPick(){return this.floorAtLastPick}setRoomCentre(t){this.depthProg.uniforms.uRoomCentre.value.set(t??[0,0])}setRestoreClear(t){this.restoreClear=[t[0],t[1],t[2]]}syncFromSeatProgram(t){for(let r of iw)this.seatProg.uniforms[r].value=t.uniforms[r].value;let n=t.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=n,this.chairProg.uniforms.uFocusFloor.value=n,this.depthProg.uniforms.uFocusFloor.value=n;let o=t.uniforms.uSeeThrough?.value;if(o)for(let r of[this.seatProg,this.chairProg,this.depthProg])r.uniforms.uSeeThrough.value=o}ensureTarget(){let t=this.gl.drawingBufferWidth,n=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==t||this.target.height!==n)&&this.destroyTarget(),this.target||(this.target=new on.RenderTarget(this.gl,{width:t,height:n,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let t=this.gl;this.target.buffer&&t.deleteFramebuffer(this.target.buffer);for(let n of this.target.textures??[])n.texture&&t.deleteTexture(n.texture);this.target.depthBuffer&&t.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(t,n,o,r){let i=this.gl,a=this.ensureTarget(),s=i.drawingBufferWidth,c=i.drawingBufferHeight,l=Math.max(0,n-r),u=Math.max(0,o-r),m=Math.max(1,Math.min(s,n+r+1)-l),h=Math.max(1,Math.min(c,o+r+1)-u);i.enable(i.SCISSOR_TEST),i.scissor(l,u,m,h);let[f,d,p]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:t,target:a,clear:!0}),this.renderer.render({scene:this.seatScene,camera:t,target:a,clear:!1}),this.renderer.render({scene:this.chairScene,camera:t,target:a,clear:!1}),i.clearColor(f,d,p,1),i.disable(i.SCISSOR_TEST);let b=new Uint8Array(m*h*4);return this.renderer.bindFramebuffer(a),i.readPixels(l,u,m,h,i.RGBA,i.UNSIGNED_BYTE,b),this.renderer.bindFramebuffer(),this.floorAtLastPick=xd(b,m,h,n-l,o-u),Md(b,m,h,n-l,o-u,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Kd(e,t){let n=[];for(let o of t)e.has(o.seatId)?e.set(o.seatId,$o(o.state)):n.push(o);return n}function Yd(e,t,n){let o=new Set;for(let a of t)(e.has(a)||n(a)!==void 0)&&o.add(a);let r=new Map(e),i=[];for(let[a,s]of e)o.has(a)||(i.push({seatId:a,state:ct[s]??"available"}),r.delete(a));for(let a of o){if(r.has(a))continue;let s=n(a);s!==void 0&&(r.set(a,s),i.push({seatId:a,state:"selected"}))}return{updates:i,next:r}}var Rn=require("ogl");function aw(e,t){return[e[0]-t[0],e[1]-t[1],e[2]-t[2]]}function $d(e,t){return[e[0]+t[0],e[1]+t[1],e[2]+t[2]]}function sw(e,t){return[e[0]*t,e[1]*t,e[2]*t]}function Zd(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 Sc(e){let t=Math.max(0,Math.min(1,e));return t*t*t*(t*(t*6-15)+10)}function wc(e,t){return Math.max(0,Math.min(1,e+t))}function qd(e,t){let n=e.length;if(n===0)return[0,0,0];if(n===1)return[...e[0]];let o=Math.max(0,Math.min(1,t)),r=n-1,i=Math.floor(o*r);i>=r&&(i=r-1);let a=o*r-i,s=e[Math.max(0,i-1)],c=e[i],l=e[i+1],u=e[Math.min(n-1,i+2)],m=a*a,h=m*a,f=[0,0,0];for(let d=0;d<3;d++)f[d]=.5*(2*c[d]+(-s[d]+l[d])*a+(2*s[d]-5*c[d]+4*l[d]-u[d])*m+(-s[d]+3*c[d]-3*l[d]+u[d])*h);return f}function Pc(e,t,n,o,r){let i=Zd(aw(t,n));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let a=$d($d(t,sw(i,2.5)),[0,1.5,0]),s=[t[0]-o[0],0,t[2]-o[2]],c=Zd(s);c[0]===0&&c[2]===0&&(c=[i[0],0,i[2]]);let l=Math.max(1,r),u=[o[0]+c[0]*l*1.3,o[1]+l*.75,o[2]+c[2]*l*1.3];return{waypoints:[e,u,a],finalPos:a}}function Ac(e,t,n=35,o=28){let r=Sc(t),i=qd(e,r),a=Sc(Math.max(0,Math.min(1,(t-.66)/.34)));return{pos:i,fov:n+(o-n)*a,eased:r}}function tp(e,t,n){let o=e.position.clone(),r=new Rn.Quat().copy(e.quaternion);e.position.set(t[0],t[1],t[2]),e.lookAt(new Rn.Vec3(n[0],n[1],n[2]));let i=new Rn.Quat().copy(e.quaternion);return e.position.copy(o),e.quaternion.copy(r),i}var ra=class{constructor(t){this.active=!1;this.waypoints=[];this.startQuat=new Rn.Quat;this.endQuat=new Rn.Quat;this.outQuat=new Rn.Quat;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=t}start(t,n,o,r=2500,i=28){return this.settle(),this.waypoints=t,this.startQuat.copy(n),this.endQuat.copy(o),this.duration=r,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(a=>{this.resolveFn=a})}update(t){if(!this.active)return!1;let n=Math.min(1,(t-this.startTime)/this.duration),{pos:o,fov:r,eased:i}=Ac(this.waypoints,n,35,this.endFov);return this.camera.position.set(o[0],o[1],o[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,wc(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=r,this.camera.updateProjectionMatrix(),n>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let t=this.resolveFn;this.resolveFn=null,t&&t()}};var np=Jc,cw=.12,Rc=1.6,op=.12;function rp(e,t,n){let o=e[t*3],r=e[t*3+1],i=e[t*3+2],a=n[0]-o,s=n[2]-i,c=Math.hypot(a,s);if(!(c>.001))return null;let l=a/c,u=s/c,m=1/0,h=null;for(let f=0;f*3<e.length;f++){if(f===t)continue;let d=e[f*3]-o,p=e[f*3+2]-i,b=d*l+p*u;b<.3||b>1.6||Math.abs(d*u-p*l)>.6||b<m&&(m=b,h=r-e[f*3+1])}return h}var lw=.25,uw=1.5;function ip(e,t,n=0,o,r,i=!1){let a=[t.x*I,n+uw,t.y*I],s=r?[r[0],r[1],r[2]]:a,c=e[1],l=Number.isFinite(c)?c+(i?Rc:np):Number.isFinite(o)?n+o:n+np,u=a[0]-e[0],m=a[2]-e[2],h=Math.hypot(u,m),f=h>.001?Math.min(cw,h*lw):0,d=h>.001?u/h:0,p=h>.001?m/h:0;return{eye:[e[0]+d*f,l,e[2]+p*f],focal:s}}var Yn={aisleShare:.7,aisleMost:.9,standOffM:[.9,2.6],lookHeightM:1.25,frameMargin:1.12,fovDeg:[45,80]};function mw(e,t){let n=0,o=0,r=!1;for(let i of t)i.kind==="booth"?n++:o++;for(let i of ur(e,e.eventConfigurationId))for(let a of i.objects)a.type==="gaArea"?o+=a.capacity>0?a.capacity:0:a.type==="shape"&&a.role==="stage"&&(r=!0);return r&&o>n}function ap(e,t){let n=new Map;if(mw(e,t))return n;for(let o of ur(e,e.eventConfigurationId)){let r=o.objects.filter(a=>a.type==="booth");if(!r.length)continue;let i=Fs(r,o.focal);for(let a of r){let s=i.get(a.id),c=_t(a);if(!s||!c)continue;t.some(u=>u.kind!=="booth"&&Ye(c,u.x,u.y))||n.set(`${a.id}:0`,s)}}return n}function sp(e){let[t,n]=Yn.standOffM;return Math.min(n,Math.max(Math.min(t,e.aisleM*Yn.aisleMost),e.aisleM*Yn.aisleShare))}function Ec(e,t){let n=t.halfDepthM+sp(t);return{eye:[e[0]+t.normal.x*n,e[1]+Rc,e[2]+t.normal.y*n],focal:[e[0],e[1]+Yn.lookHeightM,e[2]]}}function cp(e,t,n){let{eye:o,focal:r}=Ec(e,t),i=sp(t),a=Yn.frameMargin,s=t.halfWidthM*a/i,c=Lo/2*a/i,l=2*Math.atan(Math.max(c,s/Math.max(.3,n)))*180/Math.PI,u=Math.max(Yn.fovDeg[0],Math.min(Yn.fovDeg[1],l)),m=Math.tan(u*Math.PI/360)*n;return{eye:o,focal:r,fov:u,raisedM:0,pulledBackM:0,stageFrameWidth:t.halfWidthM/(i*m)}}var En=Math.PI/180,hw=45,Ic=80,ia=70,fw=1,dw=.99;function pw(e,t){if(!(e<fw))return Ic;if(!(Number.isFinite(t)&&t>0))return ia;let n=2*Math.atan(t/(2*aa*dw)/Math.max(.05,e))/En;return Math.max(ia,Math.min(Ic,n))}var bw=.25,aa=1,gw=.25,yw=12*En,xw=.2,Mw=1.5,lp=.8,up=6,bp=1.9,vw=2/3,Sw=.12,ww=.9,Pw=1.2,Aw=2,gp=.05,Rw=6;function yp(e,t,n=0){if(!e.length)return{min:[t[0]-6,n,t[2]-6],max:[t[0]+6,Math.max(n+lp,t[1]),t[2]+6]};let o=1/0,r=-1/0,i=1/0,a=-1/0,s=n;for(let d of e)o=Math.min(o,d.cx-d.halfX),r=Math.max(r,d.cx+d.halfX),i=Math.min(i,d.cz-d.halfZ),a=Math.max(a,d.cz+d.halfZ),s=Math.max(s,d.y);let c=r-o,l=a-i,u=Math.max(c,Math.min(l,up))/2,m=Math.max(l,Math.min(c,up))/2,h=(o+r)/2,f=(i+a)/2;return{min:[h-u,n,f-m],max:[h+u,Math.max(n+lp,s),f+m]}}function Ew(e){return{min:[e.min[0],e.min[1],e.min[2]],max:[e.max[0],e.max[1]+bp,e.max[2]]}}function _c(e){let t=e.max[1];return[(e.min[0]+e.max[0])/2,Math.max(e.min[1]+Mw,t+xw,t+bp*vw),(e.min[2]+e.max[2])/2]}function xp(e,t){let n=e[0]-t[0],o=e[2]-t[2],r=Math.hypot(n,o);return r<.001?{x:0,z:1}:{x:n/r,z:o/r}}function mp(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=1/0,m=-1/0;for(let h=0;h<8;h++){let f=(h&1?n.max[0]:n.min[0])-e[0],d=(h&2?n.max[1]:n.min[1])-e[1],p=(h&4?n.max[2]:n.min[2])-e[2],b=Math.max(gp,f*o+d*r+p*i),y=(f*s+p*c)/b;y<u&&(u=y),y>m&&(m=y)}return m-u}function hp(e,t,n){let o=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2],a=Math.hypot(o,r,i)||1;o/=a,r/=a,i/=a;let s=-i,c=o,l=Math.hypot(s,c);if(l<1e-6)return 1/0;s/=l,c/=l;let u=-c*r,m=c*o-s*i,h=s*r,f=1/0,d=-1/0;for(let p=0;p<8;p++){let b=(p&1?n.max[0]:n.min[0])-e[0],y=(p&2?n.max[1]:n.min[1])-e[1],g=(p&4?n.max[2]:n.min[2])-e[2],v=Math.max(gp,b*o+y*r+g*i),P=(b*u+y*m+g*h)/v;P<f&&(f=P),P>d&&(d=P)}return d-f}function sa(e,t){return Math.tan(e*En/2)*Math.max(.05,t)}function fp(e,t,n){let o=pw(n,e),r=c=>Math.max(hw,Math.min(o,c)),i=c=>2*Math.atan(c)/En,a=Number.isFinite(e)&&e>0?r(i(e/(2*bw)/Math.max(.05,n))):o;if(!(Number.isFinite(t)&&t>0))return a;let s=Math.min(a,r(i(t/(2*Sw))));return e/(2*sa(s,n))>aa?a:s}function Mp(e,t,n,o={}){let r=_c(t),i=[e[0],e[1],e[2]],a=0,s=0,c=d=>{if(!(d>0))return;let p=xp(i,r);i[0]+=p.x*d,i[2]+=p.z*d,s+=d},l=o.preserveEye?0:t.max[1]+gw-i[1];l>0&&(i[1]+=l,a=l,c(l/Math.tan(yw)));let u=Ew(t),m=mp(i,r,t),h=fp(m,hp(i,r,u),n),f=m/(2*sa(h,n));for(let d=0;!o.preserveEye&&d<Rw&&f>aa;d++){let p=Math.max(1,Math.hypot(i[0]-r[0],i[2]-r[2])),b=Number.isFinite(f)?f/aa:2;c(Math.min(60,p*(Math.min(4,b)-1)+.5)),m=mp(i,r,t),h=fp(m,hp(i,r,u),n),f=m/(2*sa(h,n))}return{eye:i,focal:r,fov:h,raisedM:a,pulledBackM:s,stageFrameWidth:f}}function Iw(e,t,n){let o=Math.tan(t*En/2),r=sa(t,n);return Math.max(1,e/Math.max(.05,Math.min(o,r)))}var _w=.7,dp=.5,Cw=.8;function pp(e,t,n){let o=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],r=[n[0]-e[0],n[1]-e[1],n[2]-e[2]],i=o[0]*r[0]+o[1]*r[1]+o[2]*r[2],a=Math.hypot(o[0],o[1],o[2])*Math.hypot(r[0],r[1],r[2])||1;return Math.acos(Math.max(-1,Math.min(1,i/a)))/En}function Tw(e,t,n){let o=l=>{let u=Math.hypot(l[0],l[1],l[2])||1;return[l[0]/u,l[1]/u,l[2]/u]},r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],i=Math.hypot(r[0],r[1],r[2]),a=o(r),s=o([n[0]-e[0],n[1]-e[1],n[2]-e[2]]),c=o([0,1,2].map(l=>a[l]*(1-dp)+s[l]*dp));return[e[0]+c[0]*i,e[1]+c[1]*i,e[2]+c[2]*i]}function vp(e,t){let{aspect:n,venue:o}=t,r=e.focal,i=xp(e.eye,r),a=p=>(p[0]-r[0])*i.x+(p[2]-r[2])*i.z,s=[{name:"seat",eye:e.eye,focal:r,fov:e.fov}],c=Aw*(t.rowDepthM??ww),l=[e.eye[0]+i.x*c,e.eye[1]+Pw,e.eye[2]+i.z*c],u=[e.eye[0],e.eye[1]-_w,e.eye[2]],m=Tw(l,r,u);s.push({name:"row",eye:l,focal:m,fov:Math.min(Ic,Math.max(e.fov,2*Math.max(pp(l,m,u),pp(l,m,r))/Cw))});let h=(p,b,y,g)=>{let v=Iw(y,e.fov,n)*1.08,P=v*Math.sin(g*En),w=Number.isFinite(t.seatingTopY)?t.seatingTopY+2:-1/0,x=Math.max(P,w-b[1]),S=v*Math.cos(g*En);return{name:p,eye:[b[0]+i.x*S,b[1]+x,b[2]+i.z*S],focal:b,fov:e.fov}};t.section&&t.section.radius>0&&s.push(h("section",t.section.center,t.section.radius,35)),s.push(h("venue",o.center,Math.max(1,o.radius),40));let f=[],d=-1/0;for(let p of s){let b=a(p.eye);f.length&&b<=d+.5||(f.push(p),d=b)}return f}var Ap=require("ogl"),Dr=Math.PI/180,Cc=320,Sp=70*Dr,kw=32*Dr,Lw=24*Dr,wp=.0026,Ow=.22,Fw=.006,Dw=180,Nw=900,Bw=1100,Hw=4,wt=(e,t,n)=>Math.max(t,Math.min(n,e)),Pp=e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2;function Rp(e){let{canvas:t,camera:n}=e,o=[],r=!1,i=0,a=0,s=0,c=0,l=0,u=0,m=Cc,h=null,f=()=>{h&&(clearTimeout(h),h=null)},d=!1,p=[0,0],b=0,y=!1,g=null,v=null,P=new Map,w=!1,x=0,S=0,A=0,M=0,E=()=>r&&o.length?o[wt(Math.round(i),0,o.length-1)].name:null,T=()=>{let L=E();L!==g&&(g=L,e.onStopChange?.(L))},k=()=>{if(!r||!o.length)return;let L=o[wt(Math.floor(i),0,o.length-1)],G=o[wt(Math.ceil(i),0,o.length-1)],j=wt(i-Math.floor(i),0,1),D=(ge,Ae)=>ge+(Ae-ge)*j,U=[D(L.eye[0],G.eye[0]),D(L.eye[1],G.eye[1]),D(L.eye[2],G.eye[2])],$=[D(L.focal[0],G.focal[0]),D(L.focal[1],G.focal[1]),D(L.focal[2],G.focal[2])],Z=$[0]-U[0],te=$[1]-U[1],X=$[2]-U[2],me=Math.hypot(Z,te,X)||1,re=Math.atan2(Z,X),ce=Math.asin(wt(te/me,-1,1)),J=re+a,ae=wt(ce+s,-80*Dr,80*Dr),ie=Math.cos(ae)*me;Z=Math.sin(J)*ie,te=Math.sin(ae)*me,X=Math.cos(J)*ie,n.position.set(U[0],U[1],U[2]),n.fov=D(L.fov,G.fov),n.updateProjectionMatrix(),n.lookAt(new Ap.Vec3(U[0]+Z,U[1]+te,U[2]+X)),e.onApplied?.()},_=()=>{if(!r||!o.length)return;let L=wt(Math.round(i),0,o.length-1);if(e.reducedMotion()){d=!1,i=L,k(),T(),e.requestRender();return}if(Math.abs(L-i)<.001){d=!1,T();return}c=i,l=L,u=performance.now(),m=Cc,d=!0,e.requestRender()},R=L=>{!r||o.length<2||(f(),d=!1,i=wt(i+L,0,o.length-1),k(),T(),e.requestRender())},C=(L,G)=>{r&&(f(),d=!1,y=!1,a=wt(a-L*wp,-Sp,Sp),s=wt(s-G*wp,-Lw,kw),k(),e.requestRender())},O=L=>{r&&(P.set(L.pointerId,{x:L.clientX,y:L.clientY}),P.size===1?(w=!0,M=0,x=L.clientX,S=L.clientY):P.size===2&&(w=!1,A=B()))},B=()=>{let L=[...P.values()];return L.length<2?0:Math.hypot(L[0].x-L[1].x,L[0].y-L[1].y)},F=L=>{if(!r||!P.has(L.pointerId))return;if(P.set(L.pointerId,{x:L.clientX,y:L.clientY}),P.size>=2){let D=B();A>0&&R((A-D)*Fw),A=D;return}if(!w)return;let G=L.clientX-x,j=L.clientY-S;x=L.clientX,S=L.clientY,M+=Math.abs(G)+Math.abs(j),!(M<=Hw)&&C(G,j)},N=L=>{P.delete(L.pointerId)&&(P.size<2&&(A=0),P.size===0&&(w=!1,_()))},V=L=>{if(!r)return;L.preventDefault();let G=L.deltaMode===1?16:L.deltaMode===2?100:1,j=wt(L.deltaY*G/100,-2,2);R(j*Ow),v&&clearTimeout(v),v=setTimeout(()=>{v=null,_()},Dw)},H=()=>{f(),r&&(r=!1,d=!1,y=!1,o=[],P.clear(),w=!1,v&&(clearTimeout(v),v=null),g!==null&&(g=null,e.onStopChange?.(null)))};return t.addEventListener("pointerdown",O),t.addEventListener("pointermove",F),t.addEventListener("pointerup",N),t.addEventListener("pointercancel",N),t.addEventListener("wheel",V,{passive:!1}),{get active(){return r},enter(L,G=0){if(L.length<2){H();return}f(),o=L,r=!0,i=e.reducedMotion()?0:wt(G,0,L.length-1),i>0&&(h=setTimeout(()=>{h=null,r&&(c=i,l=0,u=performance.now(),m=Bw,d=!0,e.requestRender())},Nw)),a=0,s=0,d=!1,y=!1,g=null,k(),T(),e.requestRender()},exit:H,recentre(){return r?Math.abs(a)<1e-4&&Math.abs(s)<1e-4?!0:e.reducedMotion()?(y=!1,a=0,s=0,k(),e.requestRender(),!0):(p=[a,s],b=performance.now(),y=!0,e.requestRender(),!0):!1},update(L){if(!r)return!1;let G=!1;if(y){let j=wt((L-b)/Cc,0,1),D=1-Pp(j);a=p[0]*D,s=p[1]*D,j>=1?(y=!1,a=0,s=0):G=!0}if(d){let j=wt((L-u)/m,0,1);i=c+(l-c)*Pp(j),j>=1?(d=!1,i=l,T()):G=!0}return k(),G},currentStop:E,dispose(){H(),t.removeEventListener("pointerdown",O),t.removeEventListener("pointermove",F),t.removeEventListener("pointerup",N),t.removeEventListener("pointercancel",N),t.removeEventListener("wheel",V)}}}function Ep(e){return e.flying?"cinematic":e.panoramaMounted?"panorama":e.seatViewActive?"seatView":"orbit"}function Ip(e,t){return e?-1:t}var Oc=null;function Vp(){return Oc??=Promise.resolve().then(()=>(Gp(),Hp)).catch(e=>{throw Oc=null,e}),Oc}var zp=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),da=class{constructor(t){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=t}emit(t,n){if(this.cb)try{this.cb(t,n)}catch{}}opened(t,n,o,r){this.emit("3d_opened",{seats:t,hasHeights:n,...o===void 0?{}:{buildMs:Math.round(o)},...r===void 0?{}:{prepSource:r}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(t,n){this.emit("3d_seat_picked",{seatId:t,sectionId:n})}cinematicPlayed(t){this.emit("3d_cinematic_played",{durationMs:t,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=zp(),this.emit("3d_panorama_opened")}panoramaClosed(){let t=this.panoramaOpenedAt?Math.round(zp()-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 Up(e){let t=e.style.position;return getComputedStyle(e).position!=="static"?()=>{}:(e.style.position="relative",()=>{e.style.position==="relative"&&(e.style.position=t)})}function Wp(e){let{container:t,model:n,opts:o,expandedSeatById:r,seatIdsByRow:i,isNarrow:a}=e,s=null,c=()=>{if(!s)return;let m=a();Object.assign(s.style,m?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},l=()=>{s?.remove(),s=null};return{show:(m,h,f=!1)=>{if(l(),e.isDisposed())return null;let d=document.createElement("div");d.setAttribute("role","group"),Object.assign(d.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let p=o.chrome?.caption!==!1,b=o.chrome?.seatStepper!==!1;if(!p&&!b)return null;let y=r.get(m),g=y?.sectionId?n.sections.find(E=>E.id===y.sectionId):void 0,v=y?.label??m;d.setAttribute("aria-label",`Explore views near ${g?.label?`${g.label}, `:""}seat ${v}`);let P=document.createElement("span");P.textContent=o.seatViewCaption?.(m)??["Live 3D seat view",g?.label,v].filter(Boolean).join(" \xB7 "),Object.assign(P.style,{maxWidth:"min(70vw, 560px)",padding:"5px 10px",borderRadius:"999px",overflow:"hidden",color:"#d9e3f5",background:"rgba(12,18,32,0.72)",font:"600 11px/1.2 inherit",textOverflow:"ellipsis",whiteSpace:"nowrap",backdropFilter:"blur(6px)"}),p&&d.appendChild(P);let w=document.createElement("div");Object.assign(w.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(w);let x=y?.rowId?i.get(y.rowId):void 0,S=x?.indexOf(m)??-1,A=S>=0?[x?.[S-1],x?.[S+1]]:[void 0,void 0],M=(E,T,k,_=!1)=>{let R=document.createElement("button");R.type="button",R.textContent=E,R.setAttribute("aria-label",T),Object.assign(R.style,{minHeight:"44px",padding:_?"10px 16px":"10px",borderRadius:"999px",background:"rgba(12,18,32,0.78)",color:"#eef1f8",border:"1px solid rgba(150,165,205,0.4)",backdropFilter:"blur(6px)",font:"600 13px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"}),_||(R.style.minWidth="44px"),_&&(R.dataset.panoramaTrigger=""),R.addEventListener("click",k),w.appendChild(R)};if(b&&A[0]){let E=r.get(A[0])?.label??A[0];M("\u2039",`View previous seat ${E}`,()=>{e.flyToSeat(A[0])})}if(b&&o.getSeatView){let E=o.seatViewActionLabel?.(m)??"Open 360\xB0 panorama";M(f?`\u21BB Retry ${E}`:`\u25C9 ${E}`,`${f?"Retry":E} from seat ${v}`,()=>{if(e.isDisposed()||h!==e.flightGen()){l();return}l(),e.openPanorama(m,400,h)},!0)}if(b&&A[1]){let E=r.get(A[1])?.label??A[1];M("\u203A",`View next seat ${E}`,()=>{e.flyToSeat(A[1])})}return!w.childElementCount&&!p?null:(t.appendChild(d),s=d,c(),d)},remove:l,layout:c}}var eP={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function tP(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(pointer: coarse)").matches}function jp(e){let{container:t,orbit:n,isNarrow:o}=e,r={...eP,...e.labels??{}},i=(x,S)=>{x.setAttribute("aria-label",S),x.title=S},a=document.createElement("div"),s=!1;a.className="sl-3d-navigation-controls",Object.assign(a.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let c=document.createElement("div");c.setAttribute("role","group"),c.setAttribute("aria-label","3D drag mode"),Object.assign(c.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D view controls"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let u=document.createElement("button");u.type="button",u.textContent="\u21BB",i(u,r.rotate);let m=document.createElement("button");m.type="button",m.textContent="\u2725",i(m,r.move);let h=document.createElement("button");h.type="button",h.textContent="\u2212",i(h,r.zoomOut);let f=document.createElement("button");f.type="button",f.textContent="+",i(f,r.zoomIn);for(let x of[u,m,h,f])x.className="sl-3d-icon-control",Object.assign(x.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",border:"1px solid rgba(150,165,205,0.35)",borderRadius:"999px",color:"#c9d4ea",background:"rgba(12,18,32,0.82)",font:"600 17px/1 inherit",backdropFilter:"blur(6px)",cursor:"pointer",whiteSpace:"nowrap"});c.append(u,m),l.append(f,h);let d=null,p=()=>{let x=n.dragAction();if(x===d)return;d=x;let S=x==="orbit";u.setAttribute("aria-pressed",String(S)),m.setAttribute("aria-pressed",String(!S)),u.style.background=S?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",m.style.background=S?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",a.title=S?`${r.rotate} \xB7 ${r.move} with Shift`:`${r.move} \xB7 ${r.rotate} with Shift`},b=x=>{n.setPrimaryDragMode(x),p()};u.addEventListener("click",()=>b("orbit")),m.addEventListener("click",()=>b("pan"));let y=()=>{let{atMin:x,atMax:S}=n.dollyLimitState();f.disabled!==x&&(f.disabled=x),h.disabled!==S&&(h.disabled=S)};h.addEventListener("click",()=>{n.zoomBy(Zo),y()}),f.addEventListener("click",()=>{n.zoomBy(ro),y()}),a.append(c,l),b("auto"),t.appendChild(a);let g=e.enabled!==!1,v=()=>n.touchNavigationMode==="map"&&tP(),P=()=>{let x=o();a.style.display=s||!g?"none":"flex",a.style.right=x?"12px":"14px",a.style.bottom=x?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",c.style.display=x||v()?"none":"flex",f.style.display=x?"none":"",h.style.display=x?"none":""};return P(),{element:a,utilityControls:l,setNavigationMode:b,syncNavigationMode:p,syncZoomLimits:y,setSeatViewLocked:x=>{s=x,n.setInteractionEnabled(!x),P()},seatViewLocked:()=>s,layout:P}}var nP=.5,Xp=12,Kp=20,oP=28;function rP(e,t,n){return!(e>0)||!(n>0)?0:nP*n/(2*e*Math.tan(t*Math.PI/360))}var iP=700;function Yp(e){let{glctx:t,orbit:n,model:o,seats:r,opts:i,cinematic:a,analytics:s,seatIdByIndex:c,sectionIdBySeatId:l,tapSlop:u,tapMs:m,cancelFlight:h,focusSectionCamera:f,setSelection:d,ensureSeatView:p}=e,b=0,y=0,g=0,v=-1,P=!1,w=!1,x=0,S=C=>{e.seatViewLocked()||v===-1&&(v=C.pointerId,b=C.clientX,y=C.clientY,g=performance.now(),P=!1,w=a.active,a.active&&(s.cinematicCancelled(),h(),i.onViewTargetChange?.(null)))},A=C=>{C.pointerId===v&&Jr(C.clientX-b,C.clientY-y,u)&&(P=!0)},M=(C,O,B,F,N)=>{let V=t.canvas.getBoundingClientRect(),H=t.canvas.clientWidth||V.width||1,L=t.canvas.clientHeight||V.height||1,G=C-V.left,j=O-V.top,D=F*F,U=-1,$=D,Z=1/0;for(let te of r){if(B&&te.sectionId!==B)continue;let X=o.seats.idToIndex.get(te.id);if(X===void 0)continue;if(N){let ie=Math.round(o.seats.iState[X]??0);if(ie!==0&&ie!==3)continue}let me=X*3,re=en(n.camera.projectionViewMatrix,[o.seats.iPosition[me],o.seats.iPosition[me+1]+.55,o.seats.iPosition[me+2]],H,L);if(!re.visible)continue;let ce=re.x-G,J=re.y-j,ae=ce*ce+J*J;(ae<$||Math.abs(ae-$)<1&&re.depth<Z)&&(U=X,$=ae,Z=re.depth)}return U},E=(C,O)=>{let B=e.gpu(),F=e.pick();if(!B||!F)return-1;F.syncFromSeatProgram(B.seatProgram);let N=t.canvas.getBoundingClientRect(),V=t.renderer.dpr,{x:H,y:L}=vd(C,O,N,V,t.gl.drawingBufferWidth,t.gl.drawingBufferHeight),G=Math.max(2,Math.round(8*V));return F.pick(n.camera,H,L,G)},T=()=>t.canvas.clientHeight||t.canvas.getBoundingClientRect().height,k=(C,O=Xp)=>{let B=n.camera?.position;if(!B)return!1;let F=C*3,N=Math.hypot(B.x-o.seats.iPosition[F],B.y-o.seats.iPosition[F+1],B.z-o.seats.iPosition[F+2]);return rP(N,n.fovY,T())>=O};return{onDown:S,onMove:A,onUp:C=>{if(C.pointerId!==v)return;let O=!P&&performance.now()-g<m;if(v=-1,w){w=!1;return}let B=e.gpu(),F=e.pick();if(!O||!B||!F)return;let N=E(C.clientX,C.clientY),V=N,H=C.pointerType==="touch"||C.pointerType==="pen",L=H?Kp:Xp,G=N>=0&&k(N,L),j=!1;if(e.focusedSectionId()&&N>=0){let te=c[N],X=te?l.get(te):void 0;if(X&&X!==e.focusedSectionId()&&f(X,{keepCamera:G})){if(!G)return;j=!0}}let D=V<0&&!!i.onObjectPick,U=D&&F.standingFloorAtLastPick?.()===!0;if(e.focusedSectionId()&&N<0&&(N=M(C.clientX,C.clientY,e.focusedSectionId(),44,!1)),N<0&&D){let te=e.areaAt?.(C.clientX,C.clientY,U)??null;if(te){if(!te.pickable)return;C.pointerType!=="mouse"&&(x=performance.now()),i.onObjectPick?.({kind:"area",id:te.id,point:{x:C.clientX,y:C.clientY}});return}}if(e.focusedSectionId()&&N<0){let te=M(C.clientX,C.clientY,null,72,!1),X=te>=0?c[te]:void 0,me=X?l.get(X):void 0;if(me&&me!==e.focusedSectionId()&&f(me))return}if(!e.focusedSectionId()){N<0&&(N=M(C.clientX,C.clientY,null,42,!1));let te=N>=0?c[N]:void 0,X=te?l.get(te):void 0;if(X&&f(X,{keepCamera:G})){if(!G)return;j=!0}}if(N<0||N>=c.length){e.selection().size&&(d([]),i.onViewTargetChange?.(null));return}let $=c[N];if(H&&e.focusedSectionId()&&!j&&!k(N,Kp)){e.focusSeatCamera($,{seatPx:oP,viewportHeightPx:T()});return}let Z=ct[Math.round(o.seats.iState[N]??0)]??"available";if(Z!=="available"&&Z!=="selected"){i.onSeatInspect?.($,Z);return}if(e.selection().has($)&&e.selection().size===1){d([]),i.onViewTargetChange?.(null),i.onSeatPick?.($);return}d([$]),p($),s.seatPicked($,l.get($)),i.onSeatPick?.($)},onTouchEnd:C=>{let O=x;x=0,O&&performance.now()-O<iP&&C.cancelable&&C.preventDefault()}}}function qp(e,t){return e.available===t.available&&(e.selected??0)===(t.selected??0)&&(e.wheelchairFree??null)===(t.wheelchairFree??null)&&e.filteredOut===!0==(t.filteredOut===!0)&&(e.statusText??"")===(t.statusText??"")}function Qp(e){return e?.available!=null&&e.available<=0}function aP(e){return Qp(e)||e?.wheelchairFree!=null&&e.wheelchairFree<=0}function Fc(e){return aP(e)||e?.filteredOut===!0}function sP(e){return!Qp(e)&&e?.filteredOut!==!0}function $p(e,t,n){return t<0?n<=1:e.floorIndex===t}function Jp(e,t){return t.size===0?e:e.map(n=>{if(n.kind!=="ga")return n;let o=t.get(n.id.slice(3));if(!o)return n;let r=n.areaName??"",i=o.statusText?[r,o.statusText].filter(Boolean).join(" \xB7 "):o.available!=null&&r?r:n.text,a=o.selected&&o.selected>0?Math.floor(o.selected):0;return{...n,text:i,...a?{count:a}:{},...Fc(o)?{muted:!0}:{}}})}function cP(e){let t=e[0],n=e[1],o=e[2],r=e[3],i=e[4],a=e[5],s=e[6],c=e[7],l=e[8],u=e[9],m=e[10],h=e[11],f=e[12],d=e[13],p=e[14],b=e[15],y=t*a-n*i,g=t*s-o*i,v=t*c-r*i,P=n*s-o*a,w=n*c-r*a,x=o*c-r*s,S=l*d-u*f,A=l*p-m*f,M=l*b-h*f,E=u*p-m*d,T=u*b-h*d,k=m*b-h*p,_=y*k-g*T+v*E+P*M-w*A+x*S;if(!Number.isFinite(_)||Math.abs(_)<1e-18)return null;let R=1/_;return[(a*k-s*T+c*E)*R,(o*T-n*k-r*E)*R,(d*x-p*w+b*P)*R,(m*w-u*x-h*P)*R,(s*M-i*k-c*A)*R,(t*k-o*M+r*A)*R,(p*v-f*x-b*g)*R,(l*x-m*v+h*g)*R,(i*T-a*M+c*S)*R,(n*M-t*T-r*S)*R,(f*w-d*v+b*y)*R,(u*v-l*w-h*y)*R,(a*A-i*E-s*S)*R,(t*E-n*A+o*S)*R,(d*g-f*P-p*y)*R,(l*P-u*g+m*y)*R]}function Zp(e,t,n,o){let r=e[3]*t+e[7]*n+e[11]*o+e[15];return!Number.isFinite(r)||Math.abs(r)<1e-12?null:[(e[0]*t+e[4]*n+e[8]*o+e[12])/r,(e[1]*t+e[5]*n+e[9]*o+e[13])/r,(e[2]*t+e[6]*n+e[10]*o+e[14])/r]}function lP(e,t,n,o,r=()=>!0){if(!e.length||!(n>=-1&&n<=1&&o>=-1&&o<=1))return null;let i=cP(t);if(!i)return null;let a=Zp(i,n,o,-1),s=Zp(i,n,o,1);if(!a||!s)return null;let c=s[1]-a[1];if(Math.abs(c)<1e-9)return null;let l=null,u=1/0;for(let m of e){if(m.points.length<3||!r(m))continue;let h=(m.floorY-a[1])/c;if(!(h>=0&&h<=1)||h>=u)continue;let f=(a[0]+(s[0]-a[0])*h)/I,d=(a[2]+(s[2]-a[2])*h)/I;Ye(m.points,f,d)&&(m.holes?.some(p=>p.length>=3&&Ye(p,f,d))||(l=m,u=h))}return l}function e0(e){return(t,n,o=!0)=>{let r=e.areas;if(!r?.length)return null;let i=e.focusedFloor(),a=u=>({id:u.id,pickable:sP(e.state(u.id))}),s=e.tagAt?.(t,n)??null;if(s){let u=s.startsWith("ga:")?r.find(m=>m.id===s.slice(3)&&$p(m,i,e.floorCount)):void 0;return u?a(u):null}if(!o)return null;let c=e.canvas.getBoundingClientRect();if(!(c.width>0&&c.height>0))return null;let l=lP(r,e.viewProjection(),(t-c.left)/c.width*2-1,1-(n-c.top)/c.height*2,u=>$p(u,i,e.floorCount));return l?a(l):null}}var pa=class{constructor(t,n){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=t,this.count=n}ensureGrid(){if(this.cellStart||this.count===0)return;let t=this.iPosition,n=1/0,o=1/0,r=-1/0,i=-1/0;for(let f=0;f<this.count;f++){let d=t[f*3],p=t[f*3+2];d<n&&(n=d),d>r&&(r=d),p<o&&(o=p),p>i&&(i=p)}let a=Math.max(r-n,.001),s=Math.max(i-o,.001);this.cell=Math.max(Math.sqrt(a*s*4/this.count),.25),this.cols=Math.max(1,Math.ceil(a/this.cell)+1),this.rows=Math.max(1,Math.ceil(s/this.cell)+1),this.minX=n,this.minZ=o;let c=this.cols*this.rows,l=new Int32Array(c+1),u=f=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((t[f*3]-n)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((t[f*3+2]-o)/this.cell)))*this.cols+d};for(let f=0;f<this.count;f++)l[u(f)+1]++;for(let f=0;f<c;f++)l[f+1]+=l[f];let m=new Int32Array(this.count),h=l.slice(0,c);for(let f=0;f<this.count;f++)m[h[u(f)]++]=f;this.cellStart=l,this.cellItems=m}gather(t,n,o,r,i){this.ensureGrid();let a=this.cellStart,s=this.cellItems;if(!a||!s)return 0;let c=r.length,l=o*o,u=Math.floor((t-this.minX)/this.cell),m=Math.floor((n-this.minZ)/this.cell),h=Math.ceil(o/this.cell)+1,f=this.iPosition,d=0;for(let p=0;p<=h&&d<c;p++){let b=m-p,y=m+p,g=u-p,v=u+p;for(let P=b;P<=y&&d<c;P++){if(P<0||P>=this.rows)continue;let w=P===b||P===y;for(let x=g;x<=v&&d<c;x++){if(!w&&x!==g&&x!==v){x=v-1;continue}if(x<0||x>=this.cols)continue;let S=P*this.cols+x;for(let A=a[S],M=a[S+1];A<M&&d<c;A++){let E=s[A],T=f[E*3]-t,k=f[E*3+2]-n,_=i===void 0?0:f[E*3+1]-i;T*T+_*_+k*k<=l&&(r[d++]=E)}}}}return d}};var ba=class{constructor(t){this.ctx=t;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(ai);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.lastGatherY=1/0;this.nearIndex=new pa(t.model.seats.iPosition,t.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(t){let n=this.ctx.gpu();t||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!t&&n?.nearSeatCount()&&n.setNearSeats(this.nearBuf,0)}update(t){let{model:n}=this.ctx,o=this.ctx.gpu();if(!o)return;if(!t){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let r=this.ctx.orbit().camera.position;if(Math.hypot(r.x-this.lastGatherX,r.y-this.lastGatherY,r.z-this.lastGatherZ)<Va)return;if(this.lastGatherX=r.x,this.lastGatherY=r.y,this.lastGatherZ=r.z,Math.hypot(r.x-n.bounds.center[0],r.y-n.bounds.center[1],r.z-n.bounds.center[2])-n.bounds.radius>Ga){o.nearSeatCount()&&o.setNearSeats(this.nearBuf,0);return}let s=this.nearIndex.gather(r.x,r.z,Ga,this.nearBuf,r.y);s===0&&o.nearSeatCount()===0||o.setNearSeats(this.nearBuf,s)}ease(t,n,o){let r=1-Math.exp(-t*9),i=1-Math.exp(-t*20);this.seatDetailMix+=(n-this.seatDetailMix)*(n>this.seatDetailMix?r:i),this.structureDetailMix+=(o-this.structureDetailMix)*(o>this.structureDetailMix?r:i),Math.abs(n-this.seatDetailMix)<.01&&(this.seatDetailMix=n),Math.abs(o-this.structureDetailMix)<.01&&(this.structureDetailMix=o)}};function t0(e){let t=Math.max(5,e.radius),n=e.focalWorld[0]-e.center[0],o=e.focalWorld[2]-e.center[2],r=Math.hypot(n,o);if(r<t*.12)return{center:e.center,radius:t,polarDeg:48};let i=Math.min(r*.25,t*.2);return{center:[e.center[0]+n/r*i,e.center[1],e.center[2]+o/r*i],radius:t+i,polarDeg:50}}var ga=require("ogl");function n0(){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 o0(e){let{container:t,model:n,opts:o,orbit:r,cinematic:i,analytics:a,loop:s,labelOverlay:c,stageAzimuth:l,overviewFraming:u}=e,m=0,h=-1,f=(E,T,k=28)=>{r.camera.position.set(E[0],E[1],E[2]),r.camera.lookAt(new ga.Vec3(T[0],T[1],T[2])),r.camera.fov=k,r.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(n0());let p=o.navLabels?.fitView??"Show whole venue";d.setAttribute("aria-label",p),d.title=p,Object.assign(d.style,{width:"44px",minWidth:"44px",minHeight:"44px",padding:"9px",borderRadius:"999px",background:"rgba(12,18,32,0.72)",color:"#c9d4ea",border:"1px solid rgba(150,165,205,0.35)",backdropFilter:"blur(6px)",font:"600 11px/1 inherit",cursor:"pointer",whiteSpace:"nowrap"});let b=()=>{d.firstElementChild||d.replaceChildren(n0())};b();let y=E=>{h=E;let T=e.gpu();T&&(T.seatProgram.uniforms.uFocusFloor.value=E,T.solidProgram.uniforms.uFocusFloor.value=E,T.chairProgram.uniforms.uFocusFloor.value=E),e.showSectionSeatLabels(null)},g=null,v=!1,P=()=>{if(g=null,v=!1,e.setSeeThrough?.(null),e.isDisposed())return;o.onViewTargetChange?.(null),o.onSectionFocusChange?.(null),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),a.panoramaClosed()),e.setPanoramaSphereVisible(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.restorePanoramaLayer(),d.style.display="",c.setVisible(!0),e.setFrozen(!1);let E=h>=0?n.floors[h]:null;if(e.setNearFieldDetailEnabled(!!E),e.setSeatViewLocked(!1),w(),e.removeArriveChip(),e.setNavigationMode("auto"),E){let T=E.focalWorld[0]-E.center[0],k=E.focalWorld[2]-E.center[2],_=Math.hypot(T,k)>E.radius*.12?Math.atan2(T,k):l,R={center:E.center,radius:E.radius,box:E.box},C={polarDeg:58,margin:1.12};e.reducedMotion()?r.frame(R,!1,_,!1,C):r.frameSoft(R,_,!1,C)}else e.reducedMotion()?r.frame(n.bounds,!1,l,o.portraitOverviewCrop===!0,u):r.frameSoft(n.bounds,l,o.portraitOverviewCrop===!0,u);c.setOverviewDistance(r.targetDistance),e.showSectionSeatLabels(null),s.requestRender()},w=()=>{m++,e.setSeatStepping(!1),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),i.active&&(i.cancel(),r.resumeAfterFlight(n.focalWorld))},x=E=>{if(e.isDisposed()||!e.gpu())return Promise.resolve();let T=n.seats.idToIndex.get(E);if(T===void 0)return Promise.resolve();e.setNearFieldDetailEnabled(!0),o.onViewTargetChange?.(E),e.panorama()&&(e.panorama().dispose(),e.setPanorama(null),e.setPanoramaSphereVisible(!1),d.style.display="",e.restorePanoramaLayer()),e.panoramaLoadAbort()?.abort(),e.setPanoramaLoadAbort(null),e.setFrozen(!1);let k=e.inSeatView()&&o.arriveAtSeatEye===!0;e.setSeatStepping(k),e.setSeatViewLocked(!1);let _=++m;k?e.showArriveChip(E,_):e.removeArriveChip();let{eye:R,focal:C}=e.resolvedSeatViewPose(E,T),O=o.arriveAtSeatEye?e.seatViewArrival(E,T):null,B=O&&O.stops.length>1&&O.stops[1].name==="row"?O.stops[1]:null,F=O?O.focal:C,N=[r.camera.position.x,r.camera.position.y,r.camera.position.z],V=Pc(N,O?.eye??R,F,n.bounds.center,n.bounds.radius),H=B?B.eye:O?O.eye:o.arriveAtSeatEye?R:V.finalPos,L=O?O.fov:o.arriveAtSeatEye?t.clientWidth/Math.max(1,t.clientHeight)<.7?ia:65:28,G=[V.waypoints[0],V.waypoints[1],H];if(c.setVisible(!1),e.reducedMotion())return e.setSeatStepping(!1),f(H,F,L),s.requestRender(),a.cinematicSkipped(),e.isDisposed()||r.syncFromCamera(),e.setSeatViewLocked(o.arriveAtSeatEye===!0),O&&e.enterSeatView(O.stops),e.showArriveChip(E,_),Promise.resolve();let j=new ga.Quat().copy(r.camera.quaternion),D=tp(r.camera,H,F);s.requestRender();let U=k?700:2500;return i.start(G,j,D,U,L).then(()=>{e.isDisposed()||_!==m||(e.setSeatStepping(!1),a.cinematicPlayed(U),r.resumeAfterFlight(F),e.setSeatViewLocked(o.arriveAtSeatEye===!0),O&&e.enterSeatView(O.stops,B?1:0),s.requestRender(),e.showArriveChip(E,_))})},S=(E,T)=>{let k=n.sections.find(_=>_.id===E);if(!k||k.seatCount===0)return!1;if(g=E,v=!1,e.setSeeThrough?.(null),e.setNearFieldDetailEnabled(!0),e.setSeatStepping(!1),e.setSeatViewLocked(!1),i.cancel(),e.removeArriveChip(),n.floors.length>1&&h!==k.floorIndex&&y(k.floorIndex),e.setNavigationMode("auto"),e.panorama()||c.setVisible(!0),e.showSectionSeatLabels(E),!T?.keepCamera){let _=t0(k),R={polarDeg:_.polarDeg,margin:1.12};e.reducedMotion()?r.frame({center:_.center,radius:_.radius},!1,r.currentAzimuth,!1,R):r.glideTo({center:_.center,radius:_.radius},R)}return o.onSectionFocusChange?.(E),s.requestRender(),!0},A=(E,T)=>{if(e.isDisposed()||!e.gpu())return!1;let k=n.seats.idToIndex.get(E);if(k===void 0)return!1;let _=k*3,R=[n.seats.iPosition[_],n.seats.iPosition[_+1]+.55,n.seats.iPosition[_+2]],C=T?uP(T,r.fovY,r.camera.aspect||1):r0;return v=!0,e.setSeeThrough?.(R),e.reducedMotion()?r.frame({center:R,radius:C},!1,void 0,!1,Dc):r.frameSoft({center:R,radius:C},void 0,!1,Dc),s.requestRender(),!0},M=()=>{if(e.isNarrow?.()&&v&&g&&S(g)){s.requestRender();return}P()};return d.addEventListener("click",M),{overviewChip:d,layoutOverviewChip:b,flightGen:()=>m,focusedFloor:()=>h,applyFloorFocus:y,placeCameraFinal:f,cancelFlight:w,focusOverview:P,flyToSeat:x,focusSectionCamera:S,focusSeatCamera:A}}var r0=4.5;function uP(e,t,n){let o=Math.tan(t*Math.PI/360),r=o*Math.max(.001,n),a=mP*e.viewportHeightPx/(2*Math.max(1,e.seatPx)*o)*Math.min(o,r)/Dc.margin;return Math.max(hP,Math.min(r0,a))}var mP=.5,hP=1.5,Dc={polarDeg:48,margin:1.25};function Br(e,t){let{doc:n,report:o}=Zi(e),r=o.confident&&(o.sections.length>0||!!o.looseRowBlocks);if(!r&&!o.roles?.length)return null;if(!r){let c=new Map(o.roles.map(f=>[f.id,f.role])),l=f=>f.map(d=>d.type==="shape"&&c.has(d.id)?{...d,role:c.get(d.id)}:d),u=e.floors?.map(f=>({...f,objects:l(f.objects)})),m=new Float64Array(t.length).fill(Number.NaN),h=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((f,d)=>{f.eyeHeightM!==void 0&&(m[d]=f.eyeHeightM),f.focalPoint&&(h[d*2]=f.focalPoint.x,h[d*2+1]=f.focalPoint.y)}),{doc:{...e,objects:u?.[0]?.objects??l(e.objects),...u?{floors:u}:{}},report:o,eyeHeightM:m,focal:h}}let i=new Map(fo(n).map(c=>[c.id,c])),a=new Float64Array(t.length).fill(Number.NaN),s=new Float64Array(t.length*2).fill(Number.NaN);return t.forEach((c,l)=>{let u=i.get(c.id)??c;u.eyeHeightM!==void 0&&(a[l]=u.eyeHeightM),u.focalPoint&&(s[l*2]=u.focalPoint.x,s[l*2+1]=u.focalPoint.y)}),{doc:n,report:o,eyeHeightM:a,focal:s}}function Nc(e,t){return e.map((n,o)=>{let r=t.eyeHeightM[o],i=t.focal[o*2],a=t.focal[o*2+1],s={...n};return Number.isNaN(r)?delete s.eyeHeightM:s.eyeHeightM=r,Number.isNaN(i)?delete s.focalPoint:s.focalPoint={x:i,y:a},s})}function i0(e){let t=e.estimate===!1?null:Br(e.doc,e.seats);return t?{input:{...e,doc:t.doc,seats:Nc(e.seats,t)},estimate:t}:{input:e}}function Bc(e,t,n,o,r,i,a,s,c=.5){let l=-1,u=s*s,m=1/0;for(let h=0;h<t;h++){let f=h*3,d=en(n,[e[f],e[f+1]+c,e[f+2]],o,r);if(!d.visible)continue;let p=d.x-i,b=d.y-a,y=p*p+b*b;(y<u-4||y<u+4&&d.depth<m)&&(l=h,u=Math.min(u,y),m=d.depth)}return l}var dP={};function a0(e){let t=performance.now(),{input:n,estimate:o}=i0(e);return{model:Oo(n),buildMs:performance.now()-t,source:"main",...o?{estimate:o}:{}}}function fP(e){let t=fo(e.doc);return{...a0({...e,seats:t}),seats:t}}function s0(e,t,n){let o=i=>({...t(),fallbackReason:i});if(typeof Worker>"u")return Promise.resolve(o("unavailable"));let r;try{r=new Worker(new URL("./scene/scene.worker.js",dP.url),{type:"module"})}catch{return Promise.resolve(o("unavailable"))}return new Promise(i=>{let a=!1,s=u=>{a||(a=!0,clearTimeout(l),r.terminate(),i(u))},c=u=>s(o(u)),l=window.setTimeout(()=>c("timeout"),15e3);r.onerror=()=>c("worker_error"),r.onmessage=u=>{let m=n(u.data);m?s(m):c("bad_response")},r.postMessage({...e,crowdSeatCeiling:e.crowdSeatCeiling??Xi()})})}function c0(e){return s0(e,()=>a0(e),({model:t,buildMs:n,estimate:o})=>({model:t,buildMs:n,source:"worker",...o?{estimate:o}:{}}))}function l0(e){return s0(e,()=>fP(e),({model:t,buildMs:n,seats:o,estimate:r})=>o?{model:t,buildMs:n,seats:o,source:"worker",...r?{estimate:r}:{}}:null)}var pP=40,bP=48,gP=Math.PI/180,yP=Fa,xP=500,MP=6;function vP(e,t,n={}){let o=performance.now(),r=t.prepared?t.prepared.estimate:t.estimate===!1?null:Br(t.doc,t.seats);r&&(t={...t,doc:r.doc,seats:Nc(t.seats,r)});let i=t.prepared?.model??Oo(t),a=new da(n.onAnalytics),s=new Array(i.seats.count);for(let[z,Y]of i.seats.idToIndex)s[Y]=z;let c=new Map(t.seats.map(z=>[z.id,z])),l=new Map;for(let z of t.seats){if(!z.rowId)continue;let Y=l.get(z.rowId);Y?Y.push(z.id):l.set(z.rowId,[z.id])}let u=new Map,m=[0,0,0,0];function h(){if(g)for(let z of[g.seatProgram,g.solidProgram,g.chairProgram])z.uniforms.uSeeThrough.value=m}t.seats.forEach((z,Y)=>{u.set(z.id,i.seatSectionIds?.[Y]??z.sectionId)});let f=new Map;for(let[z,Y]of i.seats.idToIndex){let q=u.get(z);if(!q)continue;let le=f.get(q);le?le.push(Y):f.set(q,[Y])}let d=()=>{if(!g||!i.sectionSolidRanges.length)return;let{lit:z,anyUnlit:Y}=Fd(i.sectionSolidRanges,f,i.seats.iState);g.setSectionShellLit(Y?z:null)},p=new Map,b=()=>{!g||!i.areaSolidRanges?.length||g.setAreaFloorsQuiet(new Set([...p].filter(([,z])=>Fc(z)).map(([z])=>z)))},y=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)),g=null,v=null,P=null,w=!1,x=!1,S=!1,A=new Map,M=null,E=null,T=null,k=new Map,_=null,R=()=>{T===null&&(T=e.style.zIndex,e.style.zIndex="20")},C=()=>{T!==null&&(e.style.zIndex==="20"&&(e.style.zIndex=T),T=null)},O=!1,B=()=>O?bt.focusedFloor():-1,F=()=>{g=Xd(D.gl,i),v?.dispose(),v=cd(D.gl,[1,1,1],i.theme.seatStates.selected),We(!1),d(),b(),W(),P=new oa(D.renderer,g.seatGeometry,g.chairGeometry,g.solidGeometry,i.seats.count),D.setClearColor(i.theme.background.top),P.setRestoreClear(i.theme.background.top),P.setRoomCentre(i.room?.centre),g.seatProgram.uniforms.uSeatRadius.value=cn*i.theme.seatScale,g.seatProgram.uniforms.uFocusFloor.value=B(),g.solidProgram.uniforms.uFocusFloor.value=B(),g.chairProgram.uniforms.uFocusFloor.value=B(),g.screenProgram&&(g.screenProgram.uniforms.uFocusFloor.value=B()),h(),V.forceRegather()},N=!1,V=new ba({model:i,orbit:()=>X,gpu:()=>g}),H=!1,L=new Map,G=24,j=z=>V.setDetailEnabled(z),D=new Zr(e,{onContextLost:()=>{S||a.contextLost(),w=!0,ye.stop(),g=null,P=null,U.reset()},onContextRestored:()=>{F(),w=!1,S||a.contextRestored(),ye.requestRender()}}),U=new qr(D.gl,D.renderer,D.smoothingSamples),$=new Qr,Z=!1,te=(z,Y)=>{if(!g)return{smooth:!1,onBudget:!1};if(Ml(i.seatCount,i.crowd?.count??0,xl)||g.nearSeatCount()>0||!z)return{smooth:!0,onBudget:!1};let q=$.allows(Y);return{smooth:q,onBudget:q}},X=new ri(D.gl,D.canvas,()=>ye.requestRender(),()=>a.orbitEngaged());X.setTouchNavigation(Sl(n)),X.setAspect(D.aspect);let me=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="section"&&z.physical3dProvenance?.surfaceKind?.status==="inferred"),re=(()=>{if(Number.isFinite(n.overviewAzimuthDeg))return n.overviewAzimuthDeg*Math.PI/180;if(!(me&&i.stages.length===0))return Yc(i.focalWorld,i.seats.iPosition,i.bounds)})(),ce=(t.doc.floors?.flatMap(z=>z.objects)??t.doc.objects).some(z=>z.type==="shape"&&z.stageKind?.startsWith("pitch-")),J=i.floors.length>1?{polarDeg:48,margin:1.1}:{polarDeg:ce?36:48,margin:1.05},ae=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;X.frame(i.bounds,!ae&&n.skipInitialOverviewAnimation!==!0,re,n.portraitOverviewCrop===!0,J);let ie=new ra(X.camera),ge=Up(e),Ae=$c(e,i),be=new Ji(e,{fontFamily:t.doc.theme?.fontFamily,ink:t.doc.theme?.textColor,backgroundRgb:i.theme.background.top}),ke=i.labels,Ke=()=>Rf(ke,i.floors.length,B());be.setLabels(Ke()),be.setOverviewDistance(X.targetDistance);let Be=()=>{let z=new Map,Y=ct.indexOf("available");for(let q of ke){if(!q.wheelchairSeats)continue;let le=0;for(let xe of q.wheelchairSeats)i.seats.iState[xe]===Y&&le++;le>0&&z.set(q.id,le)}return be.setWheelchairFree(z)};Be();let Fe=null,Ge=()=>[...A.keys()].flatMap(z=>{let Y=i.seats.idToIndex.get(z),q=Y===void 0?void 0:t.seats[Y];if(Y===void 0||q?.id!==z)return[];let le=Y*3;return[{id:`seat:${z}`,kind:"seat",seatWidthM:i.seats.iChairWidth[Y]*2,text:q.displayLabel||q.label,anchor:[i.seats.iPosition[le],i.seats.iPosition[le+1]+1.05,i.seats.iPosition[le+2]],pinBase:fe(le)}]}),ne=-1,W=()=>{g&&(ne=Fe?i.sections.findIndex(z=>z.id===Fe):-1,g.seatProgram.uniforms.uFocusSection.value=ne,g.chairProgram.uniforms.uFocusSection.value=ne)},K=z=>{if(Fe=z,W(),be.setForcedDense(!!z),!z){let he=Ge(),nt=new Set(he.map(qe=>qe.id));be.setLabels([...Ke().filter(qe=>!nt.has(qe.id)),...he]);return}let Y=t.seats.filter(he=>u.get(he.id)===z),q=new Set(Y.map(he=>he.id)),le=new Set(Y.map(he=>he.rowId)),xe=new Set(A.keys()),Le=new Set(Y.filter(he=>xe.has(he.id)).map(he=>he.id)),De=Ke().filter(he=>he.kind!=="row"&&he.kind!=="seat"&&he.kind!=="access"||he.kind==="access"&&q.has(he.id.slice(7))||(he.kind==="row"?le.has(he.id.slice(4)):q.has(he.id.slice(5))));if(i.seatCount<=6e3&&Le.size===0){be.setLabels(De);return}let He=Y,tt=new Set(He.map(he=>`seat:${he.id}`)),At=He.flatMap(he=>{let nt=i.seats.idToIndex.get(he.id);if(nt===void 0)return[];let qe=nt*3;return[{id:`seat:${he.id}`,kind:"seat",seatWidthM:i.seats.iChairWidth[nt]*2,rowId:he.rowId,text:xe.has(he.id)?he.displayLabel||he.label:nc(he.displayLabel||he.label),anchor:[i.seats.iPosition[qe],i.seats.iPosition[qe+1]+(xe.has(he.id)?1.05:.55),i.seats.iPosition[qe+2]],...xe.has(he.id)?{pinBase:fe(qe)}:{}}]});be.setLabels([...De.filter(he=>!tt.has(he.id)),...At])};F();let Q=null,ve=null,Ee=new u0.Mat4,Ve=z=>{if(w||!g||x)return!1;let Y=Ep({flying:ie.active,panoramaMounted:M!==null,seatViewActive:Q?.active===!0}),q=Ip(Q?.active===!0,B());g.seatProgram.uniforms.uFocusFloor.value=q,g.solidProgram.uniforms.uFocusFloor.value=q,g.chairProgram.uniforms.uFocusFloor.value=q,g.screenProgram&&(g.screenProgram.uniforms.uFocusFloor.value=q);let le=Y==="orbit"?ne:-1;g.seatProgram.uniforms.uFocusSection.value=le,g.chairProgram.uniforms.uFocusSection.value=le;let xe=H?!1:Y==="cinematic"?ie.update(performance.now()):Y==="seatView"?Q.update(performance.now()):Y==="orbit"?X.update():!1;ve?.syncZoomLimits(),ve?.syncNavigationMode();let Le=B()>=0?i.floors[B()]:null,De=Le?.radius??i.bounds.radius,He=Hl(X.currentDistance,De),tt=N?{center:[X.camera.position.x,X.camera.position.y,X.camera.position.z],radius:520}:i.clipBounds??i.renderBounds;X.updateClipping(tt);let At=Le?.center??i.renderBounds.center,he=Le?.radius??i.renderBounds.radius,nt=(Ht,Pa)=>Math.hypot(X.camera.position.x-Ht[0],X.camera.position.y-Ht[1],X.camera.position.z-Ht[2])<=Pa*(V.detailVisible?1.8:1.55),qe=nt(At,he);if(!qe&&Fe){let Ht=i.sections.find(Pa=>Pa.id===Fe);Ht&&(qe=nt(Ht.center,Math.max(12,Ht.radius*2)))}V.detailVisible=qe;let ft=g.seatProgram.uniforms;ft.uSeatScale.value=He.scale,ft.uSeatFade.value=He.fade;let Cn=!!Le&&Gl(Le.seatCount,D.canvas.clientWidth||1,D.canvas.clientHeight||1),Sa=Vl(i.seats.count,De,X.currentDistance,X.camera.fov,D.canvas.clientHeight||1),eo=V.detailVisible||Cn||Sa?1:0,Vr=V.detailVisible||B()>=0||i.floors.length>1?1:0;V.ease(z,eo,Vr),ft.uSeatDetail.value=V.seatDetailMix;let to=eo===0&&V.seatDetailMix<.01;g.seatGeometry.setDrawRange(to?Ia:0,to?ll:Ia),g.solidProgram.uniforms.uStructureDetail.value=V.structureDetailMix,g.solidProgram.uniforms.uViewport.value.set([D.gl.drawingBufferWidth,D.gl.drawingBufferHeight]),ft.uMinPixels.value=He.minPixels,ft.uPixelToWorld.value=2*Math.tan(X.camera.fov*gP/2)/Math.max(1,D.pixelHeight),V.update(V.detailVisible),(i.outdoor||i.house)&&(Ee.copy(X.camera.projectionViewMatrix).inverse(),g.backgroundProgram.uniforms.uInvViewProj.value.set(Ee),g.backgroundProgram.uniforms.uEye.value.set([X.camera.position.x,X.camera.position.y,X.camera.position.z]));let no=te(xe,X.currentDistance),Tt=U.begin(no.smooth);Z=Tt!==null,$.frame(no.onBudget&&Tt!==null,X.currentDistance,performance.now());let wa=Tt?{target:Tt}:{};D.renderer.render({scene:g.background,clear:!0,...wa}),D.renderer.render({scene:g.main,camera:X.camera,clear:!1,...wa});let g0=v?v.update(performance.now(),[X.camera.position.x,X.camera.position.y,X.camera.position.z],M!==null,Y==="seatView"):!1;if(v&&D.renderer.render({scene:v.root,camera:X.camera,clear:!1,...wa}),U.end(),Ae){let Ht=X.camera.worldMatrix;Ae.update(Y==="seatView"?[X.camera.position.x,X.camera.position.y,X.camera.position.z]:null,[-Ht[8],-Ht[9],-Ht[10]])}be.update(X.camera.projectionViewMatrix,D.canvas.clientWidth||1,D.canvas.clientHeight||1,X.currentDistance,De,[X.camera.position.x,X.camera.position.y,X.camera.position.z]);let jc=xe||g0||V.seatDetailMix!==eo||V.structureDetailMix!==Vr;return ze(!jc),jc},ze=Nl(e),ye=new ii(Ve),Pt=typeof ResizeObserver<"u"?new ResizeObserver(()=>va.resize()):null;Pt?.observe(e),X.setZoomPointResolver((z,Y)=>{let q=D.canvas.getBoundingClientRect(),le=D.canvas.clientWidth||q.width,xe=D.canvas.clientHeight||q.height;if(!(le>0)||!(xe>0))return null;X.camera.updateMatrixWorld();let Le=Bc(i.seats.iPosition,i.seats.count,X.camera.projectionViewMatrix,le,xe,z-q.left,Y-q.top,pP);if(Le<0)return null;let De=Le*3;return[i.seats.iPosition[De],i.seats.iPosition[De+1]+.5,i.seats.iPosition[De+2]]});function fe(z){return[i.seats.iPosition[z],i.seats.iPosition[z+1]+.5,i.seats.iPosition[z+2]]}be.setSeatNumberRow(null);let Ce=null,ee=0,pe=null,de=()=>{ee=0;let z=null,Y=null;if(Ce&&!Q?.active&&!ie.active){let xe=D.canvas.getBoundingClientRect(),Le=D.canvas.clientWidth||xe.width,De=D.canvas.clientHeight||xe.height;if(Le>0&&De>0){let He=Bc(i.seats.iPosition,i.seats.count,X.camera.projectionViewMatrix,Le,De,Ce.x-xe.left,Ce.y-xe.top,bP);z=He>=0?t.seats[He]?.rowId??null:null;let tt=He>=0?t.seats[He]?.id??null:null;if(Y=tt,Ce.mouse&&!Ce.pressing&&!!Fe&&!!tt&&u.get(tt)===Fe){let he=e.getBoundingClientRect();pe=tt,n.onSeatHover?.(tt,{x:Ce.x-he.left,y:Ce.y-he.top})}else Te()}}else Te();let q=Ce?.mouse?Y:null,le=be.setSeatNumberSeat(q);(be.setSeatNumberRow(z)||le)&&ye.requestRender()};function Te(){pe!==null&&(pe=null,n.onSeatHover?.(null,null))}let Oe=z=>{Ce={x:z.clientX,y:z.clientY,mouse:z.pointerType==="mouse",pressing:z.type==="pointerdown"},ee||(ee=requestAnimationFrame(de))},Ue=z=>{z.pointerType==="mouse"&&(Ce=null,ee||(ee=requestAnimationFrame(de)))};D.canvas.addEventListener("pointermove",Oe),D.canvas.addEventListener("pointerdown",Oe),D.canvas.addEventListener("pointerleave",Ue);function We(z){if(!v)return;let Y=[];for(let q of A.keys()){let le=i.seats.idToIndex.get(q);if(le===void 0)continue;let xe=le*3;Y.push({id:q,position:fe(xe)})}v.setSeats(Y,performance.now(),z)}let at=z=>{let Y=xe=>{let Le=i.seats.idToIndex.get(xe);return Le===void 0?void 0:i.seats.iState[Le]},{updates:q,next:le}=Yd(A,z,Y);if(A=le,be.setSelectedSeatIds(A.keys()),We(!Ze()),ye.requestRender(),K(Fe),q.length){let xe=Ya(i.seats,q);g&&g.uploadSeatStateRuns(xe),d(),ye.requestRender()}},Ze=()=>_!==null?_:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,st=8,Bt=z=>{if(!n.getSeatView)return null;let Y=k.get(z);if(!Y)for(Y=Promise.resolve(n.getSeatView(z)),k.set(z,Y),Y.catch(()=>{k.get(z)===Y&&k.delete(z)});k.size>st;){let q=k.keys().next().value;if(q===void 0)break;k.delete(q)}return Y},Ct=yp(i.stages,i.focalWorld,i.bounds.groundY??0),Ut=_c(Ct),fn=null,_n=(z,Y)=>{if(c.get(z)?.kind!=="booth")return null;fn??=ap(t.doc,t.seats);let q=fn.get(z),le=[i.seats.iPosition[Y*3],i.seats.iPosition[Y*3+1],i.seats.iPosition[Y*3+2]];return q?{at:le,front:q}:null},$n=(z,Y)=>{let q=_n(z,Y);if(q)return Ec(q.at,q.front);let le=c.get(z),xe=Math.max(0,Math.round(i.seats.iFloor[Y]??0)),Le=t.doc.floors?.[xe],De=i.floors[xe],He=Le?.focalPoint??t.doc.focalPoint,tt=De?{x:De.focalWorld[0]/I,y:De.focalWorld[2]/I}:He,At=le?.focalPoint?{x:le.focalPoint.x+tt.x-He.x,y:le.focalPoint.y+tt.y-He.y}:tt,he=[i.seats.iPosition[Y*3],i.seats.iPosition[Y*3+1],i.seats.iPosition[Y*3+2]],nt=rp(i.seats.iPosition,Y,Ut),qe=nt!==null&&Math.abs(nt)<op;return ip(he,At,Le?.baseHeightM??0,le?.eyeHeightM,Ut,qe)},Zn=()=>(e.clientWidth||D.canvas.clientWidth)<=520,qn=null,zo=null,ya=async(z,Y,q)=>{if(!n.getSeatView||S||q!==bt.flightGen())return;let le;try{le=await Vp()}catch{if(a.panoramaFailed(z,"mount"),!S&&q===bt.flightGen()){let xe=Qn(z,q,!0);requestAnimationFrame(()=>xe?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(S||q!==bt.flightGen()||!qn))return zo??=le.createOpenPanorama(qn),zo(z,Y,q)},Uo=Wp({container:e,model:i,opts:n,expandedSeatById:c,seatIdsByRow:l,isNarrow:Zn,isDisposed:()=>S,flightGen:()=>bt.flightGen(),flyToSeat:z=>Uc(z),openPanorama:(z,Y,q)=>ya(z,Y,q)}),Qn=Uo.show,Jn=Uo.remove,xa=Uo.layout,an=jp({container:e,orbit:X,isNarrow:Zn,enabled:n.chrome?.controlDock!==!1,...n.navLabels?{labels:n.navLabels}:{}});ve=an;let Hr=an.element,Wo=an.setNavigationMode,m0=an.layout,h0=an.utilityControls,jo=null,Hc=!1,Gr=z=>{an.setSeatViewLocked(z),z||Q?.exit()};Q=Rp({canvas:D.canvas,camera:X.camera,requestRender:()=>ye.requestRender(),reducedMotion:Ze,onStopChange:z=>{let Y=z??(Hc?"seat":null);jo=Y;try{n.onSeatViewStopChange?.(Y)}catch{}},onApplied:()=>{S||X.syncFromCamera()}});let Gc=i.sections.reduce((z,Y)=>Y.seatCount>0&&Y.box?Math.max(z,Y.box.max[1]):z,-1/0),Vc=(z,Y)=>{let{eye:q}=$n(z,Y),le=(e.clientWidth||D.canvas.clientWidth||1)/Math.max(1,e.clientHeight||D.canvas.clientHeight||1),xe=_n(z,Y),Le=xe?cp(xe.at,xe.front,le):Mp(q,Ct,le,{preserveEye:!0});if(n.seatViewStops===!1)return{...Le,stops:[]};let De=u.get(z),He=De?i.sections.find(tt=>tt.id===De):void 0;return{...Le,stops:vp(Le,{aspect:le,seatingTopY:Number.isFinite(Gc)?Gc:i.bounds.box.max[1],section:He&&He.seatCount>0?{center:He.center,radius:He.radius}:null,venue:{center:i.bounds.center,radius:i.bounds.radius}})}},bt=o0({isNarrow:Zn,setSeeThrough:z=>{m=z?[z[0],z[1],z[2],MP]:[0,0,0,0],h(),ye.requestRender()},container:e,model:i,opts:n,orbit:X,cinematic:ie,analytics:a,loop:ye,labelOverlay:be,stageAzimuth:re,overviewFraming:J,gpu:()=>g,isDisposed:()=>S,panorama:()=>M,setPanorama:z=>{M=z},setPanoramaSphereVisible:z=>{N=z},panoramaLoadAbort:()=>E,setPanoramaLoadAbort:z=>{E=z},setFrozen:z=>{x=z},restorePanoramaLayer:C,reducedMotion:Ze,resolvedSeatViewPose:$n,showSectionSeatLabels:K,setNearFieldDetailEnabled:j,setSeatViewLocked:Gr,setNavigationMode:Wo,showArriveChip:Qn,removeArriveChip:Jn,inSeatView:()=>jo!==null,setSeatStepping:z=>{Hc=z},seatViewArrival:(z,Y)=>n.arriveAtSeatEye?Vc(z,Y):null,enterSeatView:(z,Y)=>Q?.enter(z,Y)});O=!0;let Ma=bt.overviewChip,f0=bt.layoutOverviewChip,d0=bt.applyFloorFocus,p0=bt.focusOverview,zc=bt.cancelFlight,Uc=bt.flyToSeat,Wc=bt.focusSectionCamera;h0.appendChild(Ma),qn={container:e,model:i,opts:n,analytics:a,orbit:X,loop:ye,seatsById:c,ensureSeatView:Bt,resolvedSeatViewPose:$n,gpu:()=>g,gl:D.gl,isContextLost:()=>w,isDisposed:()=>S,flightGen:()=>bt.flightGen(),setPanorama:z=>{M=z},getLoadAbort:()=>E,setLoadAbort:z=>{E=z},setPanoramaSphereVisible:z=>{N=z,z&&Q?.exit()},setFrozen:z=>{x=z},raisePanoramaLayer:R,restorePanoramaLayer:C,getOverviewChip:()=>Ma,labelOverlay:be,reducedMotion:Ze,removeArriveChip:Jn,showArriveChip:Qn};let b0=e0({canvas:D.canvas,areas:i.areas,viewProjection:()=>X.camera.projectionViewMatrix,state:z=>p.get(z),focusedFloor:B,floorCount:i.floors.length,tagAt:(z,Y)=>be.tagAt(z,Y)}),Wt=Yp({glctx:D,orbit:X,model:i,seats:t.seats,opts:n,cinematic:ie,analytics:a,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:yP,tapMs:xP,gpu:()=>g,pick:()=>P,seatViewLocked:()=>an.seatViewLocked(),focusedSectionId:()=>Fe,selection:()=>A,cancelFlight:zc,focusSectionCamera:Wc,focusSeatCamera:bt.focusSeatCamera,setSelection:at,ensureSeatView:Bt,areaAt:b0});D.canvas.addEventListener("pointerdown",Wt.onDown),D.canvas.addEventListener("pointermove",Wt.onMove),D.canvas.addEventListener("pointerup",Wt.onUp),D.canvas.addEventListener("pointercancel",Wt.onUp),D.canvas.addEventListener("touchend",Wt.onTouchEnd,{passive:!1}),ye.requestRender();let va={setAvailability(z){let Y=Kd(A,z),q=Ya(i.seats,Y);q.length&&g&&g.uploadSeatStateRuns(q),d(),q.length&&Be(),ye.requestRender()},setSelection:at,setAreaStates(z){let Y=!1;for(let[q,le]of Object.entries(z)){let xe=p.get(q);xe&&qp(xe,le)||(p.set(q,{available:le.available,selected:le.selected,wheelchairFree:le.wheelchairFree,filteredOut:le.filteredOut===!0,statusText:le.statusText??""}),Y=!0)}Y&&(ke=Jp(i.labels,p),b(),K(Fe),ye.requestRender())},setNavigationMode:Wo,zoomIn(){X.zoomBy(ro),ye.requestRender()},zoomOut(){X.zoomBy(Zo),ye.requestRender()},flyToSeat:Uc,focusOverview:p0,seatViewStop:()=>jo,recentreSeatView:()=>Q?.recentre()??!1,resize(){let{width:z,height:Y}=D.resize();X.setAspect(z/Math.max(1,Y)),xa(),m0(),f0(),ye.requestRender()},stats(){return{...ye.stats(),drawCalls:g?g.drawCalls:0,fallbackTriangles:g?g.seatGeometry.drawRange.count/3*i.seats.count:0,seatCount:i.seatCount}},captureImage(z=1280){if(w||!g||typeof document>"u")return null;Ve(0);let Y=D.canvas,q=Math.min(1,z/Math.max(Y.width,Y.height,1)),le=document.createElement("canvas");le.width=Math.max(1,Math.round(Y.width*q)),le.height=Math.max(1,Math.round(Y.height*q));let xe=le.getContext("2d");return xe?(xe.drawImage(Y,0,0,le.width,le.height),le.toDataURL("image/jpeg",.82)):null},captureSeatView(z,Y=480){if(w||!g||x||typeof document>"u"||ie.active||M!==null||Q?.active)return null;let q=L.get(z);if(q)return q;let le=i.seats.idToIndex.get(z);if(le===void 0)return null;let{eye:xe,focal:Le,fov:De}=Vc(z,le),He=X.snapshot(),tt=[V.seatDetailMix,V.structureDetailMix],At=null;try{H=!0,X.camera.position.set(xe[0],xe[1],xe[2]),X.camera.perspective({fov:De,aspect:X.camera.aspect}),X.camera.lookAt(Le),X.camera.updateMatrixWorld(),X.syncFromCamera(),V.seatDetailMix=1,V.structureDetailMix=1,V.forceRegather(),Ve(0);let he=D.canvas,nt=Math.min(he.width,Math.round(he.height*16/9)),qe=Math.round(nt*9/16),ft=document.createElement("canvas");ft.width=Math.max(1,Math.round(Y)),ft.height=Math.max(1,Math.round(Y*9/16));let Cn=ft.getContext("2d");Cn&&(Cn.drawImage(he,(he.width-nt)/2,(he.height-qe)/2,nt,qe,0,0,ft.width,ft.height),At=ft.toDataURL("image/jpeg",.8))}finally{H=!1,He(),V.seatDetailMix=tt[0],V.structureDetailMix=tt[1],V.forceRegather(),Ve(0)}if(At)for(L.set(z,At);L.size>G;)L.delete(L.keys().next().value);return At},getQualityEvidence(){let z=ye.stats(),Y=D.canvas.clientWidth||1,q=D.canvas.clientHeight||1,le=i.bounds.center,xe=en(X.camera.projectionViewMatrix,[le[0],i.bounds.box.min[1],le[2]],Y,q),Le=en(X.camera.projectionViewMatrix,[le[0],i.bounds.box.max[1],le[2]],Y,q),De=i.bounds.box,He=[De.min[0],De.max[0]].flatMap(he=>[De.min[1],De.max[1]].flatMap(nt=>[De.min[2],De.max[2]].map(qe=>en(X.camera.projectionViewMatrix,[he,nt,qe],Y,q)))).filter(he=>Number.isFinite(he.x)&&Number.isFinite(he.y)&&Number.isFinite(he.depth)),tt=He.length?(()=>{let he=Math.min(...He.map(Tt=>Tt.x)),nt=Math.max(...He.map(Tt=>Tt.x)),qe=Math.min(...He.map(Tt=>Tt.y)),ft=Math.max(...He.map(Tt=>Tt.y)),Cn=Math.max(0,he),Sa=Math.min(Y,nt),eo=Math.max(0,qe),Vr=Math.min(q,ft),to=Math.max(0,Sa-Cn),no=Math.max(0,Vr-eo);return{box:{x:Cn,y:eo,width:to,height:no},horizontalFillRatio:to/Y,verticalFillRatio:no/q,visibleAreaRatio:to*no/(Y*q),clippedEdges:[...qe<0?["top"]:[],...nt>Y?["right"]:[],...ft>q?["bottom"]:[],...he<0?["left"]:[]]}})():void 0,At=String(D.gl.getParameter(D.gl.VERSION)??"");return{viewport:{width:Y,height:q},context:{webgl2:/webgl\s*2/i.test(At),lost:w},frame:{rendered:z.rendered,idle:z.idle,smoothed:Z},camera:{position:[X.camera.position.x,X.camera.position.y,X.camera.position.z],distance:X.currentDistance,verticalFovDeg:X.fovY},scene:{seatCount:i.seatCount,floorCount:i.floors.length,zoneCount:i.zones.length,sectionCount:i.sections.length,authoredRelief:y,renderedVerticalSpanM:Math.max(0,i.bounds.box.max[1]-i.bounds.box.min[1]),projectedReliefPx:xe.visible&&Le.visible?Math.abs(xe.y-Le.y):0},labels:be.qualityEvidence(),framing:tt,...jo?{seatView:{fovDeg:X.camera.fov,stop:jo}}:{}}},getQualityReport(){return ea(va.getQualityEvidence())},loseContextForTest(){D.simulateContextLossCycle()},floors(){return i.floors},focusFloor(z){if(z!==null&&!i.floors.some(q=>q.index===z))return!1;let Y=z??-1;if(j(z!==null),Gr(!1),d0(Y),Wo("orbit"),z===null)ie.cancel(),Ze()?X.frame(i.bounds,!1,re,n.portraitOverviewCrop===!0,J):X.frameSoft(i.bounds,re,n.portraitOverviewCrop===!0,J),be.setOverviewDistance(X.targetDistance);else{let q=i.floors[z];if(q.seatCount>0){ie.cancel();let le=q.focalWorld[0]-q.center[0],xe=q.focalWorld[2]-q.center[2],Le=Math.hypot(le,xe)>q.radius*.12?Math.atan2(le,xe):re;X.frame({center:q.center,radius:q.radius,box:q.box},!1,Le,!1,{polarDeg:58,margin:1.12}),be.setOverviewDistance(X.targetDistance)}}return ye.requestRender(),!0},zones(){return i.zones},focusZone(z){let Y=i.zones.find(Le=>Le.id===z);if(!Y||Y.seatCount===0)return!1;j(!1),Gr(!1),ie.cancel(),Wo("orbit"),K(null),n.onSectionFocusChange?.(null);let q=Y.focalWorld[0]-Y.center[0],le=Y.focalWorld[2]-Y.center[2],xe=Math.hypot(q,le)>Y.radius*.12?Math.atan2(q,le):void 0;return X.frame({center:Y.center,radius:Y.radius*1.25},!1,xe),ye.requestRender(),!0},sections(){return i.sections},focusSection(z){return Wc(z)},rows(z){return z?i.rows.filter(Y=>Y.sectionId===z):i.rows},seatsInRow(z){return t.seats.filter(Y=>Y.rowId===z).map(Y=>({id:Y.id,label:Y.displayLabel||Y.label}))},focusRow(z){let Y=i.rows.find(q=>q.id===z);return!Y||Y.seatCount===0?!1:(j(!0),Gr(!1),ie.cancel(),Wo("pan"),Y.sectionId&&(K(Y.sectionId),n.onSectionFocusChange?.(Y.sectionId)),X.frame({center:Y.center,radius:Math.max(2.5,Y.radius*.65)}),ye.requestRender(),!0)},setReducedMotionForTest(z){_=z},dispose(){S=!0,Ae?.dispose(),ze(!1),Jn(),Ma.remove(),Hr.remove(),zc(),Q?.dispose(),ye.stop(),be.dispose(),Pt?.disconnect(),M&&(M.dispose(),M=null),C(),ge(),D.canvas.removeEventListener("pointerdown",Wt.onDown),D.canvas.removeEventListener("touchend",Wt.onTouchEnd),D.canvas.removeEventListener("pointermove",Wt.onMove),D.canvas.removeEventListener("pointerup",Wt.onUp),D.canvas.removeEventListener("pointercancel",Wt.onUp),D.canvas.removeEventListener("pointermove",Oe),D.canvas.removeEventListener("pointerdown",Oe),D.canvas.removeEventListener("pointerleave",Ue),ee&&cancelAnimationFrame(ee),X.dispose(),P&&P.dispose(),g&&g.dispose(),g=null,v?.dispose(),v=null,P=null,U.dispose(),D.dispose()}};return a.opened(i.seatCount,y,t.prepared?.buildMs??performance.now()-o,t.prepared?.source??"inline"),va}0&&(module.exports={VENUE3D_QUALITY_REPORT_VERSION,autoVenue3d,buildSceneModel,estimateVenue3D,inspectVenue3DQualityEvidence,mountVenue3D,prepareVenue3D,prepareVenue3DFromChart});
|