@seatlayer/core 0.81.0 → 0.82.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-5VHC7HRK.js +1 -0
- package/dist/be-TK6YL7O3.js +1 -0
- package/dist/bg-FMA4EULF.js +1 -0
- package/dist/ca-A45FK52V.js +1 -0
- package/dist/{categoryInventory-B0QvDW6c.d.cts → categoryInventory-BUuP_cBe.d.cts} +1 -1
- package/dist/{categoryInventory-H-Z3zkdw.d.ts → categoryInventory-Bqq9Qmf-.d.ts} +1 -1
- package/dist/chunk-4ABXX5PL.js +1 -0
- package/dist/chunk-4I2VWFJY.js +1 -0
- package/dist/{chunk-SKMHD76O.js → chunk-APMDM2YC.js} +1 -1
- package/dist/chunk-BS37TGPX.js +1 -0
- package/dist/chunk-FQ2MMJMH.js +1 -0
- package/dist/chunk-P4J57TK6.js +1 -0
- package/dist/chunk-PKAMEVNY.js +1 -0
- package/dist/core/chart-ops/index.d.cts +4 -4
- package/dist/core/chart-ops/index.d.ts +4 -4
- 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.d.cts +5 -5
- package/dist/core/layout/index.d.ts +5 -5
- package/dist/core/quality/index.cjs +1 -1
- package/dist/core/quality/index.d.cts +32 -4
- package/dist/core/quality/index.d.ts +32 -4
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.cjs +1 -1
- package/dist/core/render-assets/index.d.cts +2 -1
- package/dist/core/render-assets/index.d.ts +2 -1
- 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/cs-IBLFYLZM.js +1 -0
- package/dist/cy-34ELUEIL.js +1 -0
- package/dist/da-GQN6BRAO.js +1 -0
- package/dist/de-T7KW4S4R.js +1 -0
- package/dist/el-AGMWKSVL.js +1 -0
- package/dist/es-3MLQHBEG.js +1 -0
- package/dist/et-ZXPWQ5KO.js +1 -0
- package/dist/{eventConfigurations-BPPbXP9X.d.ts → eventConfigurations-bYbfJfZQ.d.ts} +1 -1
- package/dist/{eventConfigurations-DaOxuIpn.d.cts → eventConfigurations-sDDI4m6-.d.cts} +1 -1
- package/dist/fa-JKTXTNCZ.js +1 -0
- package/dist/fi-WMJXY2WO.js +1 -0
- package/dist/fr-D3X5YMNY.js +1 -0
- package/dist/he-E2UR2UQO.js +1 -0
- package/dist/hr-5EGOH3G2.js +1 -0
- package/dist/hu-YR7UJX5F.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +170 -27
- package/dist/index.d.ts +170 -27
- package/dist/index.js +1 -1
- package/dist/it-375P5GZ3.js +1 -0
- package/dist/ja-PWGPUXT6.js +1 -0
- package/dist/ku-OAI5XCN4.js +1 -0
- package/dist/{labeling-DE1CwnnZ.d.cts → labeling-BLFtKRos.d.cts} +1 -1
- package/dist/{labeling-DKieA71R.d.ts → labeling-C1djEg9b.d.ts} +1 -1
- package/dist/localeLoaders-TE4NBRUR.js +1 -0
- package/dist/lt-OT4GWRKU.js +1 -0
- package/dist/lv-4GFUUG4J.js +1 -0
- package/dist/nl-3U3HO52W.js +1 -0
- package/dist/no-T3RYHJIQ.js +1 -0
- package/dist/pl-AVH2HJME.js +1 -0
- package/dist/pt-F7JVGJFC.js +1 -0
- package/dist/{renderedQuality-KkuudVDV.d.ts → renderedQuality-DXypknFp.d.ts} +1 -1
- package/dist/{renderedQuality-BLLTXbOO.d.cts → renderedQuality-DobpzrSi.d.cts} +1 -1
- package/dist/{renderer-B2yUBVOg.d.ts → renderer-B4lfUtSx.d.cts} +8 -1
- package/dist/{renderer-DCfWXUcm.d.cts → renderer-DV3IcS5s.d.ts} +8 -1
- package/dist/ro-G3EVESXP.js +1 -0
- package/dist/ru-PW6NG5JX.js +1 -0
- package/dist/seatTypeIcons-Cvb4NmBV.d.ts +62 -0
- package/dist/seatTypeIcons-DqSRhAa-.d.cts +62 -0
- package/dist/{sections-DOho5-zT.d.ts → sections-BdkRSztu.d.ts} +1 -1
- package/dist/{sections-LFcH15oQ.d.cts → sections-DnWOU20j.d.cts} +1 -1
- package/dist/{segmentedRowModel-DpFBEaLn.d.ts → segmentedRowModel-CiE_cPAl.d.ts} +1 -1
- package/dist/{segmentedRowModel-DQylOwZU.d.cts → segmentedRowModel-uAntpvw7.d.cts} +1 -1
- package/dist/sk-5MC3SLDB.js +1 -0
- package/dist/sl-D7X2YP2P.js +1 -0
- package/dist/sr-NYTF6LCE.js +1 -0
- package/dist/sv-IDFALD5B.js +1 -0
- package/dist/{tableSizing-DcZAr8Cc.d.ts → tableSizing-DVSq_vYI.d.ts} +3 -3
- package/dist/{tableSizing-amFdMq3T.d.cts → tableSizing-In_nE02i.d.cts} +3 -3
- package/dist/{ticketRestrictions-fMxTjCsC.d.ts → ticketRestrictions-Ch-gKq3Q.d.ts} +2 -2
- package/dist/{ticketRestrictions-D3Euerz2.d.cts → ticketRestrictions-D9hpVsCH.d.cts} +2 -2
- package/dist/tr-J5MTCS62.js +1 -0
- package/dist/{types-9TsSrYGB.d.cts → types-D22x9X9w.d.cts} +1 -1
- package/dist/{types-9TsSrYGB.d.ts → types-D22x9X9w.d.ts} +1 -1
- package/dist/uk-VPWVG4AX.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 +31 -31
- package/dist/view3d/index.d.cts +25 -3
- package/dist/view3d/index.d.ts +25 -3
- package/dist/view3d/index.js +29 -29
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/dist/zh-Hans-72N63TPO.js +1 -0
- package/dist/zh-Hant-WNSFW5HB.js +1 -0
- package/package.json +1 -1
- package/dist/ar-IJCDEZFA.js +0 -1
- package/dist/be-LFJ7QTC3.js +0 -1
- package/dist/bg-J3TMRABG.js +0 -1
- package/dist/ca-MM2WRHUU.js +0 -1
- package/dist/chunk-C7MR6CFC.js +0 -1
- package/dist/chunk-GQLJAU75.js +0 -1
- package/dist/chunk-WXGW2SYC.js +0 -1
- package/dist/chunk-YXOSJLK7.js +0 -1
- package/dist/cs-EIYYGA34.js +0 -1
- package/dist/cy-47BXX465.js +0 -1
- package/dist/da-UZ6ZWBRN.js +0 -1
- package/dist/de-PG4VZQPH.js +0 -1
- package/dist/el-XD5OOYKU.js +0 -1
- package/dist/es-GCDK6L27.js +0 -1
- package/dist/et-Y6LRXTLO.js +0 -1
- package/dist/fa-LC5L6ZTN.js +0 -1
- package/dist/fi-EQC74RHM.js +0 -1
- package/dist/fr-FJSMA757.js +0 -1
- package/dist/he-6EZS42SY.js +0 -1
- package/dist/hr-I4GSAXXP.js +0 -1
- package/dist/hu-Q5ZEW7FT.js +0 -1
- package/dist/it-VVXY7L2S.js +0 -1
- package/dist/ja-ZKPATNFV.js +0 -1
- package/dist/ku-S7DGMHQK.js +0 -1
- package/dist/localeLoaders-NM53E5H6.js +0 -1
- package/dist/lt-US73MBW6.js +0 -1
- package/dist/lv-PHQRHAV3.js +0 -1
- package/dist/nl-7KYZ3WST.js +0 -1
- package/dist/no-43QWDAF4.js +0 -1
- package/dist/pl-RH6CXGP4.js +0 -1
- package/dist/pt-4COVCMUB.js +0 -1
- package/dist/ro-C7FUGVS5.js +0 -1
- package/dist/ru-GWBT3VHX.js +0 -1
- package/dist/sk-WVA5IWFS.js +0 -1
- package/dist/sl-NRKGTU6J.js +0 -1
- package/dist/sr-PXGQJ7N7.js +0 -1
- package/dist/sv-54BGXBGQ.js +0 -1
- package/dist/tr-C4LQVHXM.js +0 -1
- package/dist/uk-SWCERYU2.js +0 -1
- package/dist/zh-Hans-DL67M6B2.js +0 -1
- package/dist/zh-Hant-Z65RGQ6L.js +0 -1
package/dist/view3d/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{a as me,b as Kt,c as Qt,d as Ye,e as we,f as vt,g as bt,h as $t,i as Zt,j as Te,k as Jt,l as gt,m as eo,n as to,o as oo,p as no,q as fe,r as ro,s as io,t as ao,u as so,v as yt,w as lo,x as Ie}from"../chunk-GQLJAU75.js";import"../chunk-PRED5KHO.js";import"../chunk-QJXSZT3H.js";import"../chunk-WXGW2SYC.js";import"../chunk-UL5OIGIF.js";import{Wa as Xt}from"../chunk-24O23MNB.js";import{d as qt,l as jt}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as zn}from"ogl";function Nn(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,o=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,o)}var Xe=class{constructor(e,o){this.clearRgb=[0,0,0];this.container=e,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 zn({canvas:this.canvas,dpr:Nn(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Ye.top[0],Ye.top[1],Ye.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),o.onContextLost()},this.restoredHandler=()=>o.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),o=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,o),{width:e,height:o}}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 e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as Bn,Vec3 as xt}from"ogl";var ie=Math.PI/180,St=15*ie,wt=80*ie,Me=.12,co=35,uo=1.25,qe=class{constructor(e,o,r,n){this.fovY=co;this.target=new xt;this.azimuth=-30*ie;this.polar=55*ie;this.distance=10;this.azT=-30*ie;this.polT=55*ie;this.distT=10;this.minDist=1;this.maxDist=100;this.gestureFired=!1;this.interactionEnabled=!0;this.dragging=!1;this.panning=!1;this.lastX=0;this.lastY=0;this.activePointers=new Map;this.pinchDist=0;this.pinchCx=0;this.pinchCy=0;this.targetT=new xt;this.panAnchor=new xt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new Bn(e,{fov:co,near:.1,far:5e3,aspect:1}),this.canvas=o,this.requestRender=r,this.onGesture=n,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 s=i.button===2||i.button===1,a=i.button===0&&(i.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=s||a,this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();let s=this.pinchCentroid();this.pinchCx=s.x,this.pinchCy=s.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();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-l)*.005)),this.fireGesture()),this.pinchDist=l;let u=this.pinchCentroid();this.panBy(u.x-this.pinchCx,u.y-this.pinchCy),this.pinchCx=u.x,this.pinchCy=u.y;return}let s=i.clientX-this.lastX,a=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&(this.panBy(s,a),this.fireGesture());return}this.dragging&&(this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&this.fireGesture(),this.azT-=s*.006,this.polT=Math.max(St,Math.min(wt,this.polT-a*.006)),this.requestRender())},this.onPointerUp=i=>{this.activePointers.delete(i.pointerId);try{this.canvas.releasePointerCapture?.(i.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let s=i.deltaMode===1?16:i.deltaMode===2?100:1,a=Math.max(-2,Math.min(2,i.deltaY*s/100));this.dollyBy(Math.exp(a*.22)),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let s=7*ie;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"?-s:s;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(St,Math.min(wt,this.polT+(i.key==="ArrowUp"?-s:s)));else if(i.key==="+"||i.key==="=")this.dollyBy(.82);else if(i.key==="-"||i.key==="_")this.dollyBy(1.22);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},o.addEventListener("pointerdown",this.onPointerDown),o.addEventListener("pointermove",this.onPointerMove),o.addEventListener("pointerup",this.onPointerUp),o.addEventListener("pointercancel",this.onPointerUp),o.addEventListener("wheel",this.onWheel,{passive:!1}),o.addEventListener("keydown",this.onKeyDown),o.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let o=0,r=0;for(let n of e)o+=n.x,r+=n.y;return{x:o/e.length,y:r/e.length}}panBy(e,o){let r=this.canvas.clientHeight||1,n=2*this.distance*Math.tan(this.fovY*ie/2)/r,i=Math.sin(this.azimuth),s=Math.cos(this.azimuth),a=s,l=-i,u=Math.cos(this.polar),f=Math.sin(this.polar),p=-i*u,v=-s*u;this.targetT.x+=(-e*a+o*p)*n,this.targetT.z+=(-e*l+o*v)*n,this.targetT.y+=o*f*n,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,o=this.panAnchor.x,r=this.panAnchor.y,n=this.panAnchor.z;this.targetT.x=Math.max(o-e,Math.min(o+e,this.targetT.x)),this.targetT.z=Math.max(n-e,Math.min(n+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,o=!1,r,n=!1,i){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5;let s=Math.max(1,e.radius),a=this.fovY*ie/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,u=Math.atan(Math.tan(a)*l);this.azT=r??-30*ie,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*ie;let f=this.fitDistance(e,a,u,this.azT,this.polT);this.distT=f*Math.max(1.05,Math.min(2,i?.margin??uo)),this.minDist=Math.max(2,s*.12),this.maxDist=f*4,o?(this.azimuth=this.azT,this.polar=12*ie,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){this.camera.perspective({aspect:e})}frameSoft(e,o,r=!1,n){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*ie/2,s=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,a=Math.atan(Math.tan(i)*s);this.azT=o??this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ie;let l=this.fitDistance(e,i,a,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??uo))}fitDistance(e,o,r,n,i){let s=Math.max(1,e.radius),a=Math.max(s/Math.tan(o),s/Math.tan(r)),l=e.box;if(!l)return a;let u=Math.sin(i),f=-u*Math.sin(n),p=-Math.cos(i),v=-u*Math.cos(n);if(Math.abs(p)>.999)return a;let c=-v,d=f,E=Math.hypot(c,d);c/=E,d/=E;let C=-d*p,M=d*f-c*v,k=c*p,y=Math.tan(r),D=Math.tan(o),P=1;for(let x=0;x<8;x++){let S=(x&1?l.max[0]:l.min[0])-e.center[0],T=(x&2?l.max[1]:l.min[1])-e.center[1],_=(x&4?l.max[2]:l.min[2])-e.center[2],O=S*f+T*p+_*v,R=Math.abs(S*c+_*d),Y=Math.abs(S*C+T*M+_*k);P=Math.max(P,R/y-O,Y/D-O)}return Math.min(a,Math.max(P,s*.35))}updateClipping(e){let o=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],n=this.camera.position.z-e.center[2],i=Math.hypot(o,r,n),s=Math.max(1,e.radius)*1.18,a=Math.max(.05,i-s),l=Math.max(a+10,i+s);this.camera.perspective({near:a,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,o=this.polT-this.polar,r=this.distT-this.distance,n=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,s=this.targetT.z-this.target.z,a=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>1e-4||Math.abs(n)>a||Math.abs(i)>a||Math.abs(s)>a;return this.azimuth+=e*Me,this.polar+=o*Me,this.distance+=r*Me,this.target.x+=n*Me,this.target.y+=i*Me,this.target.z+=s*Me,l&&this.applyPosition(),l}get currentDistance(){return this.distance}syncFromCamera(){let e=this.camera.position.x-this.target.x,o=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,n=Math.hypot(e,o,r)||1,i=Math.max(St,Math.min(wt,Math.acos(Math.max(-1,Math.min(1,o/n)))));this.distance=this.distT=n,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(e,r)}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),o=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),n=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(o,r,n),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}};var je=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let o=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,o>0){let n=1/o;this.fpsEma=this.fpsEma?this.fpsEma*.9+n*.1:n}this.rendered++,this.frame(o)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}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}};var Pe=2.5,Gn=1.15,Ve=6,Ce=10,mo=6,po=9.5,ho=.9,fo=2.2,Mt=30,Pt=4,Ke=8192;var vi=Ce+Pt;function vo(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Pe};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Pe+n*(Gn-Pe)}}function bo(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function go(t,e,o,r,n){if(!(t>0)||!(e>0)||!(o>0)||!(r>0)||!(n>0))return!1;let i=Math.tan(r/2*Math.PI/180);if(!(i>0))return!1;let s=e/(o*i)*(n/2);return Math.PI*s*s/t>=64}var Hn=88,Wn=20,Ct={floor:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1}},yo="rgba(10,14,22,.62)",Un="#f4f7fb",xo=5,So=2,Yn=6,Qe=new Set(["row","seat"]),wo={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},$e={row:{x:66,y:20},seat:{x:52,y:22}},Et=qt,At=t=>jt(t);function Rt(t,e){let o=At(t),r=At(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Ft(t,e){let o=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!o)return e;let r=Math.max(0,Math.min(1,Number(o[4])));return[1,2,3].map(n=>Number(o[n])/255*r+e[n-1]*(1-r))}function Xn(t,e=[.04,.06,.1],o=!0){let r=At(e)<.42,n=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Ft(i,e):e,a=Et(t),l=o?7:4.5,u=a&&Rt(a,s)>=l?t:n;return r?{ink:u,backing:i,border:"rgba(210,222,245,.24)"}:{ink:u,backing:i,border:"rgba(11,18,32,.22)"}}function qn(t,e=[.04,.06,.1]){let o=Ft(yo,e),r=Et(t);return{ink:r&&Rt(r,o)>=4.5?t:Un,backing:yo}}var jn='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Ze=class{constructor(e,o={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=o,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=o.fontFamily||jn,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;for(let[o,r]of this.nodes)e.some(n=>n.id===o)||(r.remove(),this.nodes.delete(o))}setForcedDense(e){this.forcedDense=e}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,o=>`seat:${o}`))}qualityEvidence(){let e=this.root.getBoundingClientRect(),o=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let n=this.nodes.get(r.id),i=n?.getBoundingClientRect(),s=!!(o&&n&&n.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:s,renderedFontPx:n&&Number.parseFloat(n.style.fontSize)||0,contrast:n?Number(n.dataset.qualityContrast??0):0,...s&&i?{screenBox:{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}:{}}})}update(e,o,r,n,i,s){if(!this.labels.length)return;let a=oo(n,i,{hasZoneLabels:this.labels.some(y=>y.kind==="zone")});this.forcedDense&&(a.add("row"),a.add("seat"));let l=[];for(let y of this.labels){if(!a.has(y.kind))continue;let D=fe(e,y.anchor,o,r);if(!D.visible)continue;let P=Qe.has(y.kind),x=io(y.text,Ct[y.kind].size,!P)+(P?xo*2:0),S=no(D,x/2,Ct[y.kind].size/2+(P?So:4),o,r),T=s?Math.hypot(y.anchor[0]-s[0],y.anchor[1]-s[1],y.anchor[2]-s[2]):1;l.push({label:y,screen:S,focus:so(S,T,o,r),halfWidth:x/2,...this.selectedSeatLabelIds.has(y.id)?{priority:1}:{}})}let u=to(l.filter(y=>y.label.kind==="floor"),o),f=[...l.filter(y=>!Qe.has(y.label.kind)&&y.label.kind!=="floor"),...u],p=ro(f,Hn,Wn),v=ao(o),c=yt(l.filter(y=>y.label.kind==="row"),$e.row.x,$e.row.y,v.row,p),d=yt(l.filter(y=>y.label.kind==="seat"),$e.seat.x,$e.seat.y,v.seat,[...p,...c]),E=[...p,...c,...d],C=new Set(E.map(y=>y.label.id));for(let{label:y,screen:D}of E){let x=this.nodeFor(y).style;x.display="",x.transform=`translate(-50%, -50%) translate(${D.x.toFixed(1)}px, ${D.y.toFixed(1)}px)`}let M=E.filter(({label:y})=>!Qe.has(y.kind)).sort((y,D)=>wo[D.label.kind]-wo[y.label.kind]||y.screen.depth-D.screen.depth||y.focus-D.focus),k=[];for(let{label:y}of M){let D=this.nodes.get(y.id);if(!D||D.style.display==="none")continue;let P=D.getBoundingClientRect();k.some(S=>P.left<S.right+3&&P.right+3>S.left&&P.top<S.bottom+3&&P.bottom+3>S.top)?D.style.display="none":k.push(P)}for(let[y,D]of this.nodes)C.has(y)||(D.style.display="none")}nodeFor(e){let o=this.nodes.get(e.id);if(!o){o=document.createElement("div");let c=o.style;c.position="absolute",c.left="0",c.top="0",c.whiteSpace="nowrap",c.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",c.display="none",this.root.appendChild(o),this.nodes.set(e.id,o)}o.textContent=e.text,o.setAttribute("data-label-kind",e.kind);let r=this.selectedSeatLabelIds.has(e.id);o.toggleAttribute("data-selected-seat",r);let n=Ct[e.kind],i=o.style;i.fontSize=`${n.size}px`,i.fontWeight=r?"800":n.weight,i.opacity=r?"1":String(n.opacity);let s=Qe.has(e.kind),a=!s,l=Xn(e.color??this.opts.ink,this.opts.backgroundRgb,!0),u=s?qn(e.color??this.opts.ink,this.opts.backgroundRgb):l;i.color=r?"#ecf8ff":u.ink,i.background=r?"rgba(10,28,45,.9)":u.backing,i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${l.border}`:"",i.borderRadius=r||a?"999px":`${Yn}px`,i.padding=r||a?"3px 7px":`${So}px ${xo}px`,i.lineHeight=s?"1.1":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let f=this.opts.backgroundRgb??[.04,.06,.1],p=Et(r?"#ecf8ff":u.ink)??[1,1,1],v=Ft(r?"rgba(10,28,45,.9)":u.backing,f);return o.dataset.qualityContrast=Rt(p,v).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(i.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var Kn=1;var Qn=new Set(["floor","zone","section","ga","booth","annotation"]);function $n(t){return t.every(e=>Number.isFinite(e))}function Zn(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Mo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function ge(t){return Math.round(t*1e4)/1e4}function Jn(t){if(t)return{box:{x:ge(t.box.x),y:ge(t.box.y),width:ge(t.box.width),height:ge(t.box.height)},horizontalFillRatio:ge(t.horizontalFillRatio),verticalFillRatio:ge(t.verticalFillRatio),visibleAreaRatio:ge(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function de(t,e,o){return o.length?{code:t,message:e,count:o.length,samples:o.slice(0,20)}:null}function Dt(t){let e=t.labels.filter(a=>a.visible&&a.screenBox),o=e.filter(a=>Qn.has(a.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,n=[];for(let a=0;a<o.length;a+=1)for(let l=0;l<a;l+=1)Zn(o[a].screenBox,o[l].screenBox)&&n.push({primaryId:o[a].id,primaryLabel:o[a].text,secondaryId:o[l].id});let i=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],s=[de("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),de("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),de("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),de("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),de("camera-invalid","The capture camera must have a finite physical pose",$n(i)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),de("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),de("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||o.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),de("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",o.filter(a=>a.renderedFontPx<11).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.renderedFontPx,minimum:11}))),de("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",o.filter(a=>a.contrast<4.5).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.contrast,minimum:4.5}))),de("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",n)].filter(a=>!!a);return{version:1,state:"venue3d",passed:s.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:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:a,kind:l,text:u})=>({id:a,kind:l,text:u})).sort((a,l)=>a.kind.localeCompare(l.kind)||a.id.localeCompare(l.id)),framing:Jn(t.framing)},metrics:{minimumHierarchyFontPx:Mo(o.map(a=>a.renderedFontPx)),minimumHierarchyContrast:Mo(o.map(a=>a.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as _e,Mesh as ke,Program as br,Texture as gr,Transform as ko}from"ogl";import{Program as ye}from"ogl";var Je=`
|
|
1
|
+
import{a as me,b as Zt,c as Jt,d as Xe,e as Me,f as gt,g as yt,h as eo,i as to,j as _e,k as oo,l as xt,m as no,n as ro,o as io,p as ao,q as fe,r as so,s as lo,t as co,u as uo,v as St,w as mo,x as Ve}from"../chunk-4ABXX5PL.js";import"../chunk-PRED5KHO.js";import"../chunk-QJXSZT3H.js";import"../chunk-BS37TGPX.js";import"../chunk-4I2VWFJY.js";import"../chunk-UL5OIGIF.js";import{Wa as Kt}from"../chunk-24O23MNB.js";import{d as Qt,l as $t}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";import{Renderer as Hn}from"ogl";function Un(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,o=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,o)}var qe=class{constructor(e,o){this.clearRgb=[0,0,0];this.container=e,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 Hn({canvas:this.canvas,dpr:Un(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[Xe.top[0],Xe.top[1],Xe.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),o.onContextLost()},this.restoredHandler=()=>o.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(e){this.clearRgb=[e[0],e[1],e[2]],this.gl.clearColor(e[0],e[1],e[2],1)}get clearColor(){return this.clearRgb}resize(){let e=Math.max(1,this.container.clientWidth||this.canvas.clientWidth||1),o=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,o),{width:e,height:o}}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 e=this.gl.getExtension("WEBGL_lose_context");e&&e.loseContext(),this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}simulateContextLossCycle(){let e=this.gl.getExtension("WEBGL_lose_context");e&&(e.loseContext(),setTimeout(()=>{e.restoreContext&&e.restoreContext()},300))}};import{Camera as Wn,Vec3 as wt}from"ogl";var ie=Math.PI/180,Mt=15*ie,Pt=80*ie,Pe=.12,po=35,ho=1.25,fo=.006,Yn=4,Ce=.82,Le=1/Ce,Xn=.12,qn=2;function jn(t,e){return{azimuth:t*fo,polar:-e*fo}}function Kn(t,e,o){let r=Math.max(qn,Math.max(1,e)*Xn),n=o*Yn;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,n):n}}var je=class{constructor(e,o,r,n){this.fovY=po;this.target=new wt;this.azimuth=-30*ie;this.polar=55*ie;this.distance=10;this.azT=-30*ie;this.polT=55*ie;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 wt;this.panAnchor=new wt;this.panLimit=0;this.primaryDragMode="orbit";this.camera=new Wn(e,{fov:po,near:.1,far:5e3,aspect:1}),this.canvas=o,this.requestRender=r,this.onGesture=n,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 s=i.button===2||i.button===1,a=i.button===0&&(i.shiftKey?this.primaryDragMode==="orbit":this.primaryDragMode==="pan");this.panning=s||a,this.dragging=!this.panning,this.lastX=i.clientX,this.lastY=i.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance();let s=this.pinchCentroid();this.pinchCx=s.x,this.pinchCy=s.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 d=this.currentPinchDistance();this.pinchDist>0&&(this.dollyBy(Math.exp((this.pinchDist-d)*.005)),this.fireGesture()),this.pinchDist=d;let p=this.pinchCentroid();this.panBy(p.x-this.pinchCx,p.y-this.pinchCy),this.pinchCx=p.x,this.pinchCy=p.y;return}let s=i.clientX-this.lastX,a=i.clientY-this.lastY;if(this.panning){this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&(this.panBy(s,a),this.fireGesture());return}if(!this.dragging)return;this.lastX=i.clientX,this.lastY=i.clientY,(s!==0||a!==0)&&this.fireGesture();let l=jn(s,a);this.azT+=l.azimuth,this.polT=Math.max(Mt,Math.min(Pt,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.onContextMenu=i=>{i.preventDefault()},this.onWheel=i=>{if(i.preventDefault(),!this.interactionEnabled)return;let s=i.deltaMode===1?16:i.deltaMode===2?100:1,a=Math.max(-2,Math.min(2,i.deltaY*s/100));this.dollyBy(Math.exp(a*.22)),this.fireGesture()},this.onKeyDown=i=>{if(!this.interactionEnabled)return;let s=7*ie;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"?-s:s;else if(i.key==="ArrowUp"||i.key==="ArrowDown")this.polT=Math.max(Mt,Math.min(Pt,this.polT+(i.key==="ArrowUp"?-s:s)));else if(i.key==="+"||i.key==="=")this.dollyBy(Ce);else if(i.key==="-"||i.key==="_")this.dollyBy(Le);else return;i.preventDefault(),this.fireGesture(),this.requestRender()},o.addEventListener("pointerdown",this.onPointerDown),o.addEventListener("pointermove",this.onPointerMove),o.addEventListener("pointerup",this.onPointerUp),o.addEventListener("pointercancel",this.onPointerUp),o.addEventListener("wheel",this.onWheel,{passive:!1}),o.addEventListener("keydown",this.onKeyDown),o.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let o=0,r=0;for(let n of e)o+=n.x,r+=n.y;return{x:o/e.length,y:r/e.length}}panBy(e,o){let r=this.canvas.clientHeight||1,n=2*this.distance*Math.tan(this.fovY*ie/2)/r,i=Math.sin(this.azimuth),s=Math.cos(this.azimuth),a=s,l=-i,d=Math.cos(this.polar),p=Math.sin(this.polar),h=-i*d,b=-s*d;this.targetT.x+=(-e*a+o*h)*n,this.targetT.z+=(-e*l+o*b)*n,this.targetT.y+=o*p*n,this.clampPan(),this.requestRender()}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,o=this.panAnchor.x,r=this.panAnchor.y,n=this.panAnchor.z;this.targetT.x=Math.max(o-e,Math.min(o+e,this.targetT.x)),this.targetT.z=Math.max(n-e,Math.min(n+e,this.targetT.z)),this.targetT.y=Math.max(r-e*.5,Math.min(r+e,this.targetT.y))}fireGesture(){this.gestureFired||(this.gestureFired=!0,this.onGesture?.())}currentPinchDistance(){let e=[...this.activePointers.values()];return e.length<2?0:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)}dollyBy(e){this.distT=Math.max(this.minDist,Math.min(this.maxDist,this.distT*e)),this.requestRender()}zoomBy(e){this.interactionEnabled&&(this.dollyBy(e),this.fireGesture())}dollyLimitState(){return{atMin:this.distT<=this.minDist+1e-6,atMax:this.distT>=this.maxDist-1e-6}}setPrimaryDragMode(e){this.primaryDragMode=e}setInteractionEnabled(e){this.interactionEnabled=e,!e&&(this.activePointers.clear(),this.dragging=!1,this.panning=!1,this.pinchDist=0)}frame(e,o=!1,r,n=!1,i){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5;let s=Math.max(1,e.radius),a=this.fovY*ie/2,l=n?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,d=Math.atan(Math.tan(a)*l);this.azT=r??-30*ie,this.polT=Math.max(15,Math.min(80,i?.polarDeg??55))*ie;let p=this.fitDistance(e,a,d,this.azT,this.polT);this.distT=p*Math.max(1.05,Math.min(2,i?.margin??ho)),this.envelope=Kn(this.envelope,s,p),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,o?(this.azimuth=this.azT,this.polar=12*ie,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){this.camera.perspective({aspect:e})}frameSoft(e,o,r=!1,n){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.panAnchor.copy(this.target),this.panLimit=Math.max(1,e.radius)*1.5,this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let i=this.fovY*ie/2,s=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,a=Math.atan(Math.tan(i)*s);this.azT=o??this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ie;let l=this.fitDistance(e,i,a,this.azT,this.polT);this.distT=l*Math.max(1.05,Math.min(2,n?.margin??ho))}fitDistance(e,o,r,n,i){let s=Math.max(1,e.radius),a=Math.max(s/Math.tan(o),s/Math.tan(r)),l=e.box;if(!l)return a;let d=Math.sin(i),p=-d*Math.sin(n),h=-Math.cos(i),b=-d*Math.cos(n);if(Math.abs(h)>.999)return a;let c=-b,u=p,P=Math.hypot(c,u);c/=P,u/=P;let D=-u*h,A=u*p-c*b,k=c*h,f=Math.tan(r),M=Math.tan(o),C=1;for(let O=0;O<8;O++){let x=(O&1?l.max[0]:l.min[0])-e.center[0],w=(O&2?l.max[1]:l.min[1])-e.center[1],T=(O&4?l.max[2]:l.min[2])-e.center[2],L=x*p+w*h+T*b,R=Math.abs(x*c+T*u),K=Math.abs(x*D+w*A+T*k);C=Math.max(C,R/f-L,K/M-L)}return Math.min(a,Math.max(C,s*.35))}updateClipping(e){let o=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],n=this.camera.position.z-e.center[2],i=Math.hypot(o,r,n),s=Math.max(1,e.radius)*1.18,a=Math.max(.05,i-s),l=Math.max(a+10,i+s);this.camera.perspective({near:a,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,o=this.polT-this.polar,r=this.distT-this.distance,n=this.targetT.x-this.target.x,i=this.targetT.y-this.target.y,s=this.targetT.z-this.target.z,a=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(o)>1e-4||Math.abs(r)>1e-4||Math.abs(n)>a||Math.abs(i)>a||Math.abs(s)>a;return this.azimuth+=e*Pe,this.polar+=o*Pe,this.distance+=r*Pe,this.target.x+=n*Pe,this.target.y+=i*Pe,this.target.z+=s*Pe,l&&this.applyPosition(),l}get currentDistance(){return this.distance}syncFromCamera(){let e=this.camera.position.x-this.target.x,o=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,n=Math.hypot(e,o,r)||1,i=Math.max(Mt,Math.min(Pt,Math.acos(Math.max(-1,Math.min(1,o/n)))));this.distance=this.distT=n,this.polar=this.polT=i,this.azimuth=this.azT=Math.atan2(e,r)}setTarget(e){this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target)}resumeAfterFlight(e){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),e&&this.target.set(e[0],e[1],e[2]),this.targetT.copy(this.target),this.syncFromCamera()}applyPosition(){let e=Math.sin(this.polar),o=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),n=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(o,r,n),this.camera.lookAt(this.target)}dispose(){this.canvas.removeEventListener("pointerdown",this.onPointerDown),this.canvas.removeEventListener("pointermove",this.onPointerMove),this.canvas.removeEventListener("pointerup",this.onPointerUp),this.canvas.removeEventListener("pointercancel",this.onPointerUp),this.canvas.removeEventListener("wheel",this.onWheel),this.canvas.removeEventListener("keydown",this.onKeyDown),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.activePointers.clear()}};var Ke=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let o=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,o>0){let n=1/o;this.fpsEma=this.fpsEma?this.fpsEma*.9+n*.1:n}this.rendered++,this.frame(o)?this.rafId=requestAnimationFrame(this.tick):(this.running=!1,this.rafId=0)};this.frame=e}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}};var Ae=2.5,Qn=1.15,ke=6,Ee=10,vo=6,bo=9.5,go=.9,yo=2.2,Ct=30,At=4,Qe=8192;var Ai=Ee+At;function xo(t,e){let o=e*1.4,r=e*3.2;if(t<=o)return{scale:1,fade:0,minPixels:Ae};let n=Math.min(1,(t-o)/Math.max(.001,r-o));return{scale:1-n*.4,fade:n*.55,minPixels:Ae+n*(Qn-Ae)}}function So(t,e,o){return!(t>0)||!(e>0)||!(o>0)?!1:e*o/t>=64}function wo(t,e,o,r,n){if(!(t>0)||!(e>0)||!(o>0)||!(r>0)||!(n>0))return!1;let i=Math.tan(r/2*Math.PI/180);if(!(i>0))return!1;let s=e/(o*i)*(n/2);return Math.PI*s*s/t>=64}var $n=88,Zn=20,Et={floor:{size:14,weight:"700",opacity:.98},zone:{size:15,weight:"600",opacity:.95},section:{size:12,weight:"500",opacity:.88},ga:{size:12,weight:"500",opacity:.88},booth:{size:11,weight:"500",opacity:.85},annotation:{size:11,weight:"400",opacity:.75},row:{size:11.5,weight:"700",opacity:.94},seat:{size:12.5,weight:"800",opacity:1}},Mo="rgba(10,14,22,.62)",Jn="#f4f7fb",Po=5,Co=2,er=6,$e=new Set(["row","seat"]),Ao={floor:5,zone:4,section:3,ga:3,booth:2,annotation:1},Ze={row:{x:66,y:20},seat:{x:52,y:22}},Dt=Qt,Rt=t=>$t(t);function Ft(t,e){let o=Rt(t),r=Rt(e);return(Math.max(o,r)+.05)/(Math.min(o,r)+.05)}function Tt(t,e){let o=/rgba\((\d+),(\d+),(\d+),([\d.]+)\)/.exec(t.replace(/\s/g,""));if(!o)return e;let r=Math.max(0,Math.min(1,Number(o[4])));return[1,2,3].map(n=>Number(o[n])/255*r+e[n-1]*(1-r))}function tr(t,e=[.04,.06,.1],o=!0){let r=Rt(e)<.42,n=r?"#f4f7fb":"#0b1220",i=r?"rgba(8,12,22,.78)":"rgba(255,255,255,.84)",s=o?Tt(i,e):e,a=Dt(t),l=o?7:4.5,d=a&&Ft(a,s)>=l?t:n;return r?{ink:d,backing:i,border:"rgba(210,222,245,.24)"}:{ink:d,backing:i,border:"rgba(11,18,32,.22)"}}function or(t,e=[.04,.06,.1]){let o=Tt(Mo,e),r=Dt(t);return{ink:r&&Ft(r,o)>=4.5?t:Jn,backing:Mo}}var nr='ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif',Je=class{constructor(e,o={}){this.nodes=new Map;this.labels=[];this.forcedDense=!1;this.selectedSeatLabelIds=new Set;this.opts=o,this.root=document.createElement("div"),this.root.setAttribute("data-view3d-labels","");let r=this.root.style;r.position="absolute",r.inset="0",r.pointerEvents="none",r.overflow="hidden",r.fontFamily=o.fontFamily||nr,e.appendChild(this.root)}setVisible(e){this.root.style.visibility=e?"":"hidden"}setLabels(e){this.labels=e;for(let[o,r]of this.nodes)e.some(n=>n.id===o)||(r.remove(),this.nodes.delete(o))}setForcedDense(e){this.forcedDense=e}setSelectedSeatIds(e){this.selectedSeatLabelIds=new Set(Array.from(e,o=>`seat:${o}`))}qualityEvidence(){let e=this.root.getBoundingClientRect(),o=this.root.style.visibility!=="hidden";return this.labels.map(r=>{let n=this.nodes.get(r.id),i=n?.getBoundingClientRect(),s=!!(o&&n&&n.style.display!=="none"&&i&&i.width>0&&i.height>0);return{id:r.id,kind:r.kind,text:r.text,visible:s,renderedFontPx:n&&Number.parseFloat(n.style.fontSize)||0,contrast:n?Number(n.dataset.qualityContrast??0):0,...s&&i?{screenBox:{x:i.x-e.x,y:i.y-e.y,width:i.width,height:i.height}}:{}}})}update(e,o,r,n,i,s){if(!this.labels.length)return;let a=io(n,i,{hasZoneLabels:this.labels.some(f=>f.kind==="zone")});this.forcedDense&&(a.add("row"),a.add("seat"));let l=[];for(let f of this.labels){if(!a.has(f.kind))continue;let M=fe(e,f.anchor,o,r);if(!M.visible)continue;let C=$e.has(f.kind),O=lo(f.text,Et[f.kind].size,!C)+(C?Po*2:0),x=ao(M,O/2,Et[f.kind].size/2+(C?Co:4),o,r),w=s?Math.hypot(f.anchor[0]-s[0],f.anchor[1]-s[1],f.anchor[2]-s[2]):1;l.push({label:f,screen:x,focus:uo(x,w,o,r),halfWidth:O/2,...this.selectedSeatLabelIds.has(f.id)?{priority:1}:{}})}let d=ro(l.filter(f=>f.label.kind==="floor"),o),p=[...l.filter(f=>!$e.has(f.label.kind)&&f.label.kind!=="floor"),...d],h=so(p,$n,Zn),b=co(o),c=St(l.filter(f=>f.label.kind==="row"),Ze.row.x,Ze.row.y,b.row,h),u=St(l.filter(f=>f.label.kind==="seat"),Ze.seat.x,Ze.seat.y,b.seat,[...h,...c]),P=[...h,...c,...u],D=new Set(P.map(f=>f.label.id));for(let{label:f,screen:M}of P){let O=this.nodeFor(f).style;O.display="",O.transform=`translate(-50%, -50%) translate(${M.x.toFixed(1)}px, ${M.y.toFixed(1)}px)`}let A=P.filter(({label:f})=>!$e.has(f.kind)).sort((f,M)=>Ao[M.label.kind]-Ao[f.label.kind]||f.screen.depth-M.screen.depth||f.focus-M.focus),k=[];for(let{label:f}of A){let M=this.nodes.get(f.id);if(!M||M.style.display==="none")continue;let C=M.getBoundingClientRect();k.some(x=>C.left<x.right+3&&C.right+3>x.left&&C.top<x.bottom+3&&C.bottom+3>x.top)?M.style.display="none":k.push(C)}for(let[f,M]of this.nodes)D.has(f)||(M.style.display="none")}nodeFor(e){let o=this.nodes.get(e.id);if(!o){o=document.createElement("div");let c=o.style;c.position="absolute",c.left="0",c.top="0",c.whiteSpace="nowrap",c.textShadow="0 1px 3px rgba(0,0,0,0.85), 0 0 8px rgba(0,0,0,0.55)",c.display="none",this.root.appendChild(o),this.nodes.set(e.id,o)}o.textContent=e.text,o.setAttribute("data-label-kind",e.kind);let r=this.selectedSeatLabelIds.has(e.id);o.toggleAttribute("data-selected-seat",r);let n=Et[e.kind],i=o.style;i.fontSize=`${n.size}px`,i.fontWeight=r?"800":n.weight,i.opacity=r?"1":String(n.opacity);let s=$e.has(e.kind),a=!s,l=tr(e.color??this.opts.ink,this.opts.backgroundRgb,!0),d=s?or(e.color??this.opts.ink,this.opts.backgroundRgb):l;i.color=r?"#ecf8ff":d.ink,i.background=r?"rgba(10,28,45,.9)":d.backing,i.border=r?"1px solid rgba(89,199,255,.92)":a?`1px solid ${l.border}`:"",i.borderRadius=r||a?"999px":`${er}px`,i.padding=r||a?"3px 7px":`${Co}px ${Po}px`,i.lineHeight=s?"1.1":"",i.boxShadow=r?"0 0 0 2px rgba(41,176,255,.18), 0 5px 14px rgba(0,0,0,.35)":a?"0 3px 10px rgba(0,0,0,.24)":"0 1px 4px rgba(0,0,0,.28)",i.letterSpacing=e.kind==="zone"||e.kind==="floor"?"0.08em":"0.02em";let p=this.opts.backgroundRgb??[.04,.06,.1],h=Dt(r?"#ecf8ff":d.ink)??[1,1,1],b=Tt(r?"rgba(10,28,45,.9)":d.backing,p);return o.dataset.qualityContrast=Ft(h,b).toFixed(3),(e.kind==="zone"||e.kind==="floor")&&(i.textTransform="uppercase"),o}dispose(){this.root.remove(),this.nodes.clear()}};var rr=1;var ir=new Set(["floor","zone","section","ga","booth","annotation"]);function ar(t){return t.every(e=>Number.isFinite(e))}function sr(t,e){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Eo(t){return t.length?Math.round(Math.min(...t)*100)/100:null}function xe(t){return Math.round(t*1e4)/1e4}function lr(t){if(t)return{box:{x:xe(t.box.x),y:xe(t.box.y),width:xe(t.box.width),height:xe(t.box.height)},horizontalFillRatio:xe(t.horizontalFillRatio),verticalFillRatio:xe(t.verticalFillRatio),visibleAreaRatio:xe(t.visibleAreaRatio),clippedEdges:[...t.clippedEdges]}}function de(t,e,o){return o.length?{code:t,message:e,count:o.length,samples:o.slice(0,20)}:null}function It(t){let e=t.labels.filter(a=>a.visible&&a.screenBox),o=e.filter(a=>ir.has(a.kind)),r=t.scene.floorCount>1?t.scene.floorCount:t.scene.zoneCount||t.scene.sectionCount,n=[];for(let a=0;a<o.length;a+=1)for(let l=0;l<a;l+=1)sr(o[a].screenBox,o[l].screenBox)&&n.push({primaryId:o[a].id,primaryLabel:o[a].text,secondaryId:o[l].id});let i=[...t.camera.position,t.camera.distance,t.camera.verticalFovDeg],s=[de("webgl2-unavailable","The venue scene must render through WebGL2",t.context.webgl2?[]:[{primaryId:"renderer",primaryLabel:"WebGL2"}]),de("context-lost","The WebGL context must be live at capture",t.context.lost?[{primaryId:"renderer",primaryLabel:"context lost"}]:[]),de("frame-not-stable","The captured 3D frame must be rendered and parked",t.frame.rendered>0&&t.frame.idle?[]:[{primaryId:"renderer",primaryLabel:"unstable frame"}]),de("viewport-empty","The 3D viewport must have visible dimensions",t.viewport.width>1&&t.viewport.height>1?[]:[{primaryId:"viewport",primaryLabel:`${t.viewport.width}\xD7${t.viewport.height}`}]),de("camera-invalid","The capture camera must have a finite physical pose",ar(i)&&t.camera.distance>0&&t.camera.verticalFovDeg>0&&t.camera.verticalFovDeg<180?[]:[{primaryId:"camera",primaryLabel:"invalid pose"}]),de("authored-relief-not-visible","Authored 3D height or rake must produce visible screen-space relief",!t.scene.authoredRelief||t.scene.renderedVerticalSpanM>.05&&t.scene.projectedReliefPx>=2?[]:[{primaryId:"scene",primaryLabel:"authored relief",measured:t.scene.projectedReliefPx,minimum:2}]),de("hierarchy-label-missing","A venue with authored hierarchy must show at least one structural label",r===0||o.length>0?[]:[{primaryId:"labels",primaryLabel:`${r} expected hierarchy labels`}]),de("hierarchy-label-undersized","Visible 3D hierarchy labels must remain readable",o.filter(a=>a.renderedFontPx<11).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.renderedFontPx,minimum:11}))),de("hierarchy-label-contrast-low","Visible 3D hierarchy labels must meet text contrast",o.filter(a=>a.contrast<4.5).map(a=>({primaryId:a.id,primaryLabel:a.text,measured:a.contrast,minimum:4.5}))),de("hierarchy-label-collision","Visible 3D hierarchy labels must not overlap",n)].filter(a=>!!a);return{version:1,state:"venue3d",passed:s.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:t.viewport,context:t.context,frame:t.frame,camera:t.camera,scene:t.scene,composition:{visibleLabels:e.map(({id:a,kind:l,text:d})=>({id:a,kind:l,text:d})).sort((a,l)=>a.kind.localeCompare(l.kind)||a.id.localeCompare(l.id)),framing:lr(t.framing)},metrics:{minimumHierarchyFontPx:Eo(o.map(a=>a.renderedFontPx)),minimumHierarchyContrast:Eo(o.map(a=>a.contrast)),projectedReliefPx:Math.round(t.scene.projectedReliefPx*100)/100},findings:s}}import{Geometry as Oe,Mesh as ze,Program as Ar,Texture as Er,Transform as No}from"ogl";import{Program as Se}from"ogl";var et=`
|
|
2
2
|
float chairWeight(float depth) {
|
|
3
3
|
return 1.0 - smoothstep(uChairFull, uChairNone, depth);
|
|
4
|
-
}`,
|
|
4
|
+
}`,Ro=`
|
|
5
5
|
float occupantWeight(float depth) {
|
|
6
|
-
float nearWeight = smoothstep(${
|
|
7
|
-
float farWeight = 1.0 - smoothstep(${
|
|
6
|
+
float nearWeight = smoothstep(${go.toFixed(1)}, ${yo.toFixed(1)}, depth);
|
|
7
|
+
float farWeight = 1.0 - smoothstep(${vo.toFixed(1)}, ${bo.toFixed(1)}, depth);
|
|
8
8
|
return nearWeight * farWeight;
|
|
9
|
-
}`,
|
|
9
|
+
}`,Do=`
|
|
10
10
|
float glyphEq(float glyph, float expected) {
|
|
11
11
|
return 1.0 - step(0.25, abs(glyph - expected));
|
|
12
12
|
}
|
|
@@ -55,7 +55,7 @@ vec3 glyphChairPosition(vec3 p, float partId, float glyph) {
|
|
|
55
55
|
p.y += 0.16;
|
|
56
56
|
}
|
|
57
57
|
return p;
|
|
58
|
-
}`,
|
|
58
|
+
}`,cr=`#version 300 es
|
|
59
59
|
precision highp float;
|
|
60
60
|
in vec3 position;
|
|
61
61
|
in vec3 normal;
|
|
@@ -93,7 +93,7 @@ void main() {
|
|
|
93
93
|
vNormalWorld = normalize(mat3(modelMatrix) * normal);
|
|
94
94
|
vColor = color;
|
|
95
95
|
gl_Position = projectionMatrix * mv;
|
|
96
|
-
}`,
|
|
96
|
+
}`,ur=`#version 300 es
|
|
97
97
|
precision highp float;
|
|
98
98
|
in vec3 vColor;
|
|
99
99
|
in vec3 vNormalWorld;
|
|
@@ -166,7 +166,7 @@ void main() {
|
|
|
166
166
|
+ vec3(0.20, 0.10, 0.34) * focalHalo;
|
|
167
167
|
base = mix(base, display, poweredDisplay * verticalFace * 0.92);
|
|
168
168
|
fragColor = vec4(base, 1.0);
|
|
169
|
-
}`,
|
|
169
|
+
}`,dr=`#version 300 es
|
|
170
170
|
precision highp float;
|
|
171
171
|
in vec2 position; // quad corner in [-1,1]
|
|
172
172
|
in vec3 iOffset; // per-instance world position
|
|
@@ -192,7 +192,7 @@ out float vDim;
|
|
|
192
192
|
out float vDotWeight; // 1 = the dot IS this seat, 0 = the chair has taken over
|
|
193
193
|
out float vPhysicalSeat;
|
|
194
194
|
out float vPixelRadius;
|
|
195
|
-
${
|
|
195
|
+
${et}
|
|
196
196
|
void main() {
|
|
197
197
|
vec4 mv = modelViewMatrix * vec4(iOffset, 1.0);
|
|
198
198
|
float depth = max(-mv.z, 0.001);
|
|
@@ -225,7 +225,7 @@ void main() {
|
|
|
225
225
|
vPhysicalSeat = iPhysicalSeat;
|
|
226
226
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
227
227
|
gl_Position = projectionMatrix * mv;
|
|
228
|
-
}`,
|
|
228
|
+
}`,mr=`#version 300 es
|
|
229
229
|
precision highp float;
|
|
230
230
|
in vec2 vUv;
|
|
231
231
|
in vec3 vColor;
|
|
@@ -284,7 +284,7 @@ void main() {
|
|
|
284
284
|
alpha *= vDotWeight;
|
|
285
285
|
if (alpha <= 0.0) discard;
|
|
286
286
|
fragColor = vec4(c, alpha);
|
|
287
|
-
}`,
|
|
287
|
+
}`,pr=`#version 300 es
|
|
288
288
|
precision highp float;
|
|
289
289
|
in vec3 position; // local: x/z in units of the seat radius, y in METRES
|
|
290
290
|
in vec3 normal;
|
|
@@ -315,9 +315,9 @@ out vec3 vRing;
|
|
|
315
315
|
out float vDim;
|
|
316
316
|
out float vOccupant; // 1 = this vertex belongs to a person, not to the chair
|
|
317
317
|
out vec3 vOccupantTint;
|
|
318
|
-
${
|
|
319
|
-
${
|
|
320
|
-
${
|
|
318
|
+
${et}
|
|
319
|
+
${Ro}
|
|
320
|
+
${Do}
|
|
321
321
|
void main() {
|
|
322
322
|
vec4 anchor = modelViewMatrix * vec4(iOffset, 1.0);
|
|
323
323
|
float viewDepth = -anchor.z;
|
|
@@ -403,7 +403,7 @@ void main() {
|
|
|
403
403
|
vRing = iRing;
|
|
404
404
|
vDim = (uFocusFloor < -0.5 || abs(iFloor - uFocusFloor) < 0.5) ? 0.0 : 1.0;
|
|
405
405
|
gl_Position = projectionMatrix * mv;
|
|
406
|
-
}`,
|
|
406
|
+
}`,hr=`#version 300 es
|
|
407
407
|
precision highp float;
|
|
408
408
|
in vec3 vColor;
|
|
409
409
|
in vec3 vNormalWorld;
|
|
@@ -460,14 +460,14 @@ void main() {
|
|
|
460
460
|
float sheen = clamp((1.0 - uRoughness) / 0.22, 0.15, 2.0);
|
|
461
461
|
base += vec3(0.26, 0.31, 0.38) * fres * 0.55 * mix(sheen, 1.0, vOccupant);
|
|
462
462
|
fragColor = vec4(base, 1.0);
|
|
463
|
-
}`,
|
|
463
|
+
}`,fr=`#version 300 es
|
|
464
464
|
precision highp float;
|
|
465
465
|
in vec2 position;
|
|
466
466
|
out vec2 vUv;
|
|
467
467
|
void main() {
|
|
468
468
|
vUv = position * 0.5 + 0.5;
|
|
469
469
|
gl_Position = vec4(position, 0.999, 1.0);
|
|
470
|
-
}`,
|
|
470
|
+
}`,vr=`#version 300 es
|
|
471
471
|
precision highp float;
|
|
472
472
|
in vec2 vUv;
|
|
473
473
|
uniform vec3 uTop;
|
|
@@ -478,7 +478,7 @@ void main() {
|
|
|
478
478
|
vec2 c = vUv - 0.5;
|
|
479
479
|
float vig = 1.0 - dot(c, c) * 0.85; // soft vignette
|
|
480
480
|
fragColor = vec4(col * vig, 1.0);
|
|
481
|
-
}`,
|
|
481
|
+
}`,br=`#version 300 es
|
|
482
482
|
precision highp float;
|
|
483
483
|
in vec2 position;
|
|
484
484
|
in vec3 iOffset;
|
|
@@ -499,7 +499,7 @@ out float vPhysicalSeat;
|
|
|
499
499
|
out float vDotWeight;
|
|
500
500
|
out float vHidden;
|
|
501
501
|
flat out vec3 vPick;
|
|
502
|
-
${
|
|
502
|
+
${et}
|
|
503
503
|
void main() {
|
|
504
504
|
int id = gl_InstanceID + 1; // 0 reserved for no-hit
|
|
505
505
|
vPick = vec3(float(id & 255), float((id >> 8) & 255), float((id >> 16) & 255)) / 255.0;
|
|
@@ -515,7 +515,7 @@ void main() {
|
|
|
515
515
|
vPhysicalSeat = iPhysicalSeat;
|
|
516
516
|
vHidden = (uFocusFloor > -0.5 && abs(iFloor - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
517
517
|
gl_Position = projectionMatrix * mv;
|
|
518
|
-
}`,
|
|
518
|
+
}`,gr=`#version 300 es
|
|
519
519
|
precision highp float;
|
|
520
520
|
in vec2 vUv;
|
|
521
521
|
in float vPhysicalSeat;
|
|
@@ -529,7 +529,7 @@ void main() {
|
|
|
529
529
|
float d = mix(max(abs(vUv.x), abs(vUv.y)), length(vUv), vPhysicalSeat);
|
|
530
530
|
if (d > 1.0) discard; // hit-mask matches chair/bay shape
|
|
531
531
|
fragColor = vec4(vPick, 1.0);
|
|
532
|
-
}`,
|
|
532
|
+
}`,yr=`#version 300 es
|
|
533
533
|
precision highp float;
|
|
534
534
|
in vec3 position;
|
|
535
535
|
in float part;
|
|
@@ -550,9 +550,9 @@ uniform float uBackBase;
|
|
|
550
550
|
uniform float uFocusFloor;
|
|
551
551
|
flat out vec3 vPick;
|
|
552
552
|
out float vHidden;
|
|
553
|
-
${
|
|
554
|
-
${
|
|
555
|
-
${
|
|
553
|
+
${et}
|
|
554
|
+
${Ro}
|
|
555
|
+
${Do}
|
|
556
556
|
void main() {
|
|
557
557
|
int id = int(iPickIndex + 0.5); // already global index + 1
|
|
558
558
|
vPick = vec3(float(id & 255), float((id >> 8) & 255), float((id >> 16) & 255)) / 255.0;
|
|
@@ -585,7 +585,7 @@ void main() {
|
|
|
585
585
|
float c = cos(iYaw), s = sin(iYaw);
|
|
586
586
|
vec3 rp = vec3(p.x * c + p.z * s, p.y, -p.x * s + p.z * c);
|
|
587
587
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(iOffset + rp, 1.0);
|
|
588
|
-
}`,
|
|
588
|
+
}`,xr=`#version 300 es
|
|
589
589
|
precision highp float;
|
|
590
590
|
flat in vec3 vPick;
|
|
591
591
|
in float vHidden;
|
|
@@ -593,7 +593,7 @@ out vec4 fragColor;
|
|
|
593
593
|
void main() {
|
|
594
594
|
if (vHidden > 0.5) discard;
|
|
595
595
|
fragColor = vec4(vPick, 1.0);
|
|
596
|
-
}`,
|
|
596
|
+
}`,Sr=`#version 300 es
|
|
597
597
|
precision highp float;
|
|
598
598
|
in vec3 position;
|
|
599
599
|
in float floorIndex;
|
|
@@ -604,14 +604,14 @@ out float vHidden;
|
|
|
604
604
|
void main() {
|
|
605
605
|
vHidden = (uFocusFloor > -0.5 && abs(floorIndex - uFocusFloor) > 0.5) ? 1.0 : 0.0;
|
|
606
606
|
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
607
|
-
}`,
|
|
607
|
+
}`,wr=`#version 300 es
|
|
608
608
|
precision highp float;
|
|
609
609
|
in float vHidden;
|
|
610
610
|
out vec4 fragColor;
|
|
611
611
|
void main() {
|
|
612
612
|
if (vHidden > 0.5) discard;
|
|
613
613
|
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
614
|
-
}`;function
|
|
614
|
+
}`;function Fo(t){return new Se(t,{vertex:br,fragment:gr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uSeatRadius:{value:_e},uSeatScale:{value:1},uMinPixels:{value:Ae},uPixelToWorld:{value:.002},uChairFull:{value:ke},uChairNone:{value:Ee},uFocusFloor:{value:-1}}})}function To(t){return new Se(t,{vertex:yr,fragment:xr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uChairFull:{value:ke},uChairNone:{value:Ee},uBackRake:{value:gt},uBackBase:{value:yt},uFocusFloor:{value:-1}}})}function Io(t){return new Se(t,{vertex:Sr,fragment:wr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uFocusFloor:{value:-1}}})}function _o(t,e=.78){return new Se(t,{vertex:cr,fragment:ur,cullFace:!1,depthTest:!0,depthWrite:!0,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFocusFloor:{value:-1},uStructureDetail:{value:0},uRoughness:{value:e}}})}function Vo(t){return new Se(t,{vertex:dr,fragment:mr,transparent:!0,depthTest:!0,depthWrite:!1,cullFace:!1,uniforms:{uSeatRadius:{value:_e},uSeatScale:{value:1},uMinPixels:{value:Ae},uPixelToWorld:{value:.002},uSeatFade:{value:0},uSeatDetail:{value:0},uFocusFloor:{value:-1},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ke},uChairNone:{value:Ee}}})}function Lo(t,e=.78){return new Se(t,{vertex:pr,fragment:hr,transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1,uniforms:{uKeyDir:{value:new Float32Array([.38,.86,.34])},uFadeColor:{value:new Float32Array([.32,.37,.43])},uChairFull:{value:ke},uChairNone:{value:Ee},uBackRake:{value:gt},uBackBase:{value:yt},uFocusFloor:{value:-1},uRoughness:{value:e}}})}function ko(t,e,o){return new Se(t,{vertex:fr,fragment:vr,depthTest:!1,depthWrite:!1,cullFace:!1,uniforms:{uTop:{value:new Float32Array(e)},uBottom:{value:new Float32Array(o)}}})}var Mr=.65,Pr=new Set(["dimmed","sold"]),Cr=new Set(["dimmed","sold","held"]);function Oo(t,e,o){let r=new Set,n=!1,i=me.indexOf("dimmed"),s=!1;for(let l=0;l<o.length;l+=1)if(o[l]===i){s=!0;break}let a=s?Cr:Pr;for(let l of t){let d=e.get(l.sectionId);if(!d||!d.length){r.add(l.sectionId);continue}let p=!1;for(let h of d){let b=me[o[h]]??"available";if(!a.has(b)){p=!0;break}}p?r.add(l.sectionId):n=!0}return{lit:r,anyUnlit:n}}function zo(t,e,o,r,n,i){let s=[];for(let a of t){let l=n===null||n.has(a.sectionId);if(r.get(a.sectionId)===l)continue;r.set(a.sectionId,l);let d=(a.start+a.count)*3;for(let p=a.start*3;p<d;p++)e[p]=l?o[p]:o[p]+(i[p%3]-o[p])*Mr;s.push(a)}return s}function Bo(t,e,o,r,n,i){for(let s=o;s<o+r;s++){let l=i&&e[s]===0?null:n[e[s]]??n[0];t[s*3]=l?l[0]:i[s*3],t[s*3+1]=l?l[1]:i[s*3+1],t[s*3+2]=l?l[2]:i[s*3+2]}}var Rr=new Float32Array([-1,-1,1,-1,1,1,-1,-1,1,1,-1,1]),Dr=new Float32Array([-1,-1,3,-1,-1,3]);function Go(t,e){let o=new No,r=new No,n=new Oe(t,{position:{size:2,data:Dr}}),i=ko(t,e.theme.background.top,e.theme.background.bottom),s=new ze(t,{geometry:n,program:i});s.frustumCulled=!1,s.setParent(r);let a=new Oe(t,{position:{size:3,data:e.solids.position},normal:{size:3,data:e.solids.normal},color:{size:3,data:e.solids.color},floorIndex:{size:1,data:e.solids.floor},materialIndex:{size:1,data:e.solids.material}}),l=_o(t,e.theme.materials.roughness),d=new ze(t,{geometry:a,program:l});d.frustumCulled=!1,d.setParent(o);let p=Vo(t),h=new Float32Array(e.seats.count*3),b=me.map(I=>e.theme.seatStates[I]);Bo(h,e.seats.iState,0,e.seats.count,b,e.seats.iCategory);let c=new Oe(t,{position:{size:2,data:Rr},iOffset:{size:3,data:e.seats.iPosition,instanced:1},iColor:{size:3,data:h,instanced:1},iMaxRadius:{size:1,data:e.seats.iMaxRadius,instanced:1},iPhysicalSeat:{size:1,data:e.seats.iPhysicalSeat,instanced:1},iRing:{size:3,data:e.seats.iRing,instanced:1},iFloor:{size:1,data:e.seats.iFloor,instanced:1}}),u=new ze(t,{geometry:c,program:p});u.frustumCulled=!1,e.seats.count>0&&u.setParent(o);let P=c.attributes.iColor,D=e.solids.color.slice(),A=e.theme.structure.ground,k=new Map(e.sectionSolidRanges.map(I=>[I.sectionId,!0])),f=to(),M=Lo(t,e.theme.materials.roughness),C=Qe,O=new Float32Array(C*3),x=new Float32Array(C*3),w=new Float32Array(C),T=new Float32Array(C),L=new Float32Array(C),R=new Float32Array(C*3),K=new Float32Array(C),H=new Float32Array(C),V=new Float32Array(C),Y=new Float32Array(C),y=new Oe(t,{position:{size:3,data:f.position},normal:{size:3,data:f.normal},part:{size:1,data:f.part},index:{data:f.index},iOffset:{size:3,data:O,instanced:1},iColor:{size:3,data:x,instanced:1},iRadius:{size:1,data:w,instanced:1},iYaw:{size:1,data:T,instanced:1},iGlyph:{size:1,data:L,instanced:1},iRing:{size:3,data:R,instanced:1},iFloor:{size:1,data:K,instanced:1},iPhysicalSeat:{size:1,data:H,instanced:1},iSeed:{size:1,data:Y,instanced:1},iPickIndex:{size:1,data:V,instanced:1}}),S=new ze(t,{geometry:y,program:M});S.frustumCulled=!1;let X=0,g=!1,z=!1,$=null,U=null,ee=null,Z=new Int32Array(0),le=()=>{let I=e.seats;for(let N=0;N<X;N++){let B=Z[N];Y[N]=oo(I.iState[B],B);let G=I.iCategory&&I.iState[B]===0?null:b[I.iState[B]]??b[0];if(G)x[N*3]=G[0],x[N*3+1]=G[1],x[N*3+2]=G[2];else{let Q=e.theme.materials.seat??Jt([I.iCategory[B*3],I.iCategory[B*3+1],I.iCategory[B*3+2]]);x[N*3]=Q[0],x[N*3+1]=Q[1],x[N*3+2]=Q[2]}}y.attributes.iColor.needsUpdate=!0,y.attributes.iSeed.needsUpdate=!0},oe={main:o,background:r,seatProgram:p,solidProgram:l,chairProgram:M,seatGeometry:c,chairGeometry:y,solidGeometry:a,drawCalls:3,setNearSeats(I,N){let B=Math.min(N,C);if(Z=I,X=B,B===0){S.parent&&S.setParent(null),y.instancedCount=0,oe.drawCalls=3+(g?1:0);return}let _=e.seats;for(let G=0;G<B;G++){let Q=I[G];O[G*3]=_.iPosition[Q*3],O[G*3+1]=_.iPosition[Q*3+1],O[G*3+2]=_.iPosition[Q*3+2],w[G]=_.iChairWidth[Q],T[G]=_.iYaw[Q],L[G]=_.iGlyph[Q],R[G*3]=_.iRing[Q*3],R[G*3+1]=_.iRing[Q*3+1],R[G*3+2]=_.iRing[Q*3+2],K[G]=_.iFloor[Q],H[G]=_.iPhysicalSeat[Q],V[G]=Q+1}le(),y.attributes.iOffset.needsUpdate=!0,y.attributes.iRadius.needsUpdate=!0,y.attributes.iYaw.needsUpdate=!0,y.attributes.iGlyph.needsUpdate=!0,y.attributes.iRing.needsUpdate=!0,y.attributes.iFloor.needsUpdate=!0,y.attributes.iPhysicalSeat.needsUpdate=!0,y.attributes.iSeed.needsUpdate=!0,y.attributes.iPickIndex.needsUpdate=!0,y.instancedCount=B,S.parent||S.setParent(o),oe.drawCalls=4+(g?1:0)},nearSeatCount(){return X},setSectionShellLit(I){let N=zo(e.sectionSolidRanges,e.solids.color,D,k,I,A);if(!N.length)return;let B=a.attributes.color,_=B.buffer;if(!_){B.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,_);for(let G of N){let Q=e.solids.color.subarray(G.start*3,(G.start+G.count)*3);t.bufferSubData(t.ARRAY_BUFFER,G.start*3*Float32Array.BYTES_PER_ELEMENT,Q)}},uploadSeatStateRuns(I){if(!I.length)return;X&&le();for(let B of I)Bo(h,e.seats.iState,B.start,B.length,b,e.seats.iCategory);let N=P.buffer;if(!N){P.needsUpdate=!0;return}t.bindBuffer(t.ARRAY_BUFFER,N);for(let B of I){let _=h.subarray(B.start*3,(B.start+B.length)*3);t.bufferSubData(t.ARRAY_BUFFER,B.start*3*Float32Array.BYTES_PER_ELEMENT,_)}},dispose(){z=!0,n.remove(),i.remove(),a.remove(),l.remove(),c.remove(),p.remove(),y.remove(),M.remove(),$?.remove(),U?.remove(),ee?.texture&&t.deleteTexture(ee.texture)}},J=e.productionElements.find(I=>I.contentImageUrl&&I.contentPlane);if(J?.contentImageUrl&&J.contentPlane?.length===4&&typeof Image<"u"){let I=new Image;I.crossOrigin="anonymous",I.onload=()=>{if(z)return;let N=J.contentPlane;$=new Oe(t,{position:{size:3,data:new Float32Array(N.flat())},uv:{size:2,data:new Float32Array([0,1,1,1,0,0,1,0])},floorIndex:{size:1,data:new Float32Array(4).fill(J.floorIndex)},index:{data:new Uint16Array([0,1,2,2,1,3])}}),ee=new Er(t,{image:I,generateMipmaps:!0,wrapS:t.CLAMP_TO_EDGE,wrapT:t.CLAMP_TO_EDGE,flipY:!1}),U=new Ar(t,{vertex:`#version 300 es
|
|
615
615
|
precision highp float;
|
|
616
616
|
in vec3 position; in vec2 uv; in float floorIndex;
|
|
617
617
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform float uFocusFloor;
|
|
@@ -619,4 +619,4 @@ void main() {
|
|
|
619
619
|
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
|
|
620
620
|
precision highp float;
|
|
621
621
|
in vec2 vUv; in float vDim; uniform sampler2D uImage; out vec4 fragColor;
|
|
622
|
-
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ee},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let F=new ke(t,{geometry:$,program:U});F.frustumCulled=!1,F.setParent(o),oe.screenProgram=U,b=!0,oe.drawCalls=3+(W?1:0)+1},V.src=J.contentImageUrl}return oe}import{Mesh as Tt,RenderTarget as wr,Transform as It}from"ogl";function Sr(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function zo(t,e,o,r,n,i){let s=-1,a=1/0;for(let l=0;l<o;l++)for(let u=0;u<e;u++){let f=(l*e+u)*4,p=Sr(t[f],t[f+1],t[f+2]);if(p<0||p>=i)continue;let v=u-r,c=l-n,d=v*v+c*c;d<a&&(a=d,s=p)}return s}function No(t,e,o,r,n,i){let s=t-o.left,a=e-o.top,l=Math.round(s*r),u=Math.round((o.height-a)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(i-1,u))}}var Mr=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],et=class{constructor(e,o,r,n,i){this.seatScene=new It;this.chairScene=new It;this.solidScene=new It;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=i,this.seatProg=Ao(this.gl),this.chairProg=Eo(this.gl),this.depthProg=Ro(this.gl);let s=new Tt(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let a=new Tt(this.gl,{geometry:r,program:this.chairProg});a.frustumCulled=!1,a.setParent(this.chairScene);let l=new Tt(this.gl,{geometry:n,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let r of Mr)this.seatProg.uniforms[r].value=e.uniforms[r].value;let o=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=o,this.chairProg.uniforms.uFocusFloor.value=o,this.depthProg.uniforms.uFocusFloor.value=o}ensureTarget(){let e=this.gl.drawingBufferWidth,o=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==o)&&this.destroyTarget(),this.target||(this.target=new wr(this.gl,{width:e,height:o,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let o of this.target.textures??[])o.texture&&e.deleteTexture(o.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,o,r,n){let i=this.gl,s=this.ensureTarget(),a=i.drawingBufferWidth,l=i.drawingBufferHeight,u=Math.max(0,o-n),f=Math.max(0,r-n),p=Math.max(1,Math.min(a,o+n+1)-u),v=Math.max(1,Math.min(l,r+n+1)-f);i.enable(i.SCISSOR_TEST),i.scissor(u,f,p,v);let[c,d,E]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:s,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:s,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:s,clear:!1}),i.clearColor(c,d,E,1),i.disable(i.SCISSOR_TEST);let C=new Uint8Array(p*v*4);return this.renderer.bindFramebuffer(s),i.readPixels(u,f,p,v,i.RGBA,i.UNSIGNED_BYTE,C),this.renderer.bindFramebuffer(),zo(C,p,v,o-u,r-f,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Bo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Kt(r.state)):o.push(r);return o}function Go(t,e,o){let r=new Set;for(let s of e)(t.has(s)||o(s)!==void 0)&&r.add(s);let n=new Map(t),i=[];for(let[s,a]of t)r.has(s)||(i.push({seatId:s,state:me[a]??"available"}),n.delete(s));for(let s of r){if(n.has(s))continue;let a=o(s);a!==void 0&&(n.set(s,a),i.push({seatId:s,state:"selected"}))}return{updates:i,next:n}}import{Quat as Le,Vec3 as Ar}from"ogl";function Pr(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Ho(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function Cr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Wo(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function Vt(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function _t(t,e){return Math.max(0,Math.min(1,t+e))}function Uo(t,e){let o=t.length;if(o===0)return[0,0,0];if(o===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),n=o-1,i=Math.floor(r*n);i>=n&&(i=n-1);let s=r*n-i,a=t[Math.max(0,i-1)],l=t[i],u=t[i+1],f=t[Math.min(o-1,i+2)],p=s*s,v=p*s,c=[0,0,0];for(let d=0;d<3;d++)c[d]=.5*(2*l[d]+(-a[d]+u[d])*s+(2*a[d]-5*l[d]+4*u[d]-f[d])*p+(-a[d]+3*l[d]-3*u[d]+f[d])*v);return c}function kt(t,e,o,r,n){let i=Wo(Pr(e,o));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let s=Ho(Ho(e,Cr(i,2.5)),[0,1.5,0]),a=[e[0]-r[0],0,e[2]-r[2]],l=Wo(a);l[0]===0&&l[2]===0&&(l=[i[0],0,i[2]]);let u=Math.max(1,n),f=[r[0]+l[0]*u*1.3,r[1]+u*.75,r[2]+l[2]*u*1.3];return{waypoints:[t,f,s],finalPos:s}}function Lt(t,e,o=35,r=28){let n=Vt(e),i=Uo(t,n),s=Vt(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:i,fov:o+(r-o)*s,eased:n}}function jo(t,e,o){let r=t.position.clone(),n=new Le().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new Ar(o[0],o[1],o[2]));let i=new Le().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),i}var tt=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Le;this.endQuat=new Le;this.outQuat=new Le;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,o,r,n=2500,i=28){return this.settle(),this.waypoints=e,this.startQuat.copy(o),this.endQuat.copy(r),this.duration=n,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(s=>{this.resolveFn=s})}update(e){if(!this.active)return!1;let o=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:n,eased:i}=Lt(this.waypoints,o,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,_t(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=n,this.camera.updateProjectionMatrix(),o>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var Ko=$t,Er=.12,Rr=.25,Fr=1.5;function Qo(t,e,o=0,r,n){let i=[e.x*we,o+Fr,e.y*we],s=n?[n[0],n[1],n[2]]:i,a=t[1],l=Number.isFinite(a)?a+Ko:Number.isFinite(r)?o+r:o+Ko,u=i[0]-t[0],f=i[2]-t[2],p=Math.hypot(u,f),v=p>.001?Math.min(Er,p*Rr):0,c=p>.001?u/p:0,d=p>.001?f/p:0;return{eye:[t[0]+c*v,l,t[2]+d*v],focal:s}}var xe=Math.PI/180,Dr=45,$o=80,ot=70,Tr=1,Ir=.99;function Vr(t,e){if(!(t<Tr))return $o;if(!(Number.isFinite(e)&&e>0))return ot;let o=2*Math.atan(e/(2*nt*Ir)/Math.max(.05,t))/xe;return Math.max(ot,Math.min($o,o))}var _r=.25,nt=1,kr=.25,Lr=12*xe,Or=.2,zr=1.5,Zo=.8,Jo=6,nn=1.9,Nr=2/3,Br=.12,Gr=.9,Hr=1.2,Wr=2,rn=.05,Ur=6;function an(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+Zo,e[1]),e[2]+6]};let r=1/0,n=-1/0,i=1/0,s=-1/0,a=o;for(let d of t)r=Math.min(r,d.cx-d.halfX),n=Math.max(n,d.cx+d.halfX),i=Math.min(i,d.cz-d.halfZ),s=Math.max(s,d.cz+d.halfZ),a=Math.max(a,d.y);let l=n-r,u=s-i,f=Math.max(l,Math.min(u,Jo))/2,p=Math.max(u,Math.min(l,Jo))/2,v=(r+n)/2,c=(i+s)/2;return{min:[v-f,o,c-p],max:[v+f,Math.max(o+Zo,a),c+p]}}function Yr(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+nn,t.max[2]]}}function Ot(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+zr,e+Or,e+nn*Nr),(t.min[2]+t.max[2])/2]}function sn(t,e){let o=t[0]-e[0],r=t[2]-e[2],n=Math.hypot(o,r);return n<.001?{x:0,z:1}:{x:o/n,z:r/n}}function en(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,u=Math.hypot(a,l);if(u<1e-6)return 1/0;a/=u,l/=u;let f=1/0,p=-1/0;for(let v=0;v<8;v++){let c=(v&1?o.max[0]:o.min[0])-t[0],d=(v&2?o.max[1]:o.min[1])-t[1],E=(v&4?o.max[2]:o.min[2])-t[2],C=Math.max(rn,c*r+d*n+E*i),M=(c*a+E*l)/C;M<f&&(f=M),M>p&&(p=M)}return p-f}function tn(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,u=Math.hypot(a,l);if(u<1e-6)return 1/0;a/=u,l/=u;let f=-l*n,p=l*r-a*i,v=a*n,c=1/0,d=-1/0;for(let E=0;E<8;E++){let C=(E&1?o.max[0]:o.min[0])-t[0],M=(E&2?o.max[1]:o.min[1])-t[1],k=(E&4?o.max[2]:o.min[2])-t[2],y=Math.max(rn,C*r+M*n+k*i),D=(C*f+M*p+k*v)/y;D<c&&(c=D),D>d&&(d=D)}return d-c}function rt(t,e){return Math.tan(t*xe/2)*Math.max(.05,e)}function on(t,e,o){let r=Vr(o,t),n=l=>Math.max(Dr,Math.min(r,l)),i=l=>2*Math.atan(l)/xe,s=Number.isFinite(t)&&t>0?n(i(t/(2*_r)/Math.max(.05,o))):r;if(!(Number.isFinite(e)&&e>0))return s;let a=Math.min(s,n(i(e/(2*Br))));return t/(2*rt(a,o))>nt?s:a}function ln(t,e,o){let r=Ot(e),n=[t[0],t[1],t[2]],i=0,s=0,a=c=>{if(!(c>0))return;let d=sn(n,r);n[0]+=d.x*c,n[2]+=d.z*c,s+=c},l=e.max[1]+kr-n[1];l>0&&(n[1]+=l,i=l,a(l/Math.tan(Lr)));let u=Yr(e),f=en(n,r,e),p=on(f,tn(n,r,u),o),v=f/(2*rt(p,o));for(let c=0;c<Ur&&v>nt;c++){let d=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),E=Number.isFinite(v)?v/nt:2;a(Math.min(60,d*(Math.min(4,E)-1)+.5)),f=en(n,r,e),p=on(f,tn(n,r,u),o),v=f/(2*rt(p,o))}return{eye:n,focal:r,fov:p,raisedM:i,pulledBackM:s,stageFrameWidth:v}}function Xr(t,e,o){let r=Math.tan(e*xe/2),n=rt(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function cn(t,e){let{aspect:o,venue:r}=e,n=t.focal,i=sn(t.eye,n),s=v=>(v[0]-n[0])*i.x+(v[2]-n[2])*i.z,a=[{name:"seat",eye:t.eye,focal:n,fov:t.fov}],l=Wr*(e.rowDepthM??Gr);a.push({name:"row",eye:[t.eye[0]+i.x*l,t.eye[1]+Hr,t.eye[2]+i.z*l],focal:n,fov:t.fov});let u=(v,c,d,E)=>{let C=Xr(d,t.fov,o)*1.08,M=C*Math.sin(E*xe),k=C*Math.cos(E*xe);return{name:v,eye:[c[0]+i.x*k,c[1]+M,c[2]+i.z*k],focal:c,fov:t.fov}};e.section&&e.section.radius>0&&a.push(u("section",e.section.center,e.section.radius,14)),a.push(u("venue",r.center,Math.max(1,r.radius),26));let f=[],p=-1/0;for(let v of a){let c=s(v.eye);f.length&&c<=p+.5||(f.push(v),p=c)}return f}import{Vec3 as qr}from"ogl";var ze=Math.PI/180,un=320,dn=70*ze,jr=32*ze,Kr=24*ze,mn=.0026,Qr=.22,$r=.006,Zr=180,Jr=4,se=(t,e,o)=>Math.max(e,Math.min(o,t)),pn=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function hn(t){let{canvas:e,camera:o}=t,r=[],n=!1,i=0,s=0,a=0,l=0,u=0,f=0,p=!1,v=[0,0],c=0,d=!1,E=null,C=null,M=new Map,k=!1,y=0,D=0,P=0,x=0,S=()=>n&&r.length?r[se(Math.round(i),0,r.length-1)].name:null,T=()=>{let b=S();b!==E&&(E=b,t.onStopChange?.(b))},_=()=>{if(!n||!r.length)return;let b=r[se(Math.floor(i),0,r.length-1)],z=r[se(Math.ceil(i),0,r.length-1)],$=se(i-Math.floor(i),0,1),U=(Ne,Be)=>Ne+(Be-Ne)*$,ee=[U(b.eye[0],z.eye[0]),U(b.eye[1],z.eye[1]),U(b.eye[2],z.eye[2])],Z=[U(b.focal[0],z.focal[0]),U(b.focal[1],z.focal[1]),U(b.focal[2],z.focal[2])],le=Z[0]-ee[0],oe=Z[1]-ee[1],J=Z[2]-ee[2],V=Math.hypot(le,oe,J)||1,N=Math.atan2(le,J),F=Math.asin(se(oe/V,-1,1)),q=N+s,B=se(F+a,-80*ze,80*ze),K=Math.cos(B)*V;le=Math.sin(q)*K,oe=Math.sin(B)*V,J=Math.cos(q)*K,o.position.set(ee[0],ee[1],ee[2]),o.fov=U(b.fov,z.fov),o.updateProjectionMatrix(),o.lookAt(new qr(ee[0]+le,ee[1]+oe,ee[2]+J)),t.onApplied?.()},O=()=>{if(!n||!r.length)return;let b=se(Math.round(i),0,r.length-1);if(t.reducedMotion()){p=!1,i=b,_(),T(),t.requestRender();return}if(Math.abs(b-i)<.001){p=!1,T();return}l=i,u=b,f=performance.now(),p=!0,t.requestRender()},R=b=>{!n||r.length<2||(p=!1,i=se(i+b,0,r.length-1),_(),T(),t.requestRender())},Y=(b,z)=>{n&&(p=!1,d=!1,s=se(s-b*mn,-dn,dn),a=se(a-z*mn,-Kr,jr),_(),t.requestRender())},j=b=>{n&&(M.set(b.pointerId,{x:b.clientX,y:b.clientY}),M.size===1?(k=!0,x=0,y=b.clientX,D=b.clientY):M.size===2&&(k=!1,P=L()))},L=()=>{let b=[...M.values()];return b.length<2?0:Math.hypot(b[0].x-b[1].x,b[0].y-b[1].y)},G=b=>{if(!n||!M.has(b.pointerId))return;if(M.set(b.pointerId,{x:b.clientX,y:b.clientY}),M.size>=2){let U=L();P>0&&R((P-U)*$r),P=U;return}if(!k)return;let z=b.clientX-y,$=b.clientY-D;y=b.clientX,D=b.clientY,x+=Math.abs(z)+Math.abs($),!(x<=Jr)&&Y(z,$)},g=b=>{M.delete(b.pointerId)&&(M.size<2&&(P=0),M.size===0&&(k=!1,O()))},w=b=>{if(!n)return;b.preventDefault();let z=b.deltaMode===1?16:b.deltaMode===2?100:1,$=se(b.deltaY*z/100,-2,2);R($*Qr),C&&clearTimeout(C),C=setTimeout(()=>{C=null,O()},Zr)},W=()=>{n&&(n=!1,p=!1,d=!1,r=[],M.clear(),k=!1,C&&(clearTimeout(C),C=null),E!==null&&(E=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",j),e.addEventListener("pointermove",G),e.addEventListener("pointerup",g),e.addEventListener("pointercancel",g),e.addEventListener("wheel",w,{passive:!1}),{get active(){return n},enter(b){if(b.length<2){W();return}r=b,n=!0,i=0,s=0,a=0,p=!1,d=!1,E=null,_(),T(),t.requestRender()},exit:W,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(a)<1e-4?!0:t.reducedMotion()?(d=!1,s=0,a=0,_(),t.requestRender(),!0):(v=[s,a],c=performance.now(),d=!0,t.requestRender(),!0):!1},update(b){if(!n)return!1;let z=!1;if(d){let $=se((b-c)/un,0,1),U=1-pn($);s=v[0]*U,a=v[1]*U,$>=1?(d=!1,s=0,a=0):z=!0}if(p){let $=se((b-f)/un,0,1);i=l+(u-l)*pn($),$>=1?(p=!1,i=u,T()):z=!0}return _(),z},currentStop:S,dispose(){W(),e.removeEventListener("pointerdown",j),e.removeEventListener("pointermove",G),e.removeEventListener("pointerup",g),e.removeEventListener("pointercancel",g),e.removeEventListener("wheel",w)}}}function fn(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var zt=null;function vn(){return zt??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw zt=null,t}),zt}var bn=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),it=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,o){if(this.cb)try{this.cb(e,o)}catch{}}opened(e,o,r,n){this.emit("3d_opened",{seats:e,hasHeights:o,...r===void 0?{}:{buildMs:Math.round(r)},...n===void 0?{}:{prepSource:n}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,o){this.emit("3d_seat_picked",{seatId:e,sectionId:o})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=bn(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(bn()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,o){this.emit("3d_panorama_failed",{seatId:e,phase:o})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function gn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function yn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:i,isNarrow:s}=t,a=null,l=()=>{if(!a)return;let p=s();Object.assign(a.style,p?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},u=()=>{a?.remove(),a=null};return{show:(p,v,c=!1)=>{if(u(),t.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 E=r.chrome?.caption!==!1,C=r.chrome?.seatStepper!==!1;if(!E&&!C)return null;let M=n.get(p),k=M?.sectionId?o.sections.find(O=>O.id===M.sectionId):void 0,y=M?.label??p;d.setAttribute("aria-label",`Explore views near ${k?.label?`${k.label}, `:""}seat ${y}`);let D=document.createElement("span");D.textContent=r.seatViewCaption?.(p)??["Live 3D seat view",k?.label,y].filter(Boolean).join(" \xB7 "),Object.assign(D.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)"}),E&&d.appendChild(D);let P=document.createElement("div");Object.assign(P.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),d.appendChild(P);let x=M?.rowId?i.get(M.rowId):void 0,S=x?.indexOf(p)??-1,T=S>=0?[x?.[S-1],x?.[S+1]]:[void 0,void 0],_=(O,R,Y,j=!1)=>{let L=document.createElement("button");L.type="button",L.textContent=O,L.setAttribute("aria-label",R),Object.assign(L.style,{minHeight:"44px",padding:j?"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"}),j||(L.style.minWidth="44px"),j&&(L.dataset.panoramaTrigger=""),L.addEventListener("click",Y),P.appendChild(L)};if(C&&T[0]){let O=n.get(T[0])?.label??T[0];_("\u2039",`View previous seat ${O}`,()=>{t.flyToSeat(T[0])})}if(C&&r.getSeatView){let O=r.seatViewActionLabel?.(p)??"Open 360\xB0 panorama";_(c?`\u21BB Retry ${O}`:`\u25C9 ${O}`,`${c?"Retry":O} from seat ${y}`,()=>{if(t.isDisposed()||v!==t.flightGen()){u();return}u(),t.openPanorama(p,400,v)},!0)}if(C&&T[1]){let O=n.get(T[1])?.label??T[1];_("\u203A",`View next seat ${O}`,()=>{t.flyToSeat(T[1])})}return!P.childElementCount&&!E?null:(e.appendChild(d),a=d,l(),d)},remove:u,layout:l}}function xn(t){let{container:e,orbit:o,isNarrow:r}=t,n=document.createElement("div"),i=!1;n.className="sl-3d-navigation-controls",Object.assign(n.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let s=document.createElement("div");s.setAttribute("role","group"),s.setAttribute("aria-label","3D drag mode"),Object.assign(s.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let a=document.createElement("div");a.setAttribute("role","group"),a.setAttribute("aria-label","3D view controls"),Object.assign(a.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let l=document.createElement("button");l.type="button",l.textContent="\u21BB",l.setAttribute("aria-label","Drag to rotate the 3D venue"),l.dataset.tooltip="Rotate venue";let u=document.createElement("button");u.type="button",u.textContent="\u2725",u.setAttribute("aria-label","Drag to move the 3D venue left, right, up or down"),u.dataset.tooltip="Move venue";let f=document.createElement("button");f.type="button",f.textContent="\u2212",f.setAttribute("aria-label","Zoom out of the 3D venue"),f.dataset.tooltip="Zoom out";let p=document.createElement("button");p.type="button",p.textContent="+",p.setAttribute("aria-label","Zoom into the 3D venue"),p.dataset.tooltip="Zoom in";for(let C of[l,u,f,p])C.className="sl-3d-icon-control",Object.assign(C.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"});s.append(l,u),a.append(p,f);let v=C=>{o.setPrimaryDragMode(C);let M=C==="orbit";l.setAttribute("aria-pressed",String(M)),u.setAttribute("aria-pressed",String(!M)),l.style.background=M?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",u.style.background=M?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",n.title=M?"Drag to rotate \xB7 Shift-drag to move":"Drag to move \xB7 Shift-drag to rotate"};l.addEventListener("click",()=>v("orbit")),u.addEventListener("click",()=>v("pan")),f.addEventListener("click",()=>o.zoomBy(1.22)),p.addEventListener("click",()=>o.zoomBy(.82)),n.append(s,a),v("orbit"),e.appendChild(n);let c=t.enabled!==!1,d=()=>{let C=r();n.style.display=i||!c?"none":"flex",n.style.right=C?"12px":"14px",n.style.bottom=C?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",s.style.display=C?"none":"flex",p.style.display=C?"none":"",f.style.display=C?"none":""};return d(),{element:n,utilityControls:a,setNavigationMode:v,setSeatViewLocked:C=>{i=C,o.setInteractionEnabled(!C),d()},seatViewLocked:()=>i,layout:d}}var ei=12;function ti(t,e){if(!t)return!1;let o=t.x-e[0],r=t.y-e[1],n=t.z-e[2];return Math.hypot(o,r,n)>ei}function Sn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:i,cinematic:s,analytics:a,seatIdByIndex:l,sectionIdBySeatId:u,tapSlop:f,tapMs:p,cancelFlight:v,focusSectionCamera:c,setSelection:d,ensureSeatView:E}=t,C=0,M=0,k=0,y=-1,D=!1,P=!1,x=R=>{t.seatViewLocked()||y===-1&&(y=R.pointerId,C=R.clientX,M=R.clientY,k=performance.now(),D=!1,P=s.active,s.active&&(a.cinematicCancelled(),v(),i.onViewTargetChange?.(null)))},S=R=>{R.pointerId===y&&Math.hypot(R.clientX-C,R.clientY-M)>f&&(D=!0)},T=(R,Y,j,L,G)=>{let g=e.canvas.getBoundingClientRect(),w=e.canvas.clientWidth||g.width||1,W=e.canvas.clientHeight||g.height||1,b=R-g.left,z=Y-g.top,$=L*L,U=-1,ee=$,Z=1/0;for(let le of n){if(j&&le.sectionId!==j)continue;let oe=r.seats.idToIndex.get(le.id);if(oe===void 0)continue;if(G){let B=Math.round(r.seats.iState[oe]??0);if(B!==0&&B!==3)continue}let J=oe*3,V=fe(o.camera.projectionViewMatrix,[r.seats.iPosition[J],r.seats.iPosition[J+1]+.55,r.seats.iPosition[J+2]],w,W);if(!V.visible)continue;let N=V.x-b,F=V.y-z,q=N*N+F*F;(q<ee||Math.abs(q-ee)<1&&V.depth<Z)&&(U=oe,ee=q,Z=V.depth)}return U},_=(R,Y)=>{let j=t.gpu(),L=t.pick();if(!j||!L)return-1;L.syncFromSeatProgram(j.seatProgram);let G=e.canvas.getBoundingClientRect(),g=e.renderer.dpr,{x:w,y:W}=No(R,Y,G,g,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),b=Math.max(2,Math.round(8*g));return L.pick(o.camera,w,W,b)};return{onDown:x,onMove:S,onUp:R=>{if(R.pointerId!==y)return;let Y=!D&&performance.now()-k<p;if(y=-1,P){P=!1;return}let j=t.gpu(),L=t.pick();if(!Y||!j||!L)return;let G=_(R.clientX,R.clientY);if(t.focusedSectionId()&&G>=0){let W=l[G],b=W?u.get(W):void 0;if(b&&b!==t.focusedSectionId()&&c(b))return}if(t.focusedSectionId()&&G<0&&(G=T(R.clientX,R.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&G<0){let W=T(R.clientX,R.clientY,null,72,!1),b=W>=0?l[W]:void 0,z=b?u.get(b):void 0;if(z&&z!==t.focusedSectionId()&&c(z))return}if(!t.focusedSectionId()){G<0&&(G=T(R.clientX,R.clientY,null,42,!1));let W=G>=0?l[G]:void 0,b=W?u.get(W):void 0;if(b&&c(b))return}if(G<0||G>=l.length){t.selection().size&&(d([]),i.onViewTargetChange?.(null));return}let g=l[G],w=me[Math.round(r.seats.iState[G]??0)]??"available";if(w!=="available"&&w!=="selected"){i.onSeatInspect?.(g,w);return}if(t.selection().has(g)&&t.selection().size===1){d([]),i.onViewTargetChange?.(null),i.onSeatPick?.(g);return}if(d([g]),E(g),a.seatPicked(g,u.get(g)),i.onSeatPick?.(g),t.focusedSectionId()){let W=G*3,b=[r.seats.iPosition[W],r.seats.iPosition[W+1],r.seats.iPosition[W+2]];ti(o.camera?.position,b)&&t.focusSeatCamera(g)}}}}var at=class{constructor(e,o){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=o}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,o=1/0,r=1/0,n=-1/0,i=-1/0;for(let c=0;c<this.count;c++){let d=e[c*3],E=e[c*3+2];d<o&&(o=d),d>n&&(n=d),E<r&&(r=E),E>i&&(i=E)}let s=Math.max(n-o,.001),a=Math.max(i-r,.001);this.cell=Math.max(Math.sqrt(s*a*4/this.count),.25),this.cols=Math.max(1,Math.ceil(s/this.cell)+1),this.rows=Math.max(1,Math.ceil(a/this.cell)+1),this.minX=o,this.minZ=r;let l=this.cols*this.rows,u=new Int32Array(l+1),f=c=>{let d=Math.min(this.cols-1,Math.max(0,Math.floor((e[c*3]-o)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[c*3+2]-r)/this.cell)))*this.cols+d};for(let c=0;c<this.count;c++)u[f(c)+1]++;for(let c=0;c<l;c++)u[c+1]+=u[c];let p=new Int32Array(this.count),v=u.slice(0,l);for(let c=0;c<this.count;c++)p[v[f(c)]++]=c;this.cellStart=u,this.cellItems=p}gather(e,o,r,n){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let a=n.length,l=r*r,u=Math.floor((e-this.minX)/this.cell),f=Math.floor((o-this.minZ)/this.cell),p=Math.ceil(r/this.cell)+1,v=this.iPosition,c=0;for(let d=0;d<=p&&c<a;d++){let E=f-d,C=f+d,M=u-d,k=u+d;for(let y=E;y<=C&&c<a;y++){if(y<0||y>=this.rows)continue;let D=y===E||y===C;for(let P=M;P<=k&&c<a;P++){if(!D&&P!==M&&P!==k){P=k-1;continue}if(P<0||P>=this.cols)continue;let x=y*this.cols+P;for(let S=i[x],T=i[x+1];S<T&&c<a;S++){let _=s[S],O=v[_*3]-e,R=v[_*3+2]-o;O*O+R*R<=l&&(n[c++]=_)}}}}return c}};var st=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Ke);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new at(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let o=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&o?.nearSeatCount()&&o.setNearSeats(this.nearBuf,0)}update(e){let{model:o}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let n=this.ctx.orbit().camera.position;if(Math.hypot(n.x-this.lastGatherX,n.z-this.lastGatherZ)<Pt)return;if(this.lastGatherX=n.x,this.lastGatherZ=n.z,Math.hypot(n.x-o.bounds.center[0],n.z-o.bounds.center[2])-o.bounds.radius>Mt){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.nearIndex.gather(n.x,n.z,Mt,this.nearBuf);a===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,a)}ease(e,o,r){let n=1-Math.exp(-e*9),i=1-Math.exp(-e*20);this.seatDetailMix+=(o-this.seatDetailMix)*(o>this.seatDetailMix?n:i),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?n:i),Math.abs(o-this.seatDetailMix)<.01&&(this.seatDetailMix=o),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};import{Quat as oi,Vec3 as ni}from"ogl";function wn(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let o=document.createElementNS(t,"path");return o.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"),e.appendChild(o),e}function Cn(t){let{container:e,model:o,opts:r,orbit:n,cinematic:i,analytics:s,loop:a,labelOverlay:l,stageAzimuth:u,overviewFraming:f}=t,p=0,v=-1,c=(x,S,T=28)=>{n.camera.position.set(x[0],x[1],x[2]),n.camera.lookAt(new ni(S[0],S[1],S[2])),n.camera.fov=T,n.camera.updateProjectionMatrix()},d=document.createElement("button");d.className="sl-3d-overview-control sl-3d-icon-control",d.type="button",d.replaceChildren(wn()),d.setAttribute("aria-label","Fit the active level or whole venue in view"),d.dataset.tooltip="Fit view",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 E=()=>{d.firstElementChild||d.replaceChildren(wn())};E();let C=x=>{v=x;let S=t.gpu();S&&(S.seatProgram.uniforms.uFocusFloor.value=x,S.solidProgram.uniforms.uFocusFloor.value=x,S.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},M=()=>{if(t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),s.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),d.style.display="",l.setVisible(!0),t.setFrozen(!1);let x=v>=0?o.floors[v]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),k(),t.removeArriveChip(),t.setNavigationMode("orbit"),x){let S=x.focalWorld[0]-x.center[0],T=x.focalWorld[2]-x.center[2],_=Math.hypot(S,T)>x.radius*.12?Math.atan2(S,T):u,O={center:x.center,radius:x.radius,box:x.box},R={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(O,!1,_,!1,R):n.frameSoft(O,_,!1,R)}else t.reducedMotion()?n.frame(o.bounds,!1,u,r.portraitOverviewCrop===!0,f):n.frameSoft(o.bounds,u,r.portraitOverviewCrop===!0,f);t.showSectionSeatLabels(null),a.requestRender()},k=()=>{p++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),i.active&&(i.cancel(),n.resumeAfterFlight(o.focalWorld))},y=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let S=o.seats.idToIndex.get(x);if(S===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),d.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let T=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(T),t.setSeatViewLocked(!1);let _=++p;T?t.showArriveChip(x,_):t.removeArriveChip();let{eye:O,focal:R}=t.resolvedSeatViewPose(x,S),Y=r.arriveAtSeatEye?t.seatViewArrival(x,S):null,j=Y?Y.focal:R,L=[n.camera.position.x,n.camera.position.y,n.camera.position.z],G=kt(L,Y?.eye??O,j,o.bounds.center,o.bounds.radius),g=Y?Y.eye:r.arriveAtSeatEye?O:G.finalPos,w=Y?Y.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?ot:65:28,W=[G.waypoints[0],G.waypoints[1],g];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),c(g,j,w),a.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),Y&&t.enterSeatView(Y.stops),t.showArriveChip(x,_),Promise.resolve();let b=new oi().copy(n.camera.quaternion),z=jo(n.camera,g,j);a.requestRender();let $=T?700:2500;return i.start(W,b,z,$,w).then(()=>{t.isDisposed()||_!==p||(t.setSeatStepping(!1),s.cinematicPlayed($),n.resumeAfterFlight(j),t.setSeatViewLocked(r.arriveAtSeatEye===!0),Y&&t.enterSeatView(Y.stops),a.requestRender(),t.showArriveChip(x,_))})},D=x=>{let S=o.sections.find(R=>R.id===x);if(!S||S.seatCount===0)return!1;t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),i.cancel(),t.removeArriveChip(),o.floors.length>1&&v!==S.floorIndex&&C(S.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(x);let T=S.focalWorld[0]-S.center[0],_=S.focalWorld[2]-S.center[2],O=Math.hypot(T,_)>S.radius*.12?Math.atan2(T,_):void 0;return n.frame({center:S.center,radius:Math.max(5,S.radius*.5)},!1,O),r.onSectionFocusChange?.(x),a.requestRender(),!0},P=x=>{if(t.isDisposed()||!t.gpu())return!1;let S=o.seats.idToIndex.get(x);if(S===void 0)return!1;let T=S*3,_=[o.seats.iPosition[T],o.seats.iPosition[T+1]+.55,o.seats.iPosition[T+2]];return t.reducedMotion()?n.frame({center:_,radius:Mn},!1,void 0,!1,Pn):n.frameSoft({center:_,radius:Mn},void 0,!1,Pn),a.requestRender(),!0};return d.addEventListener("click",M),{overviewChip:d,layoutOverviewChip:E,flightGen:()=>p,focusedFloor:()=>v,applyFloorFocus:C,placeCameraFinal:c,cancelFlight:k,focusOverview:M,flyToSeat:y,focusSectionCamera:D,focusSeatCamera:P}}var Mn=4.5,Pn={polarDeg:48,margin:1.25};function An(t){let e=performance.now();return{model:Ie(t),buildMs:performance.now()-e,source:"main"}}function ri(t){let e=Xt(t.doc);return{...An({...t,seats:e}),seats:e}}function En(t,e,o){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(n=>{let i=!1,s=u=>{i||(i=!0,clearTimeout(l),r.terminate(),n(u))},a=()=>s(e()),l=window.setTimeout(a,15e3);r.onerror=a,r.onmessage=u=>{let f=o(u.data);f?s(f):a()},r.postMessage(t)})}function ii(t){return En(t,()=>An(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function ai(t){return En(t,()=>ri(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var si=Math.PI/180,li=6,ci=500;function is(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Ie(e),i=new it(o.onAnalytics),s=new Array(n.seats.count);for(let[m,h]of n.seats.idToIndex)s[h]=m;let a=new Map(e.seats.map(m=>[m.id,m])),l=new Map;for(let m of e.seats){if(!m.rowId)continue;let h=l.get(m.rowId);h?h.push(m.id):l.set(m.rowId,[m.id])}let u=new Map;for(let m of e.seats)u.set(m.id,m.sectionId);let f=new Map;for(let[m,h]of n.seats.idToIndex){let A=u.get(m);if(!A)continue;let H=f.get(A);H?H.push(h):f.set(A,[h])}let p=()=>{if(!c||!n.sectionSolidRanges.length)return;let{lit:m,anyUnlit:h}=Vo(n.sectionSolidRanges,f,n.seats.iState);c.setSectionShellLit(h?m:null)},v=e.doc.floors?.some(h=>(h.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(h=>h.objects)??e.doc.objects).some(h=>h.type==="section"&&((h.height??0)>0||(h.rake??0)>0)),c=null,d=null,E=!1,C=!1,M=!1,k=new Map,y=null,D=null,P=null,x=new Map,S=null,T=()=>{P===null&&(P=t.style.zIndex,t.style.zIndex="20")},_=()=>{P!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=P),P=null)},O=!1,R=()=>O?re.focusedFloor():-1,Y=()=>{c=Oo(g.gl,n),p(),d=new et(g.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),g.setClearColor(n.theme.background.top),d.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=Te*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=R(),c.solidProgram.uniforms.uFocusFloor.value=R(),c.chairProgram.uniforms.uFocusFloor.value=R(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=R()),L.forceRegather()},j=!1,L=new st({model:n,orbit:()=>w,gpu:()=>c}),G=m=>L.setDetailEnabled(m),g=new Xe(t,{onContextLost:()=>{M||i.contextLost(),E=!0,F.stop(),c=null,d=null},onContextRestored:()=>{Y(),E=!1,M||i.contextRestored(),F.requestRender()}}),w=new qe(g.gl,g.canvas,()=>F.requestRender(),()=>i.orbitEngaged());w.setAspect(g.aspect);let W=(e.doc.floors?.flatMap(m=>m.objects)??e.doc.objects).some(m=>m.type==="section"&&m.physical3dProvenance?.surfaceKind?.status==="inferred"),b=(()=>{if(W&&n.stages.length===0)return;let m=n.focalWorld[0]-n.bounds.center[0],h=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(m,h)>n.bounds.radius*.12?Math.atan2(m,h):void 0})(),z=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},$=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;w.frame(n.bounds,!$&&o.skipInitialOverviewAnimation!==!0,b,o.portraitOverviewCrop===!0,z);let U=new tt(w.camera),ee=gn(t),Z=new Ze(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),le=n.labels,oe=()=>eo(le,n.floors.length,R());Z.setLabels(oe());let J=null,V=m=>{if(J=m,Z.setForcedDense(!!m),!m){Z.setLabels(oe());return}let h=e.seats.filter(I=>I.sectionId===m),A=new Set(h.map(I=>I.id)),H=new Set(h.map(I=>I.rowId)),X=new Set(k.keys()),Q=new Set(h.filter(I=>X.has(I.id)).map(I=>I.id)),te=oe().filter(I=>I.kind!=="row"&&I.kind!=="seat"||(I.kind==="row"?H.has(I.id.slice(4)):A.has(I.id.slice(5))&&(Q.size===0||Q.has(I.id.slice(5)))));if(n.seatCount<=6e3&&Q.size===0){Z.setLabels(te);return}let ne=Q.size?h.filter(I=>Q.has(I.id)):h,ve=new Set(ne.map(I=>`seat:${I.id}`)),he=ne.flatMap(I=>{let ae=n.seats.idToIndex.get(I.id);if(ae===void 0)return[];let ce=ae*3;return[{id:`seat:${I.id}`,kind:"seat",text:X.has(I.id)?I.displayLabel||I.label:lo(I.displayLabel||I.label),anchor:[n.seats.iPosition[ce],n.seats.iPosition[ce+1]+(X.has(I.id)?1.05:.55),n.seats.iPosition[ce+2]]}]});Z.setLabels([...te.filter(I=>!ve.has(I.id)),...he])};Y();let N=null,F=new je(m=>{if(E||!c||C)return!1;let h=fn({flying:U.active,panoramaMounted:y!==null,seatViewActive:N?.active===!0}),A=h==="cinematic"?U.update(performance.now()):h==="seatView"?N.update(performance.now()):h==="orbit"?w.update():!1,H=R()>=0?n.floors[R()]:null,X=H?.radius??n.bounds.radius,Q=vo(w.currentDistance,X),te=j?{center:[w.camera.position.x,w.camera.position.y,w.camera.position.z],radius:520}:n.renderBounds;w.updateClipping(te);let ne=H?.center??n.renderBounds.center,ve=H?.radius??n.renderBounds.radius,he=(ue,De)=>Math.hypot(w.camera.position.x-ue[0],w.camera.position.y-ue[1],w.camera.position.z-ue[2])<=De*(L.detailVisible?1.8:1.55),I=he(ne,ve);if(!I&&J){let ue=n.sections.find(De=>De.id===J);ue&&(I=he(ue.center,Math.max(12,ue.radius*2)))}L.detailVisible=I;let ae=c.seatProgram.uniforms;ae.uSeatScale.value=Q.scale,ae.uSeatFade.value=Q.fade;let ce=!!H&&bo(H.seatCount,g.canvas.clientWidth||1,g.canvas.clientHeight||1),He=go(n.seats.count,X,w.currentDistance,w.camera.fov,g.canvas.clientHeight||1),Fe=L.detailVisible||ce||He?1:0,We=L.detailVisible||R()>=0||n.floors.length>1?1:0;return L.ease(m,Fe,We),ae.uSeatDetail.value=L.seatDetailMix,c.solidProgram.uniforms.uStructureDetail.value=L.structureDetailMix,ae.uMinPixels.value=Q.minPixels,ae.uPixelToWorld.value=2*Math.tan(w.camera.fov*si/2)/Math.max(1,g.pixelHeight),L.update(L.detailVisible),g.renderer.render({scene:c.background,clear:!0}),g.renderer.render({scene:c.main,camera:w.camera,clear:!1}),Z.update(w.camera.projectionViewMatrix,g.canvas.clientWidth||1,g.canvas.clientHeight||1,w.currentDistance,X,[w.camera.position.x,w.camera.position.y,w.camera.position.z]),A||L.seatDetailMix!==Fe||L.structureDetailMix!==We}),q=typeof ResizeObserver<"u"?new ResizeObserver(()=>ht.resize()):null;q?.observe(t);let B=m=>{let h=X=>{let Q=n.seats.idToIndex.get(X);return Q===void 0?void 0:n.seats.iState[Q]},{updates:A,next:H}=Go(k,m,h);if(k=H,Z.setSelectedSeatIds(k.keys()),J&&V(J),A.length){let X=gt(n.seats,A);c&&c.uploadSeatStateRuns(X),p(),F.requestRender()}},K=()=>S!==null?S:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Ne=8,Be=m=>{if(!o.getSeatView)return null;let h=x.get(m);if(!h)for(h=Promise.resolve(o.getSeatView(m)),x.set(m,h),h.catch(()=>{x.get(m)===h&&x.delete(m)});x.size>Ne;){let A=x.keys().next().value;if(A===void 0)break;x.delete(A)}return h},Nt=an(n.stages,n.focalWorld,n.bounds.groundY??0),Rn=Ot(Nt),lt=(m,h)=>{let A=a.get(m),H=Math.max(0,Math.round(n.seats.iFloor[h]??0)),X=e.doc.floors?.[H],Q=n.floors[H],te=X?.focalPoint??e.doc.focalPoint,ne=Q?{x:Q.focalWorld[0]/we,y:Q.focalWorld[2]/we}:te,ve=A?.focalPoint?{x:A.focalPoint.x+ne.x-te.x,y:A.focalPoint.y+ne.y-te.y}:ne,he=[n.seats.iPosition[h*3],n.seats.iPosition[h*3+1],n.seats.iPosition[h*3+2]];return Qo(he,ve,X?.baseHeightM??0,A?.eyeHeightM,Rn)},Bt=()=>(t.clientWidth||g.canvas.clientWidth)<=520,ct=null,Gt=null,Fn=async(m,h,A)=>{if(!o.getSeatView||M||A!==re.flightGen())return;let H;try{H=await vn()}catch{if(i.panoramaFailed(m,"mount"),!M&&A===re.flightGen()){let X=dt(m,A,!0);requestAnimationFrame(()=>X?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(M||A!==re.flightGen()||!ct))return Gt??=H.createOpenPanorama(ct),Gt(m,h,A)},ut=yn({container:t,model:n,opts:o,expandedSeatById:a,seatIdsByRow:l,isNarrow:Bt,isDisposed:()=>M,flightGen:()=>re.flightGen(),flyToSeat:m=>Ut(m),openPanorama:(m,h,A)=>Fn(m,h,A)}),dt=ut.show,mt=ut.remove,Dn=ut.layout,Se=xn({container:t,orbit:w,isNarrow:Bt,enabled:o.chrome?.controlDock!==!1}),Tn=Se.element,Ee=Se.setNavigationMode,In=Se.layout,Vn=Se.utilityControls,Re=null,Ht=!1,Ge=m=>{Se.setSeatViewLocked(m),m||N?.exit()};N=hn({canvas:g.canvas,camera:w.camera,requestRender:()=>F.requestRender(),reducedMotion:K,onStopChange:m=>{let h=m??(Ht?"seat":null);Re=h;try{o.onSeatViewStopChange?.(h)}catch{}},onApplied:()=>{M||w.syncFromCamera()}});let _n=(m,h)=>{let{eye:A}=lt(m,h),H=(t.clientWidth||g.canvas.clientWidth||1)/Math.max(1,t.clientHeight||g.canvas.clientHeight||1),X=ln(A,Nt,H);if(o.seatViewStops===!1)return{...X,stops:[]};let Q=u.get(m),te=Q?n.sections.find(ne=>ne.id===Q):void 0;return{...X,stops:cn(X,{aspect:H,section:te&&te.seatCount>0?{center:te.center,radius:te.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},re=Cn({container:t,model:n,opts:o,orbit:w,cinematic:U,analytics:i,loop:F,labelOverlay:Z,stageAzimuth:b,overviewFraming:z,gpu:()=>c,isDisposed:()=>M,panorama:()=>y,setPanorama:m=>{y=m},setPanoramaSphereVisible:m=>{j=m},panoramaLoadAbort:()=>D,setPanoramaLoadAbort:m=>{D=m},setFrozen:m=>{C=m},restorePanoramaLayer:_,reducedMotion:K,resolvedSeatViewPose:lt,showSectionSeatLabels:V,setNearFieldDetailEnabled:G,setSeatViewLocked:Ge,setNavigationMode:Ee,showArriveChip:dt,removeArriveChip:mt,inSeatView:()=>Re!==null,setSeatStepping:m=>{Ht=m},seatViewArrival:(m,h)=>o.arriveAtSeatEye?_n(m,h):null,enterSeatView:m=>N?.enter(m)});O=!0;let pt=re.overviewChip,kn=re.layoutOverviewChip,Ln=re.applyFloorFocus,On=re.focusOverview,Wt=re.cancelFlight,Ut=re.flyToSeat,Yt=re.focusSectionCamera;Vn.appendChild(pt),ct={container:t,model:n,opts:o,analytics:i,orbit:w,loop:F,seatsById:a,ensureSeatView:Be,resolvedSeatViewPose:lt,gpu:()=>c,gl:g.gl,isContextLost:()=>E,isDisposed:()=>M,flightGen:()=>re.flightGen(),setPanorama:m=>{y=m},getLoadAbort:()=>D,setLoadAbort:m=>{D=m},setPanoramaSphereVisible:m=>{j=m,m&&N?.exit()},setFrozen:m=>{C=m},raisePanoramaLayer:T,restorePanoramaLayer:_,getOverviewChip:()=>pt,labelOverlay:Z,reducedMotion:K,removeArriveChip:mt,showArriveChip:dt};let pe=Sn({glctx:g,orbit:w,model:n,seats:e.seats,opts:o,cinematic:U,analytics:i,seatIdByIndex:s,sectionIdBySeatId:u,tapSlop:li,tapMs:ci,gpu:()=>c,pick:()=>d,seatViewLocked:()=>Se.seatViewLocked(),focusedSectionId:()=>J,selection:()=>k,cancelFlight:Wt,focusSectionCamera:Yt,focusSeatCamera:re.focusSeatCamera,setSelection:B,ensureSeatView:Be});g.canvas.addEventListener("pointerdown",pe.onDown),g.canvas.addEventListener("pointermove",pe.onMove),g.canvas.addEventListener("pointerup",pe.onUp),g.canvas.addEventListener("pointercancel",pe.onUp),F.requestRender();let ht={setAvailability(m){let h=Bo(k,m),A=gt(n.seats,h);A.length&&c&&c.uploadSeatStateRuns(A),p(),F.requestRender()},setSelection:B,setNavigationMode:Ee,zoomIn(){w.zoomBy(.82),F.requestRender()},zoomOut(){w.zoomBy(1.22),F.requestRender()},flyToSeat:Ut,focusOverview:On,seatViewStop:()=>Re,recentreSeatView:()=>N?.recentre()??!1,resize(){let{width:m,height:h}=g.resize();w.setAspect(m/Math.max(1,h)),Dn(),In(),kn(),F.requestRender()},stats(){return{...F.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let m=F.stats(),h=g.canvas.clientWidth||1,A=g.canvas.clientHeight||1,H=n.bounds.center,X=fe(w.camera.projectionViewMatrix,[H[0],n.bounds.box.min[1],H[2]],h,A),Q=fe(w.camera.projectionViewMatrix,[H[0],n.bounds.box.max[1],H[2]],h,A),te=n.bounds.box,ne=[te.min[0],te.max[0]].flatMap(I=>[te.min[1],te.max[1]].flatMap(ae=>[te.min[2],te.max[2]].map(ce=>fe(w.camera.projectionViewMatrix,[I,ae,ce],h,A)))).filter(I=>Number.isFinite(I.x)&&Number.isFinite(I.y)&&Number.isFinite(I.depth)),ve=ne.length?(()=>{let I=Math.min(...ne.map(be=>be.x)),ae=Math.max(...ne.map(be=>be.x)),ce=Math.min(...ne.map(be=>be.y)),He=Math.max(...ne.map(be=>be.y)),Fe=Math.max(0,I),We=Math.min(h,ae),ue=Math.max(0,ce),De=Math.min(A,He),Ue=Math.max(0,We-Fe),ft=Math.max(0,De-ue);return{box:{x:Fe,y:ue,width:Ue,height:ft},horizontalFillRatio:Ue/h,verticalFillRatio:ft/A,visibleAreaRatio:Ue*ft/(h*A),clippedEdges:[...ce<0?["top"]:[],...ae>h?["right"]:[],...He>A?["bottom"]:[],...I<0?["left"]:[]]}})():void 0,he=String(g.gl.getParameter(g.gl.VERSION)??"");return{viewport:{width:h,height:A},context:{webgl2:/webgl\s*2/i.test(he),lost:E},frame:{rendered:m.rendered,idle:m.idle},camera:{position:[w.camera.position.x,w.camera.position.y,w.camera.position.z],distance:w.currentDistance,verticalFovDeg:w.fovY},scene:{seatCount:n.seatCount,floorCount:n.floors.length,zoneCount:n.zones.length,sectionCount:n.sections.length,authoredRelief:v,renderedVerticalSpanM:Math.max(0,n.bounds.box.max[1]-n.bounds.box.min[1]),projectedReliefPx:X.visible&&Q.visible?Math.abs(X.y-Q.y):0},labels:Z.qualityEvidence(),framing:ve,...Re?{seatView:{fovDeg:w.camera.fov,stop:Re}}:{}}},getQualityReport(){return Dt(ht.getQualityEvidence())},loseContextForTest(){g.simulateContextLossCycle()},floors(){return n.floors},focusFloor(m){if(m!==null&&!n.floors.some(A=>A.index===m))return!1;let h=m??-1;if(G(m!==null),Ge(!1),Ln(h),Ee("orbit"),m===null)U.cancel(),K()?w.frame(n.bounds,!1,b,o.portraitOverviewCrop===!0,z):w.frameSoft(n.bounds,b,o.portraitOverviewCrop===!0,z);else{let A=n.floors[m];if(A.seatCount>0){U.cancel();let H=A.focalWorld[0]-A.center[0],X=A.focalWorld[2]-A.center[2],Q=Math.hypot(H,X)>A.radius*.12?Math.atan2(H,X):b;w.frame({center:A.center,radius:A.radius,box:A.box},!1,Q,!1,{polarDeg:58,margin:1.12})}}return F.requestRender(),!0},zones(){return n.zones},focusZone(m){let h=n.zones.find(Q=>Q.id===m);if(!h||h.seatCount===0)return!1;G(!1),Ge(!1),U.cancel(),Ee("orbit"),V(null),o.onSectionFocusChange?.(null);let A=h.focalWorld[0]-h.center[0],H=h.focalWorld[2]-h.center[2],X=Math.hypot(A,H)>h.radius*.12?Math.atan2(A,H):void 0;return w.frame({center:h.center,radius:h.radius*1.25},!1,X),F.requestRender(),!0},sections(){return n.sections},focusSection(m){return Yt(m)},rows(m){return m?n.rows.filter(h=>h.sectionId===m):n.rows},seatsInRow(m){return e.seats.filter(h=>h.rowId===m).map(h=>({id:h.id,label:h.displayLabel||h.label}))},focusRow(m){let h=n.rows.find(A=>A.id===m);return!h||h.seatCount===0?!1:(G(!0),Ge(!1),U.cancel(),Ee("pan"),h.sectionId&&(V(h.sectionId),o.onSectionFocusChange?.(h.sectionId)),w.frame({center:h.center,radius:Math.max(2.5,h.radius*.65)}),F.requestRender(),!0)},setReducedMotionForTest(m){S=m},dispose(){M=!0,mt(),pt.remove(),Tn.remove(),Wt(),N?.dispose(),F.stop(),Z.dispose(),q?.disconnect(),y&&(y.dispose(),y=null),_(),ee(),g.canvas.removeEventListener("pointerdown",pe.onDown),g.canvas.removeEventListener("pointermove",pe.onMove),g.canvas.removeEventListener("pointerup",pe.onUp),g.canvas.removeEventListener("pointercancel",pe.onUp),w.dispose(),d&&d.dispose(),c&&c.dispose(),c=null,d=null,g.dispose()}};return i.opened(n.seatCount,v,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),ht}export{Kn as VENUE3D_QUALITY_REPORT_VERSION,Ie as buildSceneModel,Dt as inspectVenue3DQualityEvidence,is as mountVenue3D,ii as prepareVenue3D,ai as prepareVenue3DFromChart};
|
|
622
|
+
void main(){ if(vDim>0.5) discard; vec4 c=texture(uImage,vUv); if(c.a<0.01) discard; fragColor=c; }`,uniforms:{uImage:{value:ee},uFocusFloor:{value:-1}},transparent:!1,depthTest:!0,depthWrite:!0,cullFace:!1});let B=new ze(t,{geometry:$,program:U});B.frustumCulled=!1,B.setParent(o),oe.screenProgram=U,g=!0,oe.drawCalls=3+(X?1:0)+1},I.src=J.contentImageUrl}return oe}import{Mesh as _t,RenderTarget as Tr,Transform as Vt}from"ogl";function Fr(t,e,o){let r=t+(e<<8)+(o<<16);return r===0?-1:r-1}function Ho(t,e,o,r,n,i){let s=-1,a=1/0;for(let l=0;l<o;l++)for(let d=0;d<e;d++){let p=(l*e+d)*4,h=Fr(t[p],t[p+1],t[p+2]);if(h<0||h>=i)continue;let b=d-r,c=l-n,u=b*b+c*c;u<a&&(a=u,s=h)}return s}function Uo(t,e,o,r,n,i){let s=t-o.left,a=e-o.top,l=Math.round(s*r),d=Math.round((o.height-a)*r);return{x:Math.max(0,Math.min(n-1,l)),y:Math.max(0,Math.min(i-1,d))}}var Ir=["uSeatRadius","uSeatScale","uMinPixels","uPixelToWorld"],tt=class{constructor(e,o,r,n,i){this.seatScene=new Vt;this.chairScene=new Vt;this.solidScene=new Vt;this.target=null;this.restoreClear=[0,0,0];this.renderer=e,this.gl=e.gl,this.maxIndex=i,this.seatProg=Fo(this.gl),this.chairProg=To(this.gl),this.depthProg=Io(this.gl);let s=new _t(this.gl,{geometry:o,program:this.seatProg});s.frustumCulled=!1,s.setParent(this.seatScene);let a=new _t(this.gl,{geometry:r,program:this.chairProg});a.frustumCulled=!1,a.setParent(this.chairScene);let l=new _t(this.gl,{geometry:n,program:this.depthProg});l.frustumCulled=!1,l.setParent(this.solidScene)}setRestoreClear(e){this.restoreClear=[e[0],e[1],e[2]]}syncFromSeatProgram(e){for(let r of Ir)this.seatProg.uniforms[r].value=e.uniforms[r].value;let o=e.uniforms.uFocusFloor.value;this.seatProg.uniforms.uFocusFloor.value=o,this.chairProg.uniforms.uFocusFloor.value=o,this.depthProg.uniforms.uFocusFloor.value=o}ensureTarget(){let e=this.gl.drawingBufferWidth,o=this.gl.drawingBufferHeight;return this.target&&(this.target.width!==e||this.target.height!==o)&&this.destroyTarget(),this.target||(this.target=new Tr(this.gl,{width:e,height:o,depth:!0})),this.target}destroyTarget(){if(!this.target)return;let e=this.gl;this.target.buffer&&e.deleteFramebuffer(this.target.buffer);for(let o of this.target.textures??[])o.texture&&e.deleteTexture(o.texture);this.target.depthBuffer&&e.deleteRenderbuffer(this.target.depthBuffer),this.target=null}pick(e,o,r,n){let i=this.gl,s=this.ensureTarget(),a=i.drawingBufferWidth,l=i.drawingBufferHeight,d=Math.max(0,o-n),p=Math.max(0,r-n),h=Math.max(1,Math.min(a,o+n+1)-d),b=Math.max(1,Math.min(l,r+n+1)-p);i.enable(i.SCISSOR_TEST),i.scissor(d,p,h,b);let[c,u,P]=this.restoreClear;i.clearColor(0,0,0,1),this.renderer.render({scene:this.solidScene,camera:e,target:s,clear:!0}),this.renderer.render({scene:this.seatScene,camera:e,target:s,clear:!1}),this.renderer.render({scene:this.chairScene,camera:e,target:s,clear:!1}),i.clearColor(c,u,P,1),i.disable(i.SCISSOR_TEST);let D=new Uint8Array(h*b*4);return this.renderer.bindFramebuffer(s),i.readPixels(d,p,h,b,i.RGBA,i.UNSIGNED_BYTE,D),this.renderer.bindFramebuffer(),Ho(D,h,b,o-d,r-p,this.maxIndex)}dispose(){this.destroyTarget(),this.seatProg.remove(),this.chairProg.remove(),this.depthProg.remove()}};function Wo(t,e){let o=[];for(let r of e)t.has(r.seatId)?t.set(r.seatId,Zt(r.state)):o.push(r);return o}function Yo(t,e,o){let r=new Set;for(let s of e)(t.has(s)||o(s)!==void 0)&&r.add(s);let n=new Map(t),i=[];for(let[s,a]of t)r.has(s)||(i.push({seatId:s,state:me[a]??"available"}),n.delete(s));for(let s of r){if(n.has(s))continue;let a=o(s);a!==void 0&&(n.set(s,a),i.push({seatId:s,state:"selected"}))}return{updates:i,next:n}}import{Quat as Ne,Vec3 as Lr}from"ogl";function _r(t,e){return[t[0]-e[0],t[1]-e[1],t[2]-e[2]]}function Xo(t,e){return[t[0]+e[0],t[1]+e[1],t[2]+e[2]]}function Vr(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function qo(t){let e=Math.hypot(t[0],t[1],t[2]);return e>1e-6?[t[0]/e,t[1]/e,t[2]/e]:[0,0,0]}function Lt(t){let e=Math.max(0,Math.min(1,t));return e*e*e*(e*(e*6-15)+10)}function kt(t,e){return Math.max(0,Math.min(1,t+e))}function jo(t,e){let o=t.length;if(o===0)return[0,0,0];if(o===1)return[...t[0]];let r=Math.max(0,Math.min(1,e)),n=o-1,i=Math.floor(r*n);i>=n&&(i=n-1);let s=r*n-i,a=t[Math.max(0,i-1)],l=t[i],d=t[i+1],p=t[Math.min(o-1,i+2)],h=s*s,b=h*s,c=[0,0,0];for(let u=0;u<3;u++)c[u]=.5*(2*l[u]+(-a[u]+d[u])*s+(2*a[u]-5*l[u]+4*d[u]-p[u])*h+(-a[u]+3*l[u]-3*d[u]+p[u])*b);return c}function Ot(t,e,o,r,n){let i=qo(_r(e,o));i[0]===0&&i[1]===0&&i[2]===0&&(i=[0,0,1]);let s=Xo(Xo(e,Vr(i,2.5)),[0,1.5,0]),a=[e[0]-r[0],0,e[2]-r[2]],l=qo(a);l[0]===0&&l[2]===0&&(l=[i[0],0,i[2]]);let d=Math.max(1,n),p=[r[0]+l[0]*d*1.3,r[1]+d*.75,r[2]+l[2]*d*1.3];return{waypoints:[t,p,s],finalPos:s}}function zt(t,e,o=35,r=28){let n=Lt(e),i=jo(t,n),s=Lt(Math.max(0,Math.min(1,(e-.66)/.34)));return{pos:i,fov:o+(r-o)*s,eased:n}}function Zo(t,e,o){let r=t.position.clone(),n=new Ne().copy(t.quaternion);t.position.set(e[0],e[1],e[2]),t.lookAt(new Lr(o[0],o[1],o[2]));let i=new Ne().copy(t.quaternion);return t.position.copy(r),t.quaternion.copy(n),i}var ot=class{constructor(e){this.active=!1;this.waypoints=[];this.startQuat=new Ne;this.endQuat=new Ne;this.outQuat=new Ne;this.startTime=0;this.duration=2500;this.endFov=28;this.resolveFn=null;this.camera=e}start(e,o,r,n=2500,i=28){return this.settle(),this.waypoints=e,this.startQuat.copy(o),this.endQuat.copy(r),this.duration=n,this.endFov=i,this.startTime=performance.now(),this.active=!0,new Promise(s=>{this.resolveFn=s})}update(e){if(!this.active)return!1;let o=Math.min(1,(e-this.startTime)/this.duration),{pos:r,fov:n,eased:i}=zt(this.waypoints,o,35,this.endFov);return this.camera.position.set(r[0],r[1],r[2]),this.outQuat.copy(this.startQuat).slerp(this.endQuat,kt(i,.15)),this.camera.quaternion.copy(this.outQuat),this.camera.fov=n,this.camera.updateProjectionMatrix(),o>=1?(this.settle(),!1):!0}cancel(){this.settle()}settle(){this.active=!1;let e=this.resolveFn;this.resolveFn=null,e&&e()}};var Jo=eo,kr=.12,Or=.25,zr=1.5;function en(t,e,o=0,r,n){let i=[e.x*Me,o+zr,e.y*Me],s=n?[n[0],n[1],n[2]]:i,a=t[1],l=Number.isFinite(a)?a+Jo:Number.isFinite(r)?o+r:o+Jo,d=i[0]-t[0],p=i[2]-t[2],h=Math.hypot(d,p),b=h>.001?Math.min(kr,h*Or):0,c=h>.001?d/h:0,u=h>.001?p/h:0;return{eye:[t[0]+c*b,l,t[2]+u*b],focal:s}}var we=Math.PI/180,Nr=45,tn=80,nt=70,Br=1,Gr=.99;function Hr(t,e){if(!(t<Br))return tn;if(!(Number.isFinite(e)&&e>0))return nt;let o=2*Math.atan(e/(2*rt*Gr)/Math.max(.05,t))/we;return Math.max(nt,Math.min(tn,o))}var Ur=.25,rt=1,Wr=.25,Yr=12*we,Xr=.2,qr=1.5,on=.8,nn=6,ln=1.9,jr=2/3,Kr=.12,Qr=.9,$r=1.2,Zr=2,cn=.05,Jr=6;function un(t,e,o=0){if(!t.length)return{min:[e[0]-6,o,e[2]-6],max:[e[0]+6,Math.max(o+on,e[1]),e[2]+6]};let r=1/0,n=-1/0,i=1/0,s=-1/0,a=o;for(let u of t)r=Math.min(r,u.cx-u.halfX),n=Math.max(n,u.cx+u.halfX),i=Math.min(i,u.cz-u.halfZ),s=Math.max(s,u.cz+u.halfZ),a=Math.max(a,u.y);let l=n-r,d=s-i,p=Math.max(l,Math.min(d,nn))/2,h=Math.max(d,Math.min(l,nn))/2,b=(r+n)/2,c=(i+s)/2;return{min:[b-p,o,c-h],max:[b+p,Math.max(o+on,a),c+h]}}function ei(t){return{min:[t.min[0],t.min[1],t.min[2]],max:[t.max[0],t.max[1]+ln,t.max[2]]}}function Nt(t){let e=t.max[1];return[(t.min[0]+t.max[0])/2,Math.max(t.min[1]+qr,e+Xr,e+ln*jr),(t.min[2]+t.max[2])/2]}function dn(t,e){let o=t[0]-e[0],r=t[2]-e[2],n=Math.hypot(o,r);return n<.001?{x:0,z:1}:{x:o/n,z:r/n}}function rn(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=1/0,h=-1/0;for(let b=0;b<8;b++){let c=(b&1?o.max[0]:o.min[0])-t[0],u=(b&2?o.max[1]:o.min[1])-t[1],P=(b&4?o.max[2]:o.min[2])-t[2],D=Math.max(cn,c*r+u*n+P*i),A=(c*a+P*l)/D;A<p&&(p=A),A>h&&(h=A)}return h-p}function an(t,e,o){let r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],s=Math.hypot(r,n,i)||1;r/=s,n/=s,i/=s;let a=-i,l=r,d=Math.hypot(a,l);if(d<1e-6)return 1/0;a/=d,l/=d;let p=-l*n,h=l*r-a*i,b=a*n,c=1/0,u=-1/0;for(let P=0;P<8;P++){let D=(P&1?o.max[0]:o.min[0])-t[0],A=(P&2?o.max[1]:o.min[1])-t[1],k=(P&4?o.max[2]:o.min[2])-t[2],f=Math.max(cn,D*r+A*n+k*i),M=(D*p+A*h+k*b)/f;M<c&&(c=M),M>u&&(u=M)}return u-c}function it(t,e){return Math.tan(t*we/2)*Math.max(.05,e)}function sn(t,e,o){let r=Hr(o,t),n=l=>Math.max(Nr,Math.min(r,l)),i=l=>2*Math.atan(l)/we,s=Number.isFinite(t)&&t>0?n(i(t/(2*Ur)/Math.max(.05,o))):r;if(!(Number.isFinite(e)&&e>0))return s;let a=Math.min(s,n(i(e/(2*Kr))));return t/(2*it(a,o))>rt?s:a}function mn(t,e,o){let r=Nt(e),n=[t[0],t[1],t[2]],i=0,s=0,a=c=>{if(!(c>0))return;let u=dn(n,r);n[0]+=u.x*c,n[2]+=u.z*c,s+=c},l=e.max[1]+Wr-n[1];l>0&&(n[1]+=l,i=l,a(l/Math.tan(Yr)));let d=ei(e),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o));for(let c=0;c<Jr&&b>rt;c++){let u=Math.max(1,Math.hypot(n[0]-r[0],n[2]-r[2])),P=Number.isFinite(b)?b/rt:2;a(Math.min(60,u*(Math.min(4,P)-1)+.5)),p=rn(n,r,e),h=sn(p,an(n,r,d),o),b=p/(2*it(h,o))}return{eye:n,focal:r,fov:h,raisedM:i,pulledBackM:s,stageFrameWidth:b}}function ti(t,e,o){let r=Math.tan(e*we/2),n=it(e,o);return Math.max(1,t/Math.max(.05,Math.min(r,n)))}function pn(t,e){let{aspect:o,venue:r}=e,n=t.focal,i=dn(t.eye,n),s=b=>(b[0]-n[0])*i.x+(b[2]-n[2])*i.z,a=[{name:"seat",eye:t.eye,focal:n,fov:t.fov}],l=Zr*(e.rowDepthM??Qr);a.push({name:"row",eye:[t.eye[0]+i.x*l,t.eye[1]+$r,t.eye[2]+i.z*l],focal:n,fov:t.fov});let d=(b,c,u,P)=>{let D=ti(u,t.fov,o)*1.08,A=D*Math.sin(P*we),k=D*Math.cos(P*we);return{name:b,eye:[c[0]+i.x*k,c[1]+A,c[2]+i.z*k],focal:c,fov:t.fov}};e.section&&e.section.radius>0&&a.push(d("section",e.section.center,e.section.radius,14)),a.push(d("venue",r.center,Math.max(1,r.radius),26));let p=[],h=-1/0;for(let b of a){let c=s(b.eye);p.length&&c<=h+.5||(p.push(b),h=c)}return p}import{Vec3 as oi}from"ogl";var Ge=Math.PI/180,hn=320,fn=70*Ge,ni=32*Ge,ri=24*Ge,vn=.0026,ii=.22,ai=.006,si=180,li=4,se=(t,e,o)=>Math.max(e,Math.min(o,t)),bn=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2;function gn(t){let{canvas:e,camera:o}=t,r=[],n=!1,i=0,s=0,a=0,l=0,d=0,p=0,h=!1,b=[0,0],c=0,u=!1,P=null,D=null,A=new Map,k=!1,f=0,M=0,C=0,O=0,x=()=>n&&r.length?r[se(Math.round(i),0,r.length-1)].name:null,w=()=>{let g=x();g!==P&&(P=g,t.onStopChange?.(g))},T=()=>{if(!n||!r.length)return;let g=r[se(Math.floor(i),0,r.length-1)],z=r[se(Math.ceil(i),0,r.length-1)],$=se(i-Math.floor(i),0,1),U=(ve,ct)=>ve+(ct-ve)*$,ee=[U(g.eye[0],z.eye[0]),U(g.eye[1],z.eye[1]),U(g.eye[2],z.eye[2])],Z=[U(g.focal[0],z.focal[0]),U(g.focal[1],z.focal[1]),U(g.focal[2],z.focal[2])],le=Z[0]-ee[0],oe=Z[1]-ee[1],J=Z[2]-ee[2],I=Math.hypot(le,oe,J)||1,N=Math.atan2(le,J),B=Math.asin(se(oe/I,-1,1)),_=N+s,G=se(B+a,-80*Ge,80*Ge),Q=Math.cos(G)*I;le=Math.sin(_)*Q,oe=Math.sin(G)*I,J=Math.cos(_)*Q,o.position.set(ee[0],ee[1],ee[2]),o.fov=U(g.fov,z.fov),o.updateProjectionMatrix(),o.lookAt(new oi(ee[0]+le,ee[1]+oe,ee[2]+J)),t.onApplied?.()},L=()=>{if(!n||!r.length)return;let g=se(Math.round(i),0,r.length-1);if(t.reducedMotion()){h=!1,i=g,T(),w(),t.requestRender();return}if(Math.abs(g-i)<.001){h=!1,w();return}l=i,d=g,p=performance.now(),h=!0,t.requestRender()},R=g=>{!n||r.length<2||(h=!1,i=se(i+g,0,r.length-1),T(),w(),t.requestRender())},K=(g,z)=>{n&&(h=!1,u=!1,s=se(s-g*vn,-fn,fn),a=se(a-z*vn,-ri,ni),T(),t.requestRender())},H=g=>{n&&(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size===1?(k=!0,O=0,f=g.clientX,M=g.clientY):A.size===2&&(k=!1,C=V()))},V=()=>{let g=[...A.values()];return g.length<2?0:Math.hypot(g[0].x-g[1].x,g[0].y-g[1].y)},Y=g=>{if(!n||!A.has(g.pointerId))return;if(A.set(g.pointerId,{x:g.clientX,y:g.clientY}),A.size>=2){let U=V();C>0&&R((C-U)*ai),C=U;return}if(!k)return;let z=g.clientX-f,$=g.clientY-M;f=g.clientX,M=g.clientY,O+=Math.abs(z)+Math.abs($),!(O<=li)&&K(z,$)},y=g=>{A.delete(g.pointerId)&&(A.size<2&&(C=0),A.size===0&&(k=!1,L()))},S=g=>{if(!n)return;g.preventDefault();let z=g.deltaMode===1?16:g.deltaMode===2?100:1,$=se(g.deltaY*z/100,-2,2);R($*ii),D&&clearTimeout(D),D=setTimeout(()=>{D=null,L()},si)},X=()=>{n&&(n=!1,h=!1,u=!1,r=[],A.clear(),k=!1,D&&(clearTimeout(D),D=null),P!==null&&(P=null,t.onStopChange?.(null)))};return e.addEventListener("pointerdown",H),e.addEventListener("pointermove",Y),e.addEventListener("pointerup",y),e.addEventListener("pointercancel",y),e.addEventListener("wheel",S,{passive:!1}),{get active(){return n},enter(g){if(g.length<2){X();return}r=g,n=!0,i=0,s=0,a=0,h=!1,u=!1,P=null,T(),w(),t.requestRender()},exit:X,recentre(){return n?Math.abs(s)<1e-4&&Math.abs(a)<1e-4?!0:t.reducedMotion()?(u=!1,s=0,a=0,T(),t.requestRender(),!0):(b=[s,a],c=performance.now(),u=!0,t.requestRender(),!0):!1},update(g){if(!n)return!1;let z=!1;if(u){let $=se((g-c)/hn,0,1),U=1-bn($);s=b[0]*U,a=b[1]*U,$>=1?(u=!1,s=0,a=0):z=!0}if(h){let $=se((g-p)/hn,0,1);i=l+(d-l)*bn($),$>=1?(h=!1,i=d,w()):z=!0}return T(),z},currentStop:x,dispose(){X(),e.removeEventListener("pointerdown",H),e.removeEventListener("pointermove",Y),e.removeEventListener("pointerup",y),e.removeEventListener("pointercancel",y),e.removeEventListener("wheel",S)}}}function yn(t){return t.flying?"cinematic":t.panoramaMounted?"panorama":t.seatViewActive?"seatView":"orbit"}var Bt=null;function xn(){return Bt??=import("../openPanorama-6FMXAJ6O.js").catch(t=>{throw Bt=null,t}),Bt}var Sn=()=>typeof performance<"u"&&performance.now?performance.now():Date.now(),at=class{constructor(e){this.orbitLatched=!1;this.panoramaOpenedAt=0;this.cb=e}emit(e,o){if(this.cb)try{this.cb(e,o)}catch{}}opened(e,o,r,n){this.emit("3d_opened",{seats:e,hasHeights:o,...r===void 0?{}:{buildMs:Math.round(r)},...n===void 0?{}:{prepSource:n}})}orbitEngaged(){this.orbitLatched||(this.orbitLatched=!0,this.emit("3d_orbit_engaged"))}seatPicked(e,o){this.emit("3d_seat_picked",{seatId:e,sectionId:o})}cinematicPlayed(e){this.emit("3d_cinematic_played",{durationMs:e,reducedMotion:!1})}cinematicSkipped(){this.emit("3d_cinematic_skipped",{reducedMotion:!0})}cinematicCancelled(){this.emit("3d_cinematic_cancelled")}panoramaOpened(){this.panoramaOpenedAt=Sn(),this.emit("3d_panorama_opened")}panoramaClosed(){let e=this.panoramaOpenedAt?Math.round(Sn()-this.panoramaOpenedAt):0;this.panoramaOpenedAt=0,this.emit("3d_panorama_closed",{viewMs:e})}panoramaFailed(e,o){this.emit("3d_panorama_failed",{seatId:e,phase:o})}panoramaFallback(e){this.emit("3d_panorama_fallback",{seatId:e})}contextLost(){this.emit("3d_context_lost")}contextRestored(){this.emit("3d_context_restored")}};function wn(t){let e=t.style.position;return getComputedStyle(t).position!=="static"?()=>{}:(t.style.position="relative",()=>{t.style.position==="relative"&&(t.style.position=e)})}function Mn(t){let{container:e,model:o,opts:r,expandedSeatById:n,seatIdsByRow:i,isNarrow:s}=t,a=null,l=()=>{if(!a)return;let h=s();Object.assign(a.style,h?{left:"12px",right:"12px",bottom:"70px",transform:"none",justifyContent:"center"}:{left:"50%",right:"auto",bottom:"18px",transform:"translateX(-50%)",justifyContent:"initial"})},d=()=>{a?.remove(),a=null};return{show:(h,b,c=!1)=>{if(d(),t.isDisposed())return null;let u=document.createElement("div");u.setAttribute("role","group"),Object.assign(u.style,{position:"absolute",display:"flex",flexDirection:"column",alignItems:"center",gap:"6px",zIndex:"4"});let P=r.chrome?.caption!==!1,D=r.chrome?.seatStepper!==!1;if(!P&&!D)return null;let A=n.get(h),k=A?.sectionId?o.sections.find(L=>L.id===A.sectionId):void 0,f=A?.label??h;u.setAttribute("aria-label",`Explore views near ${k?.label?`${k.label}, `:""}seat ${f}`);let M=document.createElement("span");M.textContent=r.seatViewCaption?.(h)??["Live 3D seat view",k?.label,f].filter(Boolean).join(" \xB7 "),Object.assign(M.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&&u.appendChild(M);let C=document.createElement("div");Object.assign(C.style,{display:"flex",alignItems:"center",justifyContent:"center",gap:"6px"}),u.appendChild(C);let O=A?.rowId?i.get(A.rowId):void 0,x=O?.indexOf(h)??-1,w=x>=0?[O?.[x-1],O?.[x+1]]:[void 0,void 0],T=(L,R,K,H=!1)=>{let V=document.createElement("button");V.type="button",V.textContent=L,V.setAttribute("aria-label",R),Object.assign(V.style,{minHeight:"44px",padding:H?"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"}),H||(V.style.minWidth="44px"),H&&(V.dataset.panoramaTrigger=""),V.addEventListener("click",K),C.appendChild(V)};if(D&&w[0]){let L=n.get(w[0])?.label??w[0];T("\u2039",`View previous seat ${L}`,()=>{t.flyToSeat(w[0])})}if(D&&r.getSeatView){let L=r.seatViewActionLabel?.(h)??"Open 360\xB0 panorama";T(c?`\u21BB Retry ${L}`:`\u25C9 ${L}`,`${c?"Retry":L} from seat ${f}`,()=>{if(t.isDisposed()||b!==t.flightGen()){d();return}d(),t.openPanorama(h,400,b)},!0)}if(D&&w[1]){let L=n.get(w[1])?.label??w[1];T("\u203A",`View next seat ${L}`,()=>{t.flyToSeat(w[1])})}return!C.childElementCount&&!P?null:(e.appendChild(u),a=u,l(),u)},remove:d,layout:l}}var ci={rotate:"Drag to rotate the venue",move:"Drag to move the venue",zoomIn:"Zoom in",zoomOut:"Zoom out",fitView:"Show whole venue"};function Pn(t){let{container:e,orbit:o,isNarrow:r}=t,n={...ci,...t.labels??{}},i=(f,M)=>{f.setAttribute("aria-label",M),f.title=M},s=document.createElement("div"),a=!1;s.className="sl-3d-navigation-controls",Object.assign(s.style,{position:"absolute",right:"14px",bottom:"14px",display:"flex",zIndex:"4",flexDirection:"column",alignItems:"flex-end",gap:"7px"});let l=document.createElement("div");l.setAttribute("role","group"),l.setAttribute("aria-label","3D drag mode"),Object.assign(l.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let d=document.createElement("div");d.setAttribute("role","group"),d.setAttribute("aria-label","3D view controls"),Object.assign(d.style,{display:"flex",flexDirection:"column",gap:"6px",alignItems:"flex-end"});let p=document.createElement("button");p.type="button",p.textContent="\u21BB",i(p,n.rotate);let h=document.createElement("button");h.type="button",h.textContent="\u2725",i(h,n.move);let b=document.createElement("button");b.type="button",b.textContent="\u2212",i(b,n.zoomOut);let c=document.createElement("button");c.type="button",c.textContent="+",i(c,n.zoomIn);for(let f of[p,h,b,c])f.className="sl-3d-icon-control",Object.assign(f.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"});l.append(p,h),d.append(c,b);let u=f=>{o.setPrimaryDragMode(f);let M=f==="orbit";p.setAttribute("aria-pressed",String(M)),h.setAttribute("aria-pressed",String(!M)),p.style.background=M?"rgba(96,110,150,0.68)":"rgba(12,18,32,0.82)",h.style.background=M?"rgba(12,18,32,0.82)":"rgba(96,110,150,0.68)",s.title=M?`${n.rotate} \xB7 ${n.move} with Shift`:`${n.move} \xB7 ${n.rotate} with Shift`};p.addEventListener("click",()=>u("orbit")),h.addEventListener("click",()=>u("pan"));let P=()=>{let{atMin:f,atMax:M}=o.dollyLimitState();c.disabled!==f&&(c.disabled=f),b.disabled!==M&&(b.disabled=M)};b.addEventListener("click",()=>{o.zoomBy(Le),P()}),c.addEventListener("click",()=>{o.zoomBy(Ce),P()}),s.append(l,d),u("orbit"),e.appendChild(s);let D=t.enabled!==!1,A=()=>{let f=r();s.style.display=a||!D?"none":"flex",s.style.right=f?"12px":"14px",s.style.bottom=f?"calc(env(safe-area-inset-bottom, 0px) + 76px)":"14px",l.style.display=f?"none":"flex",c.style.display=f?"none":"",b.style.display=f?"none":""};return A(),{element:s,utilityControls:d,setNavigationMode:u,syncZoomLimits:P,setSeatViewLocked:f=>{a=f,o.setInteractionEnabled(!f),A()},seatViewLocked:()=>a,layout:A}}var ui=12;function di(t,e){if(!t)return!1;let o=t.x-e[0],r=t.y-e[1],n=t.z-e[2];return Math.hypot(o,r,n)>ui}function Cn(t){let{glctx:e,orbit:o,model:r,seats:n,opts:i,cinematic:s,analytics:a,seatIdByIndex:l,sectionIdBySeatId:d,tapSlop:p,tapMs:h,cancelFlight:b,focusSectionCamera:c,setSelection:u,ensureSeatView:P}=t,D=0,A=0,k=0,f=-1,M=!1,C=!1,O=R=>{t.seatViewLocked()||f===-1&&(f=R.pointerId,D=R.clientX,A=R.clientY,k=performance.now(),M=!1,C=s.active,s.active&&(a.cinematicCancelled(),b(),i.onViewTargetChange?.(null)))},x=R=>{R.pointerId===f&&Math.hypot(R.clientX-D,R.clientY-A)>p&&(M=!0)},w=(R,K,H,V,Y)=>{let y=e.canvas.getBoundingClientRect(),S=e.canvas.clientWidth||y.width||1,X=e.canvas.clientHeight||y.height||1,g=R-y.left,z=K-y.top,$=V*V,U=-1,ee=$,Z=1/0;for(let le of n){if(H&&le.sectionId!==H)continue;let oe=r.seats.idToIndex.get(le.id);if(oe===void 0)continue;if(Y){let G=Math.round(r.seats.iState[oe]??0);if(G!==0&&G!==3)continue}let J=oe*3,I=fe(o.camera.projectionViewMatrix,[r.seats.iPosition[J],r.seats.iPosition[J+1]+.55,r.seats.iPosition[J+2]],S,X);if(!I.visible)continue;let N=I.x-g,B=I.y-z,_=N*N+B*B;(_<ee||Math.abs(_-ee)<1&&I.depth<Z)&&(U=oe,ee=_,Z=I.depth)}return U},T=(R,K)=>{let H=t.gpu(),V=t.pick();if(!H||!V)return-1;V.syncFromSeatProgram(H.seatProgram);let Y=e.canvas.getBoundingClientRect(),y=e.renderer.dpr,{x:S,y:X}=Uo(R,K,Y,y,e.gl.drawingBufferWidth,e.gl.drawingBufferHeight),g=Math.max(2,Math.round(8*y));return V.pick(o.camera,S,X,g)};return{onDown:O,onMove:x,onUp:R=>{if(R.pointerId!==f)return;let K=!M&&performance.now()-k<h;if(f=-1,C){C=!1;return}let H=t.gpu(),V=t.pick();if(!K||!H||!V)return;let Y=T(R.clientX,R.clientY);if(t.focusedSectionId()&&Y>=0){let X=l[Y],g=X?d.get(X):void 0;if(g&&g!==t.focusedSectionId()&&c(g))return}if(t.focusedSectionId()&&Y<0&&(Y=w(R.clientX,R.clientY,t.focusedSectionId(),44,!1)),t.focusedSectionId()&&Y<0){let X=w(R.clientX,R.clientY,null,72,!1),g=X>=0?l[X]:void 0,z=g?d.get(g):void 0;if(z&&z!==t.focusedSectionId()&&c(z))return}if(!t.focusedSectionId()){Y<0&&(Y=w(R.clientX,R.clientY,null,42,!1));let X=Y>=0?l[Y]:void 0,g=X?d.get(X):void 0;if(g&&c(g))return}if(Y<0||Y>=l.length){t.selection().size&&(u([]),i.onViewTargetChange?.(null));return}let y=l[Y],S=me[Math.round(r.seats.iState[Y]??0)]??"available";if(S!=="available"&&S!=="selected"){i.onSeatInspect?.(y,S);return}if(t.selection().has(y)&&t.selection().size===1){u([]),i.onViewTargetChange?.(null),i.onSeatPick?.(y);return}if(u([y]),P(y),a.seatPicked(y,d.get(y)),i.onSeatPick?.(y),t.focusedSectionId()){let X=Y*3,g=[r.seats.iPosition[X],r.seats.iPosition[X+1],r.seats.iPosition[X+2]];di(o.camera?.position,g)&&t.focusSeatCamera(y)}}}}var st=class{constructor(e,o){this.minX=0;this.minZ=0;this.cell=1;this.cols=1;this.rows=1;this.cellStart=null;this.cellItems=null;this.iPosition=e,this.count=o}ensureGrid(){if(this.cellStart||this.count===0)return;let e=this.iPosition,o=1/0,r=1/0,n=-1/0,i=-1/0;for(let c=0;c<this.count;c++){let u=e[c*3],P=e[c*3+2];u<o&&(o=u),u>n&&(n=u),P<r&&(r=P),P>i&&(i=P)}let s=Math.max(n-o,.001),a=Math.max(i-r,.001);this.cell=Math.max(Math.sqrt(s*a*4/this.count),.25),this.cols=Math.max(1,Math.ceil(s/this.cell)+1),this.rows=Math.max(1,Math.ceil(a/this.cell)+1),this.minX=o,this.minZ=r;let l=this.cols*this.rows,d=new Int32Array(l+1),p=c=>{let u=Math.min(this.cols-1,Math.max(0,Math.floor((e[c*3]-o)/this.cell)));return Math.min(this.rows-1,Math.max(0,Math.floor((e[c*3+2]-r)/this.cell)))*this.cols+u};for(let c=0;c<this.count;c++)d[p(c)+1]++;for(let c=0;c<l;c++)d[c+1]+=d[c];let h=new Int32Array(this.count),b=d.slice(0,l);for(let c=0;c<this.count;c++)h[b[p(c)]++]=c;this.cellStart=d,this.cellItems=h}gather(e,o,r,n){this.ensureGrid();let i=this.cellStart,s=this.cellItems;if(!i||!s)return 0;let a=n.length,l=r*r,d=Math.floor((e-this.minX)/this.cell),p=Math.floor((o-this.minZ)/this.cell),h=Math.ceil(r/this.cell)+1,b=this.iPosition,c=0;for(let u=0;u<=h&&c<a;u++){let P=p-u,D=p+u,A=d-u,k=d+u;for(let f=P;f<=D&&c<a;f++){if(f<0||f>=this.rows)continue;let M=f===P||f===D;for(let C=A;C<=k&&c<a;C++){if(!M&&C!==A&&C!==k){C=k-1;continue}if(C<0||C>=this.cols)continue;let O=f*this.cols+C;for(let x=i[O],w=i[O+1];x<w&&c<a;x++){let T=s[x],L=b[T*3]-e,R=b[T*3+2]-o;L*L+R*R<=l&&(n[c++]=T)}}}}return c}};var lt=class{constructor(e){this.ctx=e;this.detailVisible=!1;this.seatDetailMix=0;this.structureDetailMix=0;this.nearBuf=new Int32Array(Qe);this.lastGatherX=1/0;this.lastGatherZ=1/0;this.nearIndex=new st(e.model.seats.iPosition,e.model.seats.count)}forceRegather(){this.lastGatherX=1/0}setDetailEnabled(e){let o=this.ctx.gpu();e||(this.detailVisible=!1),this.lastGatherX=1/0,this.lastGatherZ=1/0,!e&&o?.nearSeatCount()&&o.setNearSeats(this.nearBuf,0)}update(e){let{model:o}=this.ctx,r=this.ctx.gpu();if(!r)return;if(!e){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let n=this.ctx.orbit().camera.position;if(Math.hypot(n.x-this.lastGatherX,n.z-this.lastGatherZ)<At)return;if(this.lastGatherX=n.x,this.lastGatherZ=n.z,Math.hypot(n.x-o.bounds.center[0],n.z-o.bounds.center[2])-o.bounds.radius>Ct){r.nearSeatCount()&&r.setNearSeats(this.nearBuf,0);return}let a=this.nearIndex.gather(n.x,n.z,Ct,this.nearBuf);a===0&&r.nearSeatCount()===0||r.setNearSeats(this.nearBuf,a)}ease(e,o,r){let n=1-Math.exp(-e*9),i=1-Math.exp(-e*20);this.seatDetailMix+=(o-this.seatDetailMix)*(o>this.seatDetailMix?n:i),this.structureDetailMix+=(r-this.structureDetailMix)*(r>this.structureDetailMix?n:i),Math.abs(o-this.seatDetailMix)<.01&&(this.seatDetailMix=o),Math.abs(r-this.structureDetailMix)<.01&&(this.structureDetailMix=r)}};import{Quat as mi,Vec3 as pi}from"ogl";function An(){let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("width","18"),e.setAttribute("height","18"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round");let o=document.createElementNS(t,"path");return o.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"),e.appendChild(o),e}function Dn(t){let{container:e,model:o,opts:r,orbit:n,cinematic:i,analytics:s,loop:a,labelOverlay:l,stageAzimuth:d,overviewFraming:p}=t,h=0,b=-1,c=(x,w,T=28)=>{n.camera.position.set(x[0],x[1],x[2]),n.camera.lookAt(new pi(w[0],w[1],w[2])),n.camera.fov=T,n.camera.updateProjectionMatrix()},u=document.createElement("button");u.className="sl-3d-overview-control sl-3d-icon-control",u.type="button",u.replaceChildren(An());let P=r.navLabels?.fitView??"Show whole venue";u.setAttribute("aria-label",P),u.title=P,Object.assign(u.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 D=()=>{u.firstElementChild||u.replaceChildren(An())};D();let A=x=>{b=x;let w=t.gpu();w&&(w.seatProgram.uniforms.uFocusFloor.value=x,w.solidProgram.uniforms.uFocusFloor.value=x,w.chairProgram.uniforms.uFocusFloor.value=x),t.showSectionSeatLabels(null)},k=()=>{if(t.isDisposed())return;r.onViewTargetChange?.(null),r.onSectionFocusChange?.(null),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),s.panoramaClosed()),t.setPanoramaSphereVisible(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.restorePanoramaLayer(),u.style.display="",l.setVisible(!0),t.setFrozen(!1);let x=b>=0?o.floors[b]:null;if(t.setNearFieldDetailEnabled(!!x),t.setSeatViewLocked(!1),f(),t.removeArriveChip(),t.setNavigationMode("orbit"),x){let w=x.focalWorld[0]-x.center[0],T=x.focalWorld[2]-x.center[2],L=Math.hypot(w,T)>x.radius*.12?Math.atan2(w,T):d,R={center:x.center,radius:x.radius,box:x.box},K={polarDeg:58,margin:1.12};t.reducedMotion()?n.frame(R,!1,L,!1,K):n.frameSoft(R,L,!1,K)}else t.reducedMotion()?n.frame(o.bounds,!1,d,r.portraitOverviewCrop===!0,p):n.frameSoft(o.bounds,d,r.portraitOverviewCrop===!0,p);t.showSectionSeatLabels(null),a.requestRender()},f=()=>{h++,t.setSeatStepping(!1),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),i.active&&(i.cancel(),n.resumeAfterFlight(o.focalWorld))},M=x=>{if(t.isDisposed()||!t.gpu())return Promise.resolve();let w=o.seats.idToIndex.get(x);if(w===void 0)return Promise.resolve();t.setNearFieldDetailEnabled(!0),r.onViewTargetChange?.(x),t.panorama()&&(t.panorama().dispose(),t.setPanorama(null),t.setPanoramaSphereVisible(!1),u.style.display="",t.restorePanoramaLayer()),t.panoramaLoadAbort()?.abort(),t.setPanoramaLoadAbort(null),t.setFrozen(!1);let T=t.inSeatView()&&r.arriveAtSeatEye===!0;t.setSeatStepping(T),t.setSeatViewLocked(!1);let L=++h;T?t.showArriveChip(x,L):t.removeArriveChip();let{eye:R,focal:K}=t.resolvedSeatViewPose(x,w),H=r.arriveAtSeatEye?t.seatViewArrival(x,w):null,V=H?H.focal:K,Y=[n.camera.position.x,n.camera.position.y,n.camera.position.z],y=Ot(Y,H?.eye??R,V,o.bounds.center,o.bounds.radius),S=H?H.eye:r.arriveAtSeatEye?R:y.finalPos,X=H?H.fov:r.arriveAtSeatEye?e.clientWidth/Math.max(1,e.clientHeight)<.7?nt:65:28,g=[y.waypoints[0],y.waypoints[1],S];if(l.setVisible(!1),t.reducedMotion())return t.setSeatStepping(!1),c(S,V,X),a.requestRender(),s.cinematicSkipped(),t.isDisposed()||n.syncFromCamera(),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),t.showArriveChip(x,L),Promise.resolve();let z=new mi().copy(n.camera.quaternion),$=Zo(n.camera,S,V);a.requestRender();let U=T?700:2500;return i.start(g,z,$,U,X).then(()=>{t.isDisposed()||L!==h||(t.setSeatStepping(!1),s.cinematicPlayed(U),n.resumeAfterFlight(V),t.setSeatViewLocked(r.arriveAtSeatEye===!0),H&&t.enterSeatView(H.stops),a.requestRender(),t.showArriveChip(x,L))})},C=x=>{let w=o.sections.find(K=>K.id===x);if(!w||w.seatCount===0)return!1;t.setNearFieldDetailEnabled(!0),t.setSeatStepping(!1),t.setSeatViewLocked(!1),i.cancel(),t.removeArriveChip(),o.floors.length>1&&b!==w.floorIndex&&A(w.floorIndex),t.setNavigationMode("pan"),t.showSectionSeatLabels(x);let T=w.focalWorld[0]-w.center[0],L=w.focalWorld[2]-w.center[2],R=Math.hypot(T,L)>w.radius*.12?Math.atan2(T,L):void 0;return n.frame({center:w.center,radius:Math.max(5,w.radius*.5)},!1,R),r.onSectionFocusChange?.(x),a.requestRender(),!0},O=x=>{if(t.isDisposed()||!t.gpu())return!1;let w=o.seats.idToIndex.get(x);if(w===void 0)return!1;let T=w*3,L=[o.seats.iPosition[T],o.seats.iPosition[T+1]+.55,o.seats.iPosition[T+2]];return t.reducedMotion()?n.frame({center:L,radius:En},!1,void 0,!1,Rn):n.frameSoft({center:L,radius:En},void 0,!1,Rn),a.requestRender(),!0};return u.addEventListener("click",k),{overviewChip:u,layoutOverviewChip:D,flightGen:()=>h,focusedFloor:()=>b,applyFloorFocus:A,placeCameraFinal:c,cancelFlight:f,focusOverview:k,flyToSeat:M,focusSectionCamera:C,focusSeatCamera:O}}var En=4.5,Rn={polarDeg:48,margin:1.25};function Fn(t){let e=performance.now();return{model:Ve(t),buildMs:performance.now()-e,source:"main"}}function hi(t){let e=Kt(t.doc);return{...Fn({...t,seats:e}),seats:e}}function Tn(t,e,o){if(typeof Worker>"u")return Promise.resolve(e());let r;try{r=new Worker(new URL("./scene/scene.worker.js",import.meta.url),{type:"module"})}catch{return Promise.resolve(e())}return new Promise(n=>{let i=!1,s=d=>{i||(i=!0,clearTimeout(l),r.terminate(),n(d))},a=()=>s(e()),l=window.setTimeout(a,15e3);r.onerror=a,r.onmessage=d=>{let p=o(d.data);p?s(p):a()},r.postMessage(t)})}function fi(t){return Tn(t,()=>Fn(t),({model:e,buildMs:o})=>({model:e,buildMs:o,source:"worker"}))}function vi(t){return Tn(t,()=>hi(t),({model:e,buildMs:o,seats:r})=>r?{model:e,buildMs:o,seats:r,source:"worker"}:null)}var bi=Math.PI/180,gi=6,yi=500;function vs(t,e,o={}){let r=performance.now(),n=e.prepared?.model??Ve(e),i=new at(o.onAnalytics),s=new Array(n.seats.count);for(let[m,v]of n.seats.idToIndex)s[v]=m;let a=new Map(e.seats.map(m=>[m.id,m])),l=new Map;for(let m of e.seats){if(!m.rowId)continue;let v=l.get(m.rowId);v?v.push(m.id):l.set(m.rowId,[m.id])}let d=new Map;for(let m of e.seats)d.set(m.id,m.sectionId);let p=new Map;for(let[m,v]of n.seats.idToIndex){let E=d.get(m);if(!E)continue;let W=p.get(E);W?W.push(v):p.set(E,[v])}let h=()=>{if(!c||!n.sectionSolidRanges.length)return;let{lit:m,anyUnlit:v}=Oo(n.sectionSolidRanges,p,n.seats.iState);c.setSectionShellLit(v?m:null)},b=e.doc.floors?.some(v=>(v.baseHeightM??0)>0)?!0:(e.doc.floors?.flatMap(v=>v.objects)??e.doc.objects).some(v=>v.type==="section"&&((v.height??0)>0||(v.rake??0)>0)),c=null,u=null,P=!1,D=!1,A=!1,k=new Map,f=null,M=null,C=null,O=new Map,x=null,w=()=>{C===null&&(C=t.style.zIndex,t.style.zIndex="20")},T=()=>{C!==null&&(t.style.zIndex==="20"&&(t.style.zIndex=C),C=null)},L=!1,R=()=>L?re.focusedFloor():-1,K=()=>{c=Go(y.gl,n),h(),u=new tt(y.renderer,c.seatGeometry,c.chairGeometry,c.solidGeometry,n.seats.count),y.setClearColor(n.theme.background.top),u.setRestoreClear(n.theme.background.top),c.seatProgram.uniforms.uSeatRadius.value=_e*n.theme.seatScale,c.seatProgram.uniforms.uFocusFloor.value=R(),c.solidProgram.uniforms.uFocusFloor.value=R(),c.chairProgram.uniforms.uFocusFloor.value=R(),c.screenProgram&&(c.screenProgram.uniforms.uFocusFloor.value=R()),V.forceRegather()},H=!1,V=new lt({model:n,orbit:()=>S,gpu:()=>c}),Y=m=>V.setDetailEnabled(m),y=new qe(t,{onContextLost:()=>{A||i.contextLost(),P=!0,_.stop(),c=null,u=null},onContextRestored:()=>{K(),P=!1,A||i.contextRestored(),_.requestRender()}}),S=new je(y.gl,y.canvas,()=>_.requestRender(),()=>i.orbitEngaged());S.setAspect(y.aspect);let X=(e.doc.floors?.flatMap(m=>m.objects)??e.doc.objects).some(m=>m.type==="section"&&m.physical3dProvenance?.surfaceKind?.status==="inferred"),g=(()=>{if(X&&n.stages.length===0)return;let m=n.focalWorld[0]-n.bounds.center[0],v=n.focalWorld[2]-n.bounds.center[2];return Math.hypot(m,v)>n.bounds.radius*.12?Math.atan2(m,v):void 0})(),z=n.floors.length>1?{polarDeg:48,margin:1.1}:{margin:1.1},$=typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;S.frame(n.bounds,!$&&o.skipInitialOverviewAnimation!==!0,g,o.portraitOverviewCrop===!0,z);let U=new ot(S.camera),ee=wn(t),Z=new Je(t,{fontFamily:e.doc.theme?.fontFamily,ink:e.doc.theme?.textColor,backgroundRgb:n.theme.background.top}),le=n.labels,oe=()=>no(le,n.floors.length,R());Z.setLabels(oe());let J=null,I=m=>{if(J=m,Z.setForcedDense(!!m),!m){Z.setLabels(oe());return}let v=e.seats.filter(F=>F.sectionId===m),E=new Set(v.map(F=>F.id)),W=new Set(v.map(F=>F.rowId)),q=new Set(k.keys()),j=new Set(v.filter(F=>q.has(F.id)).map(F=>F.id)),te=oe().filter(F=>F.kind!=="row"&&F.kind!=="seat"||(F.kind==="row"?W.has(F.id.slice(4)):E.has(F.id.slice(5))&&(j.size===0||j.has(F.id.slice(5)))));if(n.seatCount<=6e3&&j.size===0){Z.setLabels(te);return}let ne=j.size?v.filter(F=>j.has(F.id)):v,ge=new Set(ne.map(F=>`seat:${F.id}`)),he=ne.flatMap(F=>{let ae=n.seats.idToIndex.get(F.id);if(ae===void 0)return[];let ce=ae*3;return[{id:`seat:${F.id}`,kind:"seat",text:q.has(F.id)?F.displayLabel||F.label:mo(F.displayLabel||F.label),anchor:[n.seats.iPosition[ce],n.seats.iPosition[ce+1]+(q.has(F.id)?1.05:.55),n.seats.iPosition[ce+2]]}]});Z.setLabels([...te.filter(F=>!ge.has(F.id)),...he])};K();let N=null,B=null,_=new Ke(m=>{if(P||!c||D)return!1;let v=yn({flying:U.active,panoramaMounted:f!==null,seatViewActive:N?.active===!0}),E=v==="cinematic"?U.update(performance.now()):v==="seatView"?N.update(performance.now()):v==="orbit"?S.update():!1;B?.syncZoomLimits();let W=R()>=0?n.floors[R()]:null,q=W?.radius??n.bounds.radius,j=xo(S.currentDistance,q),te=H?{center:[S.camera.position.x,S.camera.position.y,S.camera.position.z],radius:520}:n.renderBounds;S.updateClipping(te);let ne=W?.center??n.renderBounds.center,ge=W?.radius??n.renderBounds.radius,he=(ue,Ie)=>Math.hypot(S.camera.position.x-ue[0],S.camera.position.y-ue[1],S.camera.position.z-ue[2])<=Ie*(V.detailVisible?1.8:1.55),F=he(ne,ge);if(!F&&J){let ue=n.sections.find(Ie=>Ie.id===J);ue&&(F=he(ue.center,Math.max(12,ue.radius*2)))}V.detailVisible=F;let ae=c.seatProgram.uniforms;ae.uSeatScale.value=j.scale,ae.uSeatFade.value=j.fade;let ce=!!W&&So(W.seatCount,y.canvas.clientWidth||1,y.canvas.clientHeight||1),Ue=wo(n.seats.count,q,S.currentDistance,S.camera.fov,y.canvas.clientHeight||1),Te=V.detailVisible||ce||Ue?1:0,We=V.detailVisible||R()>=0||n.floors.length>1?1:0;return V.ease(m,Te,We),ae.uSeatDetail.value=V.seatDetailMix,c.solidProgram.uniforms.uStructureDetail.value=V.structureDetailMix,ae.uMinPixels.value=j.minPixels,ae.uPixelToWorld.value=2*Math.tan(S.camera.fov*bi/2)/Math.max(1,y.pixelHeight),V.update(V.detailVisible),y.renderer.render({scene:c.background,clear:!0}),y.renderer.render({scene:c.main,camera:S.camera,clear:!1}),Z.update(S.camera.projectionViewMatrix,y.canvas.clientWidth||1,y.canvas.clientHeight||1,S.currentDistance,q,[S.camera.position.x,S.camera.position.y,S.camera.position.z]),E||V.seatDetailMix!==Te||V.structureDetailMix!==We}),G=typeof ResizeObserver<"u"?new ResizeObserver(()=>vt.resize()):null;G?.observe(t);let Q=m=>{let v=q=>{let j=n.seats.idToIndex.get(q);return j===void 0?void 0:n.seats.iState[j]},{updates:E,next:W}=Yo(k,m,v);if(k=W,Z.setSelectedSeatIds(k.keys()),J&&I(J),E.length){let q=xt(n.seats,E);c&&c.uploadSeatStateRuns(q),h(),_.requestRender()}},ve=()=>x!==null?x:typeof window<"u"&&!!window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,ct=8,Gt=m=>{if(!o.getSeatView)return null;let v=O.get(m);if(!v)for(v=Promise.resolve(o.getSeatView(m)),O.set(m,v),v.catch(()=>{O.get(m)===v&&O.delete(m)});O.size>ct;){let E=O.keys().next().value;if(E===void 0)break;O.delete(E)}return v},Ht=un(n.stages,n.focalWorld,n.bounds.groundY??0),In=Nt(Ht),ut=(m,v)=>{let E=a.get(m),W=Math.max(0,Math.round(n.seats.iFloor[v]??0)),q=e.doc.floors?.[W],j=n.floors[W],te=q?.focalPoint??e.doc.focalPoint,ne=j?{x:j.focalWorld[0]/Me,y:j.focalWorld[2]/Me}:te,ge=E?.focalPoint?{x:E.focalPoint.x+ne.x-te.x,y:E.focalPoint.y+ne.y-te.y}:ne,he=[n.seats.iPosition[v*3],n.seats.iPosition[v*3+1],n.seats.iPosition[v*3+2]];return en(he,ge,q?.baseHeightM??0,E?.eyeHeightM,In)},Ut=()=>(t.clientWidth||y.canvas.clientWidth)<=520,dt=null,Wt=null,_n=async(m,v,E)=>{if(!o.getSeatView||A||E!==re.flightGen())return;let W;try{W=await xn()}catch{if(i.panoramaFailed(m,"mount"),!A&&E===re.flightGen()){let q=pt(m,E,!0);requestAnimationFrame(()=>q?.querySelector("[data-panorama-trigger]")?.focus())}return}if(!(A||E!==re.flightGen()||!dt))return Wt??=W.createOpenPanorama(dt),Wt(m,v,E)},mt=Mn({container:t,model:n,opts:o,expandedSeatById:a,seatIdsByRow:l,isNarrow:Ut,isDisposed:()=>A,flightGen:()=>re.flightGen(),flyToSeat:m=>qt(m),openPanorama:(m,v,E)=>_n(m,v,E)}),pt=mt.show,ht=mt.remove,Vn=mt.layout,be=Pn({container:t,orbit:S,isNarrow:Ut,enabled:o.chrome?.controlDock!==!1,...o.navLabels?{labels:o.navLabels}:{}});B=be;let Ln=be.element,De=be.setNavigationMode,kn=be.layout,On=be.utilityControls,Fe=null,Yt=!1,He=m=>{be.setSeatViewLocked(m),m||N?.exit()};N=gn({canvas:y.canvas,camera:S.camera,requestRender:()=>_.requestRender(),reducedMotion:ve,onStopChange:m=>{let v=m??(Yt?"seat":null);Fe=v;try{o.onSeatViewStopChange?.(v)}catch{}},onApplied:()=>{A||S.syncFromCamera()}});let zn=(m,v)=>{let{eye:E}=ut(m,v),W=(t.clientWidth||y.canvas.clientWidth||1)/Math.max(1,t.clientHeight||y.canvas.clientHeight||1),q=mn(E,Ht,W);if(o.seatViewStops===!1)return{...q,stops:[]};let j=d.get(m),te=j?n.sections.find(ne=>ne.id===j):void 0;return{...q,stops:pn(q,{aspect:W,section:te&&te.seatCount>0?{center:te.center,radius:te.radius}:null,venue:{center:n.bounds.center,radius:n.bounds.radius}})}},re=Dn({container:t,model:n,opts:o,orbit:S,cinematic:U,analytics:i,loop:_,labelOverlay:Z,stageAzimuth:g,overviewFraming:z,gpu:()=>c,isDisposed:()=>A,panorama:()=>f,setPanorama:m=>{f=m},setPanoramaSphereVisible:m=>{H=m},panoramaLoadAbort:()=>M,setPanoramaLoadAbort:m=>{M=m},setFrozen:m=>{D=m},restorePanoramaLayer:T,reducedMotion:ve,resolvedSeatViewPose:ut,showSectionSeatLabels:I,setNearFieldDetailEnabled:Y,setSeatViewLocked:He,setNavigationMode:De,showArriveChip:pt,removeArriveChip:ht,inSeatView:()=>Fe!==null,setSeatStepping:m=>{Yt=m},seatViewArrival:(m,v)=>o.arriveAtSeatEye?zn(m,v):null,enterSeatView:m=>N?.enter(m)});L=!0;let ft=re.overviewChip,Nn=re.layoutOverviewChip,Bn=re.applyFloorFocus,Gn=re.focusOverview,Xt=re.cancelFlight,qt=re.flyToSeat,jt=re.focusSectionCamera;On.appendChild(ft),dt={container:t,model:n,opts:o,analytics:i,orbit:S,loop:_,seatsById:a,ensureSeatView:Gt,resolvedSeatViewPose:ut,gpu:()=>c,gl:y.gl,isContextLost:()=>P,isDisposed:()=>A,flightGen:()=>re.flightGen(),setPanorama:m=>{f=m},getLoadAbort:()=>M,setLoadAbort:m=>{M=m},setPanoramaSphereVisible:m=>{H=m,m&&N?.exit()},setFrozen:m=>{D=m},raisePanoramaLayer:w,restorePanoramaLayer:T,getOverviewChip:()=>ft,labelOverlay:Z,reducedMotion:ve,removeArriveChip:ht,showArriveChip:pt};let pe=Cn({glctx:y,orbit:S,model:n,seats:e.seats,opts:o,cinematic:U,analytics:i,seatIdByIndex:s,sectionIdBySeatId:d,tapSlop:gi,tapMs:yi,gpu:()=>c,pick:()=>u,seatViewLocked:()=>be.seatViewLocked(),focusedSectionId:()=>J,selection:()=>k,cancelFlight:Xt,focusSectionCamera:jt,focusSeatCamera:re.focusSeatCamera,setSelection:Q,ensureSeatView:Gt});y.canvas.addEventListener("pointerdown",pe.onDown),y.canvas.addEventListener("pointermove",pe.onMove),y.canvas.addEventListener("pointerup",pe.onUp),y.canvas.addEventListener("pointercancel",pe.onUp),_.requestRender();let vt={setAvailability(m){let v=Wo(k,m),E=xt(n.seats,v);E.length&&c&&c.uploadSeatStateRuns(E),h(),_.requestRender()},setSelection:Q,setNavigationMode:De,zoomIn(){S.zoomBy(Ce),_.requestRender()},zoomOut(){S.zoomBy(Le),_.requestRender()},flyToSeat:qt,focusOverview:Gn,seatViewStop:()=>Fe,recentreSeatView:()=>N?.recentre()??!1,resize(){let{width:m,height:v}=y.resize();S.setAspect(m/Math.max(1,v)),Vn(),kn(),Nn(),_.requestRender()},stats(){return{..._.stats(),drawCalls:c?c.drawCalls:0,seatCount:n.seatCount}},getQualityEvidence(){let m=_.stats(),v=y.canvas.clientWidth||1,E=y.canvas.clientHeight||1,W=n.bounds.center,q=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.min[1],W[2]],v,E),j=fe(S.camera.projectionViewMatrix,[W[0],n.bounds.box.max[1],W[2]],v,E),te=n.bounds.box,ne=[te.min[0],te.max[0]].flatMap(F=>[te.min[1],te.max[1]].flatMap(ae=>[te.min[2],te.max[2]].map(ce=>fe(S.camera.projectionViewMatrix,[F,ae,ce],v,E)))).filter(F=>Number.isFinite(F.x)&&Number.isFinite(F.y)&&Number.isFinite(F.depth)),ge=ne.length?(()=>{let F=Math.min(...ne.map(ye=>ye.x)),ae=Math.max(...ne.map(ye=>ye.x)),ce=Math.min(...ne.map(ye=>ye.y)),Ue=Math.max(...ne.map(ye=>ye.y)),Te=Math.max(0,F),We=Math.min(v,ae),ue=Math.max(0,ce),Ie=Math.min(E,Ue),Ye=Math.max(0,We-Te),bt=Math.max(0,Ie-ue);return{box:{x:Te,y:ue,width:Ye,height:bt},horizontalFillRatio:Ye/v,verticalFillRatio:bt/E,visibleAreaRatio:Ye*bt/(v*E),clippedEdges:[...ce<0?["top"]:[],...ae>v?["right"]:[],...Ue>E?["bottom"]:[],...F<0?["left"]:[]]}})():void 0,he=String(y.gl.getParameter(y.gl.VERSION)??"");return{viewport:{width:v,height:E},context:{webgl2:/webgl\s*2/i.test(he),lost:P},frame:{rendered:m.rendered,idle:m.idle},camera:{position:[S.camera.position.x,S.camera.position.y,S.camera.position.z],distance:S.currentDistance,verticalFovDeg:S.fovY},scene:{seatCount:n.seatCount,floorCount:n.floors.length,zoneCount:n.zones.length,sectionCount:n.sections.length,authoredRelief:b,renderedVerticalSpanM:Math.max(0,n.bounds.box.max[1]-n.bounds.box.min[1]),projectedReliefPx:q.visible&&j.visible?Math.abs(q.y-j.y):0},labels:Z.qualityEvidence(),framing:ge,...Fe?{seatView:{fovDeg:S.camera.fov,stop:Fe}}:{}}},getQualityReport(){return It(vt.getQualityEvidence())},loseContextForTest(){y.simulateContextLossCycle()},floors(){return n.floors},focusFloor(m){if(m!==null&&!n.floors.some(E=>E.index===m))return!1;let v=m??-1;if(Y(m!==null),He(!1),Bn(v),De("orbit"),m===null)U.cancel(),ve()?S.frame(n.bounds,!1,g,o.portraitOverviewCrop===!0,z):S.frameSoft(n.bounds,g,o.portraitOverviewCrop===!0,z);else{let E=n.floors[m];if(E.seatCount>0){U.cancel();let W=E.focalWorld[0]-E.center[0],q=E.focalWorld[2]-E.center[2],j=Math.hypot(W,q)>E.radius*.12?Math.atan2(W,q):g;S.frame({center:E.center,radius:E.radius,box:E.box},!1,j,!1,{polarDeg:58,margin:1.12})}}return _.requestRender(),!0},zones(){return n.zones},focusZone(m){let v=n.zones.find(j=>j.id===m);if(!v||v.seatCount===0)return!1;Y(!1),He(!1),U.cancel(),De("orbit"),I(null),o.onSectionFocusChange?.(null);let E=v.focalWorld[0]-v.center[0],W=v.focalWorld[2]-v.center[2],q=Math.hypot(E,W)>v.radius*.12?Math.atan2(E,W):void 0;return S.frame({center:v.center,radius:v.radius*1.25},!1,q),_.requestRender(),!0},sections(){return n.sections},focusSection(m){return jt(m)},rows(m){return m?n.rows.filter(v=>v.sectionId===m):n.rows},seatsInRow(m){return e.seats.filter(v=>v.rowId===m).map(v=>({id:v.id,label:v.displayLabel||v.label}))},focusRow(m){let v=n.rows.find(E=>E.id===m);return!v||v.seatCount===0?!1:(Y(!0),He(!1),U.cancel(),De("pan"),v.sectionId&&(I(v.sectionId),o.onSectionFocusChange?.(v.sectionId)),S.frame({center:v.center,radius:Math.max(2.5,v.radius*.65)}),_.requestRender(),!0)},setReducedMotionForTest(m){x=m},dispose(){A=!0,ht(),ft.remove(),Ln.remove(),Xt(),N?.dispose(),_.stop(),Z.dispose(),G?.disconnect(),f&&(f.dispose(),f=null),T(),ee(),y.canvas.removeEventListener("pointerdown",pe.onDown),y.canvas.removeEventListener("pointermove",pe.onMove),y.canvas.removeEventListener("pointerup",pe.onUp),y.canvas.removeEventListener("pointercancel",pe.onUp),S.dispose(),u&&u.dispose(),c&&c.dispose(),c=null,u=null,y.dispose()}};return i.opened(n.seatCount,b,e.prepared?.buildMs??performance.now()-r,e.prepared?.source??"inline"),vt}export{rr as VENUE3D_QUALITY_REPORT_VERSION,Ve as buildSceneModel,It as inspectVenue3DQualityEvidence,vs as mountVenue3D,fi as prepareVenue3D,vi as prepareVenue3DFromChart};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{x as n}from"../../chunk-
|
|
1
|
+
import{x as n}from"../../chunk-4ABXX5PL.js";import"../../chunk-PRED5KHO.js";import"../../chunk-QJXSZT3H.js";import"../../chunk-BS37TGPX.js";import"../../chunk-4I2VWFJY.js";import"../../chunk-UL5OIGIF.js";import{Wa as o}from"../../chunk-24O23MNB.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";function d(e){return[e.solids.position,e.solids.normal,e.solids.color,e.solids.floor,e.solids.material,e.seats.iPosition,e.seats.iState,e.seats.iCategory,e.seats.iMaxRadius,e.seats.iRing,e.seats.iFloor,e.seats.iYaw,e.seats.iChairWidth,e.seats.iGlyph,e.seats.iPhysicalSeat].map(s=>s.buffer)}var i=self;i.onmessage=e=>{let a=performance.now(),s=!e.data.seats,t=e.data.seats??o(e.data.doc),r=n({doc:e.data.doc,seats:t,eventConfigurationId:e.data.eventConfigurationId,eventConfiguration:e.data.eventConfiguration,registeredShellGlb:e.data.registeredShellGlb});i.postMessage({model:r,buildMs:performance.now()-a,...s?{seats:t}:{}},d(r))};
|