@seatlayer/core 0.104.1 → 0.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GUNNA5LB.js → chunk-4LW4TZZR.js} +1 -1
- package/dist/{chunk-IEBXXGQC.js → chunk-4SHLBEG5.js} +1 -1
- package/dist/{chunk-URW7MSCJ.js → chunk-522ENS2Q.js} +1 -1
- package/dist/{chunk-4522UUXG.js → chunk-7Q366RVM.js} +1 -1
- package/dist/{chunk-EE2CVYFJ.js → chunk-DDQWZ323.js} +1 -1
- package/dist/{chunk-P2BTUNG6.js → chunk-DO545QTN.js} +1 -1
- package/dist/{chunk-P6ASVG3X.js → chunk-EYJ5T5JM.js} +1 -1
- package/dist/{chunk-KYPY7GWB.js → chunk-GCIZT3CV.js} +1 -1
- package/dist/{chunk-HIU4MMID.js → chunk-GZYHULZY.js} +1 -1
- package/dist/chunk-VHFSP53L.js +1 -0
- package/dist/{chunk-PBXGWYB4.js → chunk-VSX4JWN7.js} +1 -1
- package/dist/core/chart-ops/index.cjs +1 -1
- package/dist/core/chart-ops/index.d.cts +40 -1
- package/dist/core/chart-ops/index.d.ts +40 -1
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.d.cts +2 -2
- package/dist/core/inventory/index.d.ts +2 -2
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.d.cts +2 -2
- package/dist/core/layout/index.d.ts +2 -2
- package/dist/core/layout/index.js +1 -1
- package/dist/core/quality/index.d.cts +2 -2
- package/dist/core/quality/index.d.ts +2 -2
- package/dist/core/quality/index.js +1 -1
- package/dist/core/render-assets/index.js +1 -1
- package/dist/core/sections/index.d.cts +1 -1
- package/dist/core/sections/index.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -12
- package/dist/index.d.ts +10 -12
- package/dist/index.js +1 -1
- package/dist/{renderedQuality-D62MKRV8.d.cts → renderedQuality-C7NrTR19.d.cts} +1 -1
- package/dist/{renderedQuality-DZOIkUX_.d.ts → renderedQuality-q5he_9Bt.d.ts} +1 -1
- package/dist/{renderer-BIR1jJrt.d.cts → renderer-BZuro9aF.d.cts} +7 -0
- package/dist/{renderer-CiPst9uA.d.ts → renderer-DIEE9JhZ.d.ts} +7 -0
- package/dist/{tableSizing-BnlXRH_v.d.ts → tableSizing-D-vDBFpb.d.ts} +1 -1
- package/dist/{tableSizing-DuRJVaJs.d.cts → tableSizing-saWGNPZM.d.cts} +1 -1
- package/dist/{ticketRestrictions-BBZ5mbsi.d.cts → ticketRestrictions-BNemUVPU.d.cts} +1 -1
- package/dist/{ticketRestrictions-BEHxDUyd.d.ts → ticketRestrictions-DUuUJygM.d.ts} +1 -1
- package/dist/view3d/index.d.cts +1 -1
- package/dist/view3d/index.d.ts +1 -1
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-6YTPIDLM.js +0 -1
|
@@ -188,6 +188,13 @@ interface RendererCallbacks {
|
|
|
188
188
|
* reads this to drive bulk block/unblock. Never fires when manageMode is off.
|
|
189
189
|
*/
|
|
190
190
|
onMarquee?: (seats: ExpandedSeat[]) => void;
|
|
191
|
+
/**
|
|
192
|
+
* The host takes a finished band (manage mode): the seat ids it covered, a
|
|
193
|
+
* test for world points inside it, and whether Alt made it a remover.
|
|
194
|
+
* Return true when the host applied it (e.g. the Control room takes whole
|
|
195
|
+
* sections at the overview); false leaves it to the renderer's default.
|
|
196
|
+
*/
|
|
197
|
+
onBand?: (ids: string[], inside: (point: Point) => boolean, remove: boolean) => boolean;
|
|
191
198
|
}
|
|
192
199
|
/** Far-zoom level-of-detail rung: whole zones → section blocks → individual seats. */
|
|
193
200
|
type LodRung = 'zones' | 'sections' | 'seats';
|
|
@@ -188,6 +188,13 @@ interface RendererCallbacks {
|
|
|
188
188
|
* reads this to drive bulk block/unblock. Never fires when manageMode is off.
|
|
189
189
|
*/
|
|
190
190
|
onMarquee?: (seats: ExpandedSeat[]) => void;
|
|
191
|
+
/**
|
|
192
|
+
* The host takes a finished band (manage mode): the seat ids it covered, a
|
|
193
|
+
* test for world points inside it, and whether Alt made it a remover.
|
|
194
|
+
* Return true when the host applied it (e.g. the Control room takes whole
|
|
195
|
+
* sections at the overview); false leaves it to the renderer's default.
|
|
196
|
+
*/
|
|
197
|
+
onBand?: (ids: string[], inside: (point: Point) => boolean, remove: boolean) => boolean;
|
|
191
198
|
}
|
|
192
199
|
/** Far-zoom level-of-detail rung: whole zones → section blocks → individual seats. */
|
|
193
200
|
type LodRung = 'zones' | 'sections' | 'seats';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as FloorLabelStyle, P as Point, C as ChartDoc, a as ChartObject, A as AccessibilityType, j as SeatOverride, R as RowObject, e as SeatGlyphKind, c as SeatViewMetadata, L as LabelStyle, k as RectTableSide, B as BoothObject, T as TableObject, l as Floor, i as SectionObject, m as RectTableSeatCounts } from './types-CB1llwVg.js';
|
|
2
2
|
import { S as SegmentedRowPlacement } from './segmentedRowModel-BSXPftwU.js';
|
|
3
|
-
import { E as ExpandedSeat } from './renderer-
|
|
3
|
+
import { E as ExpandedSeat } from './renderer-DIEE9JhZ.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The buyer's "All floors" view: one venue, read bottom to top.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { F as FloorLabelStyle, P as Point, C as ChartDoc, a as ChartObject, A as AccessibilityType, j as SeatOverride, R as RowObject, e as SeatGlyphKind, c as SeatViewMetadata, L as LabelStyle, k as RectTableSide, B as BoothObject, T as TableObject, l as Floor, i as SectionObject, m as RectTableSeatCounts } from './types-CB1llwVg.cjs';
|
|
2
2
|
import { S as SegmentedRowPlacement } from './segmentedRowModel-Dy_zNI1E.cjs';
|
|
3
|
-
import { E as ExpandedSeat } from './renderer-
|
|
3
|
+
import { E as ExpandedSeat } from './renderer-BZuro9aF.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The buyer's "All floors" view: one venue, read bottom to top.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as ChartDoc, G as GAAreaObject, t as GAInventorySegment, u as CategoryTier } from './types-CB1llwVg.cjs';
|
|
2
|
-
import { E as ExpandedSeat } from './renderer-
|
|
2
|
+
import { E as ExpandedSeat } from './renderer-BZuro9aF.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* General-admission unit labels, kept free of imports so a buyer surface can
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { C as ChartDoc, G as GAAreaObject, t as GAInventorySegment, u as CategoryTier } from './types-CB1llwVg.js';
|
|
2
|
-
import { E as ExpandedSeat } from './renderer-
|
|
2
|
+
import { E as ExpandedSeat } from './renderer-DIEE9JhZ.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* General-admission unit labels, kept free of imports so a buyer surface can
|
package/dist/view3d/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Point, C as ChartDoc } from '../types-CB1llwVg.cjs';
|
|
2
2
|
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-1sMqxBpq.cjs';
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-BZuro9aF.cjs';
|
|
4
4
|
import { S as StageKind } from '../stage-CKb7aNoH.cjs';
|
|
5
5
|
import { SeatView } from './crossfade/panorama.cjs';
|
|
6
6
|
|
package/dist/view3d/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { P as Point, C as ChartDoc } from '../types-CB1llwVg.js';
|
|
2
2
|
import { E as EventConfigurationProductionElementKind, a as EventConfigurationOcclusion, b as EventConfigurationVersion } from '../eventConfigurations-B7vGmmD3.js';
|
|
3
|
-
import { E as ExpandedSeat } from '../renderer-
|
|
3
|
+
import { E as ExpandedSeat } from '../renderer-DIEE9JhZ.js';
|
|
4
4
|
import { S as StageKind } from '../stage-CKb7aNoH.js';
|
|
5
5
|
import { SeatView } from './crossfade/panorama.js';
|
|
6
6
|
|
package/dist/view3d/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as Kt,B as uo,C as tt,D as Zt,E as mo,F as ho,a as Qe,b as _e,c as yt,d as jt,e as Kn,f as Zn,g as ye,h as Qn,i as Jn,j as xt,k as Le,l as Je,m as eo,n as $t,o as ma,p as to,q as no,r as oo,s as ro,t as Me,u as ao,v as io,w as so,x as lo,y as co,z as et}from"../chunk-P6ASVG3X.js";import"../chunk-KYPY7GWB.js";import"../chunk-O4ZAGGMP.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-PBXGWYB4.js";import"../chunk-HIU4MMID.js";import"../chunk-IEBXXGQC.js";import"../chunk-QFX6XSO6.js";import"../chunk-P2BTUNG6.js";import"../chunk-4N5CHKHD.js";import{b as qn,c as qt,d as jn,n as $n}from"../chunk-GUNNA5LB.js";import"../chunk-TFYAMLCK.js";import"../chunk-EE2CVYFJ.js";import"../chunk-URW7MSCJ.js";import"../chunk-UKODEMIM.js";import{eb as Un}from"../chunk-HKVCBUON.js";import"../chunk-KTMZ3QAO.js";import{d as Yn,l as Xn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function po(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),m=0,f=0,u=0;for(let c=0;c<r;c+=l)m+=e[c*3],f+=e[c*3+2],u++;a=m/u,o=f/u}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Us}from"ogl";function fo(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let M=0;M<a;M++){let E=r[M*3],k=r[M*3+2];E<o&&(o=E),E>i&&(i=E),k<s&&(s=k),k>l&&(l=k)}for(let M of e.stages)o=Math.min(o,M.cx-M.halfX),i=Math.max(i,M.cx+M.halfX),s=Math.min(s,M.cz-M.halfZ),l=Math.max(l,M.cz+M.halfZ);let m=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*m)/2,u=(104-(l-s)*m)/2,c=M=>f+(M-o)*m,h=M=>u+(M-s)*m,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),b=document.createElement("canvas");b.width=Math.round(148*d),b.height=Math.round(104*d),b.setAttribute("aria-hidden","true"),b.setAttribute("data-seat-locator","");let p=b.style;p.position="absolute",p.left="12px",p.bottom="12px",p.width="148px",p.height="104px",p.borderRadius="10px",p.background="rgba(10,14,22,.72)",p.border="1px solid rgba(255,255,255,.14)",p.boxShadow="0 4px 14px rgba(0,0,0,.35)",p.pointerEvents="none",p.zIndex="3",p.display="none",t.appendChild(b);let x=document.createElement("canvas");x.width=b.width,x.height=b.height;let A=x.getContext("2d");if(A){A.scale(d,d),A.fillStyle="rgba(214,222,234,.28)";let M=Math.max(1,Math.ceil(a/6e3));for(let E=0;E<a;E+=M)A.fillRect(c(r[E*3])-.6,h(r[E*3+2])-.6,1.2,1.2);A.fillStyle="rgba(236,240,246,.16)",A.strokeStyle="rgba(236,240,246,.55)",A.lineWidth=1;for(let E of e.stages){let k=c(E.cx-E.halfX),g=h(E.cz-E.halfZ),R=E.halfX*2*m,w=E.halfZ*2*m;A.fillRect(k,g,R,w),A.strokeRect(k+.5,g+.5,Math.max(0,R-1),Math.max(0,w-1))}}let S=b.getContext("2d"),I="";return{el:b,update(M,E){if(!M||!S||t.clientWidth>0&&t.clientWidth<560){p.display!=="none"&&(p.display="none"),I="";return}let k=c(M[0]),g=h(M[2]),R=E?Math.atan2(E[2],E[0]):0,w=`${k.toFixed(1)},${g.toFixed(1)},${R.toFixed(2)}`;if(w!==I){if(I=w,p.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,b.width,b.height),S.drawImage(x,0,0),S.setTransform(d,0,0,d,0,0),E){let D=S.createRadialGradient(k,g,0,k,g,26);D.addColorStop(0,"rgba(255,255,255,.55)"),D.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=D,S.beginPath(),S.moveTo(k,g),S.arc(k,g,26,R-.5,R+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(k,g,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){b.remove()}}}var Qt=78,vo=18;function bo(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,_e,-1],max:[1,yt,-.72]}])for(let l of o){let m=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-jt)/(yt-_e):0),u=Math.hypot(l.n[0],f,l.n[2]),c=[l.n[0]/u,f/u,l.n[2]/u];for(let[h,d]of l.c.entries()){let b=d.map((p,x)=>s.min[x]+p*(s.max[x]-s.min[x]));s.part===2&&(b[0]*=1-d[1]*(1-jt)),t.push(...b),e.push(...c),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][h])}a.push(m,m+1,m+2,m,m+2,m+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as ha}from"ogl";function pa(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var St=class{constructor(e,n){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 ha({canvas:this.canvas,dpr:pa(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[xt.top[0],xt.top[1],xt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(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),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let 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 fa,Vec3 as Jt}from"ogl";var ue=Math.PI/180,en=15*ue,tn=80*ue,Oe=.12,go=35,nn=1.25,yo=.006,va=4,ze=.82,nt=1/ze,ba=.12,ga=2;function ya(t,e){return{azimuth:0-t*yo,polar:-e*yo}}function xo(t,e,n){let r=Math.max(ga,Math.max(1,e)*ba),a=n*va;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var xa=1.5;function Sa(t,e,n){let r=Math.max(1,n)*xa;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function wa(t,e,n,r,a,o,i,s){let l=Math.sin(n),m=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],f=[t[0]+r*m[0],t[1]+r*m[1],t[2]+r*m[2]],u=[-m[0],-m[1],-m[2]],c=[-u[2],0,u[0]],h=Math.hypot(c[0],c[2])||1;c=[c[0]/h,0,c[2]/h];let d=[c[1]*u[2]-c[2]*u[1],c[2]*u[0]-c[0]*u[2],c[0]*u[1]-c[1]*u[0]],b=Math.tan(a*ue/2),p=b*(o>0?o:1),x=[0,1,2].map(I=>u[I]+i*p*c[I]+s*b*d[I]);if(x[1]>=-1e-6)return null;let A=(t[1]-f[1])/x[1],S=Math.hypot(x[0],x[1],x[2]);return!(A>0)||A*S>r*Ma?null:[f[0]+x[0]*A,t[1],f[2]+x[2]*A]}var So=3,Ma=4,wo=.72,Aa=.6;function Pa(t,e,n){return t!=="auto"?t:n!==null&&e<n*Aa?"pan":"orbit"}function Mo(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var Ca=.4;function Ea(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,m=Mo(r,a);if(!l||l.length<9||!m)return{center:i,distance:s};let{fx:f,fy:u,fz:c,rx:h,rz:d,ux:b,uy:p,uz:x}=m,A=Math.hypot(f,c),S=f/A,I=c/A,M=S*b+I*x,E=Ca*Math.max(1,t.radius);for(let k=0;k<3;k++){let g=1/0,R=-1/0,w=1/0,D=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],ee=l[W+1]-i[1],Z=l[W+2]-i[2],Y=s+N*f+ee*u+Z*c;if(!(Y>.001))continue;let T=(N*h+Z*d)/(Y*e),C=(N*b+ee*p+Z*x)/(Y*n);T<g&&(g=T),T>R&&(R=T),C<w&&(w=C),C>D&&(D=C)}if(!Number.isFinite(g))break;let G=(g+R)/2*s*e,F=Math.abs(M)>.1?(w+D)/2*s*n/M:0,z=G*h+F*S,B=G*d+F*I;if(Math.hypot(i[0]+z-t.center[0],i[2]+B-t.center[2])>E){let W=i[0]-t.center[0],N=i[2]-t.center[2],ee=W+z,Z=N+B,Y=E/Math.hypot(ee,Z);z=ee*Y-W,B=Z*Y-N}i=[i[0]+z,i[1],i[2]+B],s=o(i)}return{center:i,distance:s}}var wt=class{constructor(e,n,r,a){this.fovY=go;this.target=new Jt;this.azimuth=-30*ue;this.polar=55*ue;this.distance=10;this.azT=-30*ue;this.polT=55*ue;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 Jt;this.panAnchor=new Jt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new fa(e,{fov:go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let m=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-m)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=m;let u=this.currentPinchAngle(),c=u-this.pinchAngle;c>Math.PI&&(c-=2*Math.PI),c<-Math.PI&&(c+=2*Math.PI),this.pinchAngle=u,Math.abs(c)>1e-4&&Math.abs(c)<.5&&(this.azT+=c,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=ya(i,s);this.azT+=l.azimuth,this.polT=Math.max(en,Math.min(tn,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*ue;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(en,Math.min(tn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(ze);else if(o.key==="-"||o.key==="_")this.dollyBy(nt);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*ue/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,m=Math.cos(this.polar),f=Math.sin(this.polar),u=-o*m,c=-i*m;this.targetT.x+=(-e*s+n*u)*a,this.targetT.z+=(-e*l+n*c)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=Sa(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+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?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Pa(this.primaryDragMode,this.distT,this.overviewDist)}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()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(So,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(So,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?wa([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}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,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*ue/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,m=Math.atan(Math.tan(s)*l);this.azT=r??-30*ue,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*ue;let f=this.framedOn(e,s,m),u=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=u*Math.max(1.05,Math.min(2,o?.margin??nn)),this.envelope=xo(this.envelope,i,u),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*ue,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*ue/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ue;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??nn)),this.envelope=xo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*ue/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*ue;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??nn))}framedOn(e,n,r){return Ea(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let m=Mo(a,o);if(!m)return s;let{fx:f,fy:u,fz:c,rx:h,rz:d,ux:b,uy:p,uz:x}=m,A=Math.tan(r),S=Math.tan(n),I=1;for(let w=0;w<8;w++){let D=(w&1?l.max[0]:l.min[0])-e.center[0],G=(w&2?l.max[1]:l.min[1])-e.center[1],F=(w&4?l.max[2]:l.min[2])-e.center[2],z=D*f+G*u+F*c,B=Math.abs(D*h+F*d),U=Math.abs(D*b+G*p+F*x);I=Math.max(I,B/A-z,U/S-z)}let M=Math.min(s,Math.max(I,i*.35)),E=e.fitPoints;if(!E||E.length<9)return M;let k=0,g=1/(A*wo),R=1/(S*wo);for(let w=0;w+2<E.length;w+=3){let D=E[w]-e.center[0],G=E[w+1]-e.center[1],F=E[w+2]-e.center[2],z=D*f+G*u+F*c,B=Math.abs(D*h+F*d),U=Math.abs(D*b+G*p+F*x);k=Math.max(k,B*g-z,U*R-z)}return Math.min(M*1.5,Math.max(M*.55,k))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=_a(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Oe,this.polar+=n*Oe,this.distance+=r*Oe,this.target.x+=a*Oe,this.target.y+=o*Oe,this.target.z+=i*Oe,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(en,Math.min(tn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,m=this.camera.position.clone(),f=[...this.camera.quaternion],u=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(m),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:u,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}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),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),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()}},Ta=.1,Ra=.25;function _a(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Ra:Math.max(.05,n*Ta),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var Mt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?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}};function Ao(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ne=2.5,Ia=1.15,ot=12,He=22,Po=6,Co=9.5,Eo=.9,To=2.2,on=30,rn=4,At=8192;var cl=He+rn;function Ro(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ne};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ne+a*(Ia-Ne)}}function _o(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var Fa=12;function Io(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=Fa}import{Geometry as Da,Mesh as ka,Program as Va,Transform as La}from"ogl";var Oa=.05,za=1.1,Na=12,Ha=1.6,Ga=1,Ba=2.5,Wa=650,Do=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],ko={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},an={centre:[0,.74,-.04],radii:[.1,.12,.11]},Ge={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},Ua=90,ml={height:an.centre[1]+an.radii[1],radius:Math.max(ko.shoulderRadius,...Do.map(t=>Math.max(Math.abs(t[0]),Math.abs(t[3]))))};function Ya(t,e){if(e)return 0;let n=(t-Ge.fadeInFromM)/(Ge.fullByM-Ge.fadeInFromM);return Math.max(0,Math.min(1,n))}function Xa(t,e){return!e&&t<Ua}var Fo=24;function qa(t){let e=[],n=[],r=[],a=(u,c,h)=>{e.push(...u),n.push(...c),r.push(h)};for(let u=0;u<16;u++){let c=u/16*Math.PI*2,h=(u+1)/16*Math.PI*2,d=S=>[Math.cos(S),0,Math.sin(S)],b=[Math.cos(c)*.012,0,Math.sin(c)*.012],p=[Math.cos(h)*.012,0,Math.sin(h)*.012],x=[Math.cos(c)*.03,1,Math.sin(c)*.03],A=[Math.cos(h)*.03,1,Math.sin(h)*.03];a(b,d(c),0),a(x,d(c),0),a(A,d(h),0),a(b,d(c),0),a(A,d(h),0),a(p,d(h),0)}let l=.16,m=.24,f=.01;for(let u=0;u<48;u++){let c=u/48*Math.PI*2,h=(u+1)/48*Math.PI*2,d=[Math.cos(c)*l,f,Math.sin(c)*l],b=[Math.cos(c)*m,f,Math.sin(c)*m],p=[Math.cos(h)*m,f,Math.sin(h)*m],x=[Math.cos(h)*l,f,Math.sin(h)*l];for(let A of[d,b,p,d,p,x])a(A,[0,1,0],1)}for(let[u,c,h,d,b,p]of Do){let x=[[[0,0,1],[[u,c,p],[d,c,p],[d,b,p],[u,b,p]]],[[0,0,-1],[[d,c,h],[u,c,h],[u,b,h],[d,b,h]]],[[1,0,0],[[d,c,p],[d,c,h],[d,b,h],[d,b,p]]],[[-1,0,0],[[u,c,h],[u,c,p],[u,b,p],[u,b,h]]],[[0,1,0],[[u,b,p],[d,b,p],[d,b,h],[u,b,h]]],[[0,-1,0],[[u,c,h],[d,c,h],[d,c,p],[u,c,p]]]];for(let[A,[S,I,M,E]]of x)for(let k of[S,I,M,S,M,E])a(k,A,2)}{let{centre:u,hipRadius:c,shoulderRadius:h,height:d,sides:b,depth:p}=ko,x=(A,S,I)=>{let M=A/b*Math.PI*2+Math.PI/b;return[u[0]+Math.cos(M)*S,u[1]+I,u[2]+Math.sin(M)*S*p]};for(let A=0;A<b;A++){let S=x(A,c,0),I=x(A+1,c,0),M=x(A+1,h,d),E=x(A,h,d),k=[I[0]-S[0],I[1]-S[1],I[2]-S[2]],g=[E[0]-S[0],E[1]-S[1],E[2]-S[2]],R=[k[1]*g[2]-k[2]*g[1],k[2]*g[0]-k[0]*g[2],k[0]*g[1]-k[1]*g[0]],w=Math.hypot(...R)||1;R=[R[0]/w,R[1]/w,R[2]/w],R[0]*(S[0]-u[0])+R[2]*(S[2]-u[2])<0&&(R=[-R[0],-R[1],-R[2]]);for(let D of[S,I,M,S,M,E])a(D,R,2);a([u[0],u[1]+d,u[2]],[0,1,0],2),a(E,[0,1,0],2),a(M,[0,1,0],2)}}{let{centre:u,radii:c}=an,h=8,d=(b,p)=>{let x=b/16*Math.PI*2,A=p/h*Math.PI,S=[Math.sin(A)*Math.cos(x),Math.cos(A),Math.sin(A)*Math.sin(x)];return[[u[0]+S[0]*c[0],u[1]+S[1]*c[1],u[2]+S[2]*c[2]],S]};for(let b=0;b<16;b++)for(let p=0;p<h;p++){let x=d(b,p),A=d(b+1,p),S=d(b+1,p+1),I=d(b,p+1);for(let[M,E]of[x,A,S,x,S,I])a(M,E,2)}}for(let u=0;u<32;u++){let c=u/32*Math.PI*2,h=(u+1)/32*Math.PI*2,d=Ge.baseRadius,b=Ge.topRadius,p=[Math.cos(c)*d,0,Math.sin(c)*d],x=[Math.cos(h)*d,0,Math.sin(h)*d],A=[Math.cos(c)*b,1,Math.sin(c)*b],S=[Math.cos(h)*b,1,Math.sin(h)*b],I=[Math.cos(c),0,Math.sin(c)],M=[Math.cos(h),0,Math.sin(h)];a(p,I,3),a(A,I,3),a(S,M,3),a(p,I,3),a(S,M,3),a(x,M,3)}return new Da(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var ja=`#version 300 es
|
|
1
|
+
import{A as Kt,B as uo,C as tt,D as Zt,E as mo,F as ho,a as Qe,b as _e,c as yt,d as jt,e as Kn,f as Zn,g as ye,h as Qn,i as Jn,j as xt,k as Le,l as Je,m as eo,n as $t,o as ma,p as to,q as no,r as oo,s as ro,t as Me,u as ao,v as io,w as so,x as lo,y as co,z as et}from"../chunk-EYJ5T5JM.js";import"../chunk-GCIZT3CV.js";import"../chunk-O4ZAGGMP.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-VSX4JWN7.js";import"../chunk-GZYHULZY.js";import"../chunk-4SHLBEG5.js";import"../chunk-QFX6XSO6.js";import"../chunk-DO545QTN.js";import"../chunk-4N5CHKHD.js";import{b as qn,c as qt,d as jn,n as $n}from"../chunk-4LW4TZZR.js";import"../chunk-TFYAMLCK.js";import"../chunk-DDQWZ323.js";import"../chunk-522ENS2Q.js";import"../chunk-UKODEMIM.js";import{eb as Un}from"../chunk-HKVCBUON.js";import"../chunk-KTMZ3QAO.js";import{d as Yn,l as Xn}from"../chunk-JBOTRSMY.js";import"../chunk-CRCGO52K.js";function po(t,e,n){let r=Math.floor(e.length/3),a=n.center[0],o=n.center[2];if(r>0){let l=Math.max(1,Math.floor(r/4e3)),m=0,f=0,u=0;for(let c=0;c<r;c+=l)m+=e[c*3],f+=e[c*3+2],u++;a=m/u,o=f/u}let i=t[0]-a,s=t[2]-o;return Math.hypot(i,s)>n.radius*.12?Math.atan2(i,s):void 0}import{Mat4 as Us}from"ogl";function fo(t,e,n="#ffffff"){let{iPosition:r,count:a}=e.seats;if(a<2||typeof document>"u")return null;let o=1/0,i=-1/0,s=1/0,l=-1/0;for(let M=0;M<a;M++){let E=r[M*3],k=r[M*3+2];E<o&&(o=E),E>i&&(i=E),k<s&&(s=k),k>l&&(l=k)}for(let M of e.stages)o=Math.min(o,M.cx-M.halfX),i=Math.max(i,M.cx+M.halfX),s=Math.min(s,M.cz-M.halfZ),l=Math.max(l,M.cz+M.halfZ);let m=Math.min(130/Math.max(.001,i-o),86/Math.max(.001,l-s)),f=(148-(i-o)*m)/2,u=(104-(l-s)*m)/2,c=M=>f+(M-o)*m,h=M=>u+(M-s)*m,d=Math.min(2,typeof window<"u"&&window.devicePixelRatio||1),b=document.createElement("canvas");b.width=Math.round(148*d),b.height=Math.round(104*d),b.setAttribute("aria-hidden","true"),b.setAttribute("data-seat-locator","");let p=b.style;p.position="absolute",p.left="12px",p.bottom="12px",p.width="148px",p.height="104px",p.borderRadius="10px",p.background="rgba(10,14,22,.72)",p.border="1px solid rgba(255,255,255,.14)",p.boxShadow="0 4px 14px rgba(0,0,0,.35)",p.pointerEvents="none",p.zIndex="3",p.display="none",t.appendChild(b);let x=document.createElement("canvas");x.width=b.width,x.height=b.height;let A=x.getContext("2d");if(A){A.scale(d,d),A.fillStyle="rgba(214,222,234,.28)";let M=Math.max(1,Math.ceil(a/6e3));for(let E=0;E<a;E+=M)A.fillRect(c(r[E*3])-.6,h(r[E*3+2])-.6,1.2,1.2);A.fillStyle="rgba(236,240,246,.16)",A.strokeStyle="rgba(236,240,246,.55)",A.lineWidth=1;for(let E of e.stages){let k=c(E.cx-E.halfX),g=h(E.cz-E.halfZ),R=E.halfX*2*m,w=E.halfZ*2*m;A.fillRect(k,g,R,w),A.strokeRect(k+.5,g+.5,Math.max(0,R-1),Math.max(0,w-1))}}let S=b.getContext("2d"),I="";return{el:b,update(M,E){if(!M||!S||t.clientWidth>0&&t.clientWidth<560){p.display!=="none"&&(p.display="none"),I="";return}let k=c(M[0]),g=h(M[2]),R=E?Math.atan2(E[2],E[0]):0,w=`${k.toFixed(1)},${g.toFixed(1)},${R.toFixed(2)}`;if(w!==I){if(I=w,p.display="block",S.setTransform(1,0,0,1,0,0),S.clearRect(0,0,b.width,b.height),S.drawImage(x,0,0),S.setTransform(d,0,0,d,0,0),E){let D=S.createRadialGradient(k,g,0,k,g,26);D.addColorStop(0,"rgba(255,255,255,.55)"),D.addColorStop(1,"rgba(255,255,255,0)"),S.fillStyle=D,S.beginPath(),S.moveTo(k,g),S.arc(k,g,26,R-.5,R+.5),S.closePath(),S.fill()}S.fillStyle=n,S.strokeStyle="rgba(10,14,22,.9)",S.lineWidth=1.5,S.beginPath(),S.arc(k,g,3.6,0,Math.PI*2),S.fill(),S.stroke()}},dispose(){b.remove()}}}var Qt=78,vo=18;function bo(){let t=[],e=[],n=[],r=[],a=[],o=[{n:[1,0,0],c:[[1,0,0],[1,1,0],[1,1,1],[1,0,1]]},{n:[-1,0,0],c:[[0,0,1],[0,1,1],[0,1,0],[0,0,0]]},{n:[0,1,0],c:[[0,1,0],[0,1,1],[1,1,1],[1,1,0]]},{n:[0,-1,0],c:[[0,0,1],[0,0,0],[1,0,0],[1,0,1]]},{n:[0,0,1],c:[[0,0,1],[1,0,1],[1,1,1],[0,1,1]]},{n:[0,0,-1],c:[[1,0,0],[0,0,0],[0,1,0],[1,1,0]]}];for(let s of[{part:1,min:[-1,.36,-.95],max:[1,.45,1]},{part:2,min:[-1,_e,-1],max:[1,yt,-.72]}])for(let l of o){let m=t.length/3,f=l.n[1]+(s.part===2?Math.abs(l.n[0])*(1-jt)/(yt-_e):0),u=Math.hypot(l.n[0],f,l.n[2]),c=[l.n[0]/u,f/u,l.n[2]/u];for(let[h,d]of l.c.entries()){let b=d.map((p,x)=>s.min[x]+p*(s.max[x]-s.min[x]));s.part===2&&(b[0]*=1-d[1]*(1-jt)),t.push(...b),e.push(...c),n.push(s.part),r.push(...[[-1,-1],[1,-1],[1,1],[-1,1]][h])}a.push(m,m+1,m+2,m,m+2,m+3)}let i=t.length/3;for(let[s,l]of[[-1,-1],[1,-1],[1,1],[-1,1]])t.push(s,l,0),e.push(0,1,0),n.push(0),r.push(s,l);return a.push(i,i+1,i+2,i,i+2,i+3),a.push(...a.slice(12,18),...a.slice(60,66),...a.slice(72,78)),{position:new Float32Array(t),normal:new Float32Array(e),surface:new Float32Array(n),uv:new Float32Array(r),index:new Uint16Array(a)}}import{Renderer as ha}from"ogl";function pa(){let t=typeof window<"u"&&window.devicePixelRatio||1,e=navigator.deviceMemory,n=typeof e=="number"&&e<=4?1.5:2;return Math.min(t,n)}var St=class{constructor(e,n){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 ha({canvas:this.canvas,dpr:pa(),alpha:!1,antialias:!1,depth:!0,stencil:!1,powerPreference:"high-performance",webgl:2}),this.gl=this.renderer.gl,this.clearRgb=[xt.top[0],xt.top[1],xt.top[2]],this.gl.clearColor(this.clearRgb[0],this.clearRgb[1],this.clearRgb[2],1),e.appendChild(this.canvas),this.lostHandler=r=>{r.preventDefault(),n.onContextLost()},this.restoredHandler=()=>n.onContextRestored(),this.canvas.addEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.addEventListener("webglcontextrestored",this.restoredHandler,!1),this.resize()}setClearColor(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),n=Math.max(1,this.container.clientHeight||this.canvas.clientHeight||1);return this.renderer.setSize(e,n),{width:e,height:n}}get pixelHeight(){return this.renderer.height*this.renderer.dpr}get aspect(){return this.renderer.width/Math.max(1,this.renderer.height)}dispose(){this.canvas.removeEventListener("webglcontextlost",this.lostHandler,!1),this.canvas.removeEventListener("webglcontextrestored",this.restoredHandler,!1);let 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 fa,Vec3 as Jt}from"ogl";var ue=Math.PI/180,en=15*ue,tn=80*ue,Oe=.12,go=35,nn=1.25,yo=.006,va=4,ze=.82,nt=1/ze,ba=.12,ga=2;function ya(t,e){return{azimuth:0-t*yo,polar:-e*yo}}function xo(t,e,n){let r=Math.max(ga,Math.max(1,e)*ba),a=n*va;return{minDist:t?Math.min(t.minDist,r):r,maxDist:t?Math.max(t.maxDist,a):a}}var xa=1.5;function Sa(t,e,n){let r=Math.max(1,n)*xa;if(!t)return{anchor:[e[0],e[1],e[2]],limit:r};let[a,o,i]=t.anchor,s=e[1]-o,l=Math.max(Math.abs(e[0]-a),Math.abs(e[2]-i),s>=0?s:-s*2);return{anchor:t.anchor,limit:Math.max(t.limit,l+r)}}function wa(t,e,n,r,a,o,i,s){let l=Math.sin(n),m=[l*Math.sin(e),Math.cos(n),l*Math.cos(e)],f=[t[0]+r*m[0],t[1]+r*m[1],t[2]+r*m[2]],u=[-m[0],-m[1],-m[2]],c=[-u[2],0,u[0]],h=Math.hypot(c[0],c[2])||1;c=[c[0]/h,0,c[2]/h];let d=[c[1]*u[2]-c[2]*u[1],c[2]*u[0]-c[0]*u[2],c[0]*u[1]-c[1]*u[0]],b=Math.tan(a*ue/2),p=b*(o>0?o:1),x=[0,1,2].map(I=>u[I]+i*p*c[I]+s*b*d[I]);if(x[1]>=-1e-6)return null;let A=(t[1]-f[1])/x[1],S=Math.hypot(x[0],x[1],x[2]);return!(A>0)||A*S>r*Ma?null:[f[0]+x[0]*A,t[1],f[2]+x[2]*A]}var So=3,Ma=4,wo=.72,Aa=.6;function Pa(t,e,n){return t!=="auto"?t:n!==null&&e<n*Aa?"pan":"orbit"}function Mo(t,e){let n=Math.sin(e),r=-n*Math.sin(t),a=-Math.cos(e),o=-n*Math.cos(t);if(Math.abs(a)>.999)return null;let i=-o,s=r,l=Math.hypot(i,s);return i/=l,s/=l,{fx:r,fy:a,fz:o,rx:i,rz:s,ux:-s*a,uy:s*r-i*o,uz:i*a}}var Ca=.4;function Ea(t,e,n,r,a,o){let i=[t.center[0],t.center[1],t.center[2]],s=o(i),l=t.fitPoints,m=Mo(r,a);if(!l||l.length<9||!m)return{center:i,distance:s};let{fx:f,fy:u,fz:c,rx:h,rz:d,ux:b,uy:p,uz:x}=m,A=Math.hypot(f,c),S=f/A,I=c/A,M=S*b+I*x,E=Ca*Math.max(1,t.radius);for(let k=0;k<3;k++){let g=1/0,R=-1/0,w=1/0,D=-1/0;for(let W=0;W+2<l.length;W+=3){let N=l[W]-i[0],ee=l[W+1]-i[1],Z=l[W+2]-i[2],Y=s+N*f+ee*u+Z*c;if(!(Y>.001))continue;let T=(N*h+Z*d)/(Y*e),C=(N*b+ee*p+Z*x)/(Y*n);T<g&&(g=T),T>R&&(R=T),C<w&&(w=C),C>D&&(D=C)}if(!Number.isFinite(g))break;let G=(g+R)/2*s*e,F=Math.abs(M)>.1?(w+D)/2*s*n/M:0,z=G*h+F*S,B=G*d+F*I;if(Math.hypot(i[0]+z-t.center[0],i[2]+B-t.center[2])>E){let W=i[0]-t.center[0],N=i[2]-t.center[2],ee=W+z,Z=N+B,Y=E/Math.hypot(ee,Z);z=ee*Y-W,B=Z*Y-N}i=[i[0]+z,i[1],i[2]+B],s=o(i)}return{center:i,distance:s}}var wt=class{constructor(e,n,r,a){this.fovY=go;this.target=new Jt;this.azimuth=-30*ue;this.polar=55*ue;this.distance=10;this.azT=-30*ue;this.polT=55*ue;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 Jt;this.panAnchor=new Jt;this.panLimit=0;this.panBox=null;this.zoomPointResolver=null;this.primaryDragMode="auto";this.overviewDist=null;this.pinchAngle=0;this.camera=new fa(e,{fov:go,near:.1,far:5e3,aspect:1}),this.canvas=n,this.requestRender=r,this.onGesture=a,this.onPointerDown=o=>{if(this.interactionEnabled){try{this.canvas.setPointerCapture?.(o.pointerId)}catch{}if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size===1){let i=this.dragAction(),s=i==="orbit"?"pan":"orbit",l=o.button===2||o.button===1||o.shiftKey?s:i;this.panning=l==="pan",this.dragging=!this.panning,this.lastX=o.clientX,this.lastY=o.clientY}else if(this.activePointers.size===2){this.dragging=!1,this.panning=!1,this.pinchDist=this.currentPinchDistance(),this.pinchAngle=this.currentPinchAngle();let i=this.pinchCentroid();this.pinchCx=i.x,this.pinchCy=i.y}}},this.onPointerMove=o=>{if(!this.interactionEnabled||!this.activePointers.has(o.pointerId))return;if(this.activePointers.set(o.pointerId,{x:o.clientX,y:o.clientY}),this.activePointers.size>=2){let m=this.currentPinchDistance(),f=this.pinchCentroid();this.pinchDist>0&&(this.dollyAt(Math.exp((this.pinchDist-m)*.005),f.x,f.y),this.fireGesture()),this.pinchDist=m;let u=this.currentPinchAngle(),c=u-this.pinchAngle;c>Math.PI&&(c-=2*Math.PI),c<-Math.PI&&(c+=2*Math.PI),this.pinchAngle=u,Math.abs(c)>1e-4&&Math.abs(c)<.5&&(this.azT+=c,this.fireGesture()),this.panBy(f.x-this.pinchCx,f.y-this.pinchCy),this.pinchCx=f.x,this.pinchCy=f.y;return}let i=o.clientX-this.lastX,s=o.clientY-this.lastY;if(this.panning){this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&(this.panBy(i,s),this.fireGesture());return}if(!this.dragging)return;this.lastX=o.clientX,this.lastY=o.clientY,(i!==0||s!==0)&&this.fireGesture();let l=ya(i,s);this.azT+=l.azimuth,this.polT=Math.max(en,Math.min(tn,this.polT+l.polar)),this.requestRender()},this.onPointerUp=o=>{this.activePointers.delete(o.pointerId);try{this.canvas.releasePointerCapture?.(o.pointerId)}catch{}this.activePointers.size<2&&(this.pinchDist=0),this.activePointers.size===0&&(this.dragging=!1,this.panning=!1)},this.onContextMenu=o=>{o.preventDefault()},this.onWheel=o=>{if(o.preventDefault(),!this.interactionEnabled)return;let i=o.deltaMode===1?16:o.deltaMode===2?100:1,s=Math.max(-2,Math.min(2,o.deltaY*i/100));this.dollyAt(Math.exp(s*.22),o.clientX,o.clientY),this.fireGesture()},this.onKeyDown=o=>{if(!this.interactionEnabled)return;let i=7*ue;if(o.shiftKey&&(o.key==="ArrowLeft"||o.key==="ArrowRight"||o.key==="ArrowUp"||o.key==="ArrowDown"))this.panBy(o.key==="ArrowLeft"?-32:o.key==="ArrowRight"?32:0,o.key==="ArrowUp"?-32:o.key==="ArrowDown"?32:0);else if(o.key==="ArrowLeft"||o.key==="ArrowRight")this.azT+=o.key==="ArrowLeft"?i:-i;else if(o.key==="ArrowUp"||o.key==="ArrowDown")this.polT=Math.max(en,Math.min(tn,this.polT+(o.key==="ArrowUp"?-i:i)));else if(o.key==="+"||o.key==="=")this.dollyBy(ze);else if(o.key==="-"||o.key==="_")this.dollyBy(nt);else return;o.preventDefault(),this.fireGesture(),this.requestRender()},n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerUp),n.addEventListener("pointercancel",this.onPointerUp),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("keydown",this.onKeyDown),n.addEventListener("contextmenu",this.onContextMenu)}pinchCentroid(){let e=[...this.activePointers.values()];if(!e.length)return{x:0,y:0};let n=0,r=0;for(let a of e)n+=a.x,r+=a.y;return{x:n/e.length,y:r/e.length}}panBy(e,n){let r=this.canvas.clientHeight||1,a=2*this.distance*Math.tan(this.fovY*ue/2)/r,o=Math.sin(this.azimuth),i=Math.cos(this.azimuth),s=i,l=-o,m=Math.cos(this.polar),f=Math.sin(this.polar),u=-o*m,c=-i*m;this.targetT.x+=(-e*s+n*u)*a,this.targetT.z+=(-e*l+n*c)*a,this.targetT.y+=n*f*a,this.clampPan(),this.requestRender()}widenPanBox(e){this.panBox=Sa(this.panBox,e.center,e.radius),this.panAnchor.set(this.panBox.anchor[0],this.panBox.anchor[1],this.panBox.anchor[2]),this.panLimit=this.panBox.limit}clampPan(){if(this.panLimit<=0)return;let e=this.panLimit,n=this.panAnchor.x,r=this.panAnchor.y,a=this.panAnchor.z;this.targetT.x=Math.max(n-e,Math.min(n+e,this.targetT.x)),this.targetT.z=Math.max(a-e,Math.min(a+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?.())}currentPinchAngle(){let[e,n]=[...this.activePointers.values()];return e&&n?Math.atan2(n.y-e.y,n.x-e.x):0}dragAction(){return Pa(this.primaryDragMode,this.distT,this.overviewDist)}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()}dollyAt(e,n,r){let a=this.distT,o=this.canvas.getBoundingClientRect?.(),i=this.zoomPointResolver?.(n,r)??null;if(i){this.distT=Math.max(So,Math.min(this.maxDist,this.distT*e)),this.minDist=Math.min(this.minDist,Math.max(So,this.distT)),this.requestRender(),this.scaleTargetAbout(i,this.distT/a);return}let s=o&&o.width>0&&o.height>0?wa([this.targetT.x,this.targetT.y,this.targetT.z],this.azT,this.polT,this.distT,this.fovY,this.camera.aspect||o.width/o.height,(n-o.left)/o.width*2-1,1-(r-o.top)/o.height*2):null;this.dollyBy(e),s&&this.scaleTargetAbout(s,this.distT/a)}scaleTargetAbout(e,n){!Number.isFinite(n)||n===1||(this.targetT.x=e[0]+(this.targetT.x-e[0])*n,this.targetT.y=e[1]+(this.targetT.y-e[1])*n,this.targetT.z=e[2]+(this.targetT.z-e[2])*n,this.clampPan())}setZoomPointResolver(e){this.zoomPointResolver=e}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,n=!1,r,a=!1,o){this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e);let i=Math.max(1,e.radius),s=this.fovY*ue/2,l=a?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,m=Math.atan(Math.tan(s)*l);this.azT=r??-30*ue,this.polT=Math.max(15,Math.min(80,o?.polarDeg??55))*ue;let f=this.framedOn(e,s,m),u=f.distance;this.target.set(f.center[0],f.center[1],f.center[2]),this.targetT.copy(this.target),this.distT=u*Math.max(1.05,Math.min(2,o?.margin??nn)),this.envelope=xo(this.envelope,i,u),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.overviewDist===null&&(this.overviewDist=this.distT),n?(this.azimuth=this.azT,this.polar=12*ue,this.distance=this.distT*1.7):(this.azimuth=this.azT,this.polar=this.polT,this.distance=this.distT),this.applyPosition()}setAspect(e){if(!(e>0)||!Number.isFinite(e))return;let n=this.camera.aspect;if(this.interactionEnabled&&n>0){let r=Math.min(n,1)/Math.min(e,1);this.distance*=r,this.distT*=r,this.overviewDist!==null&&(this.overviewDist*=r),this.maxDist=Math.max(this.maxDist,this.distance,this.distT),this.applyPosition()}this.camera.perspective({aspect:e})}glideTo(e,n){this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect}),this.widenPanBox(e),this.targetT.set(e.center[0],e.center[1],e.center[2]);let r=this.fovY*ue/2,a=Math.atan(Math.tan(r)*(this.camera.aspect||1));this.azT=this.azimuth,this.polT=Math.max(15,Math.min(80,n?.polarDeg??55))*ue;let o=this.framedOn(e,r,a),i=o.distance;this.targetT.set(o.center[0],o.center[1],o.center[2]),this.distT=i*Math.max(1.05,Math.min(2,n?.margin??nn)),this.envelope=xo(this.envelope,Math.max(1,e.radius),i),this.minDist=this.envelope.minDist,this.maxDist=this.envelope.maxDist,this.requestRender()}frameSoft(e,n,r=!1,a){this.target.set(e.center[0],e.center[1],e.center[2]),this.targetT.copy(this.target),this.widenPanBox(e),this.syncFromCamera(),this.camera.perspective({fov:this.fovY,aspect:this.camera.aspect});let o=this.fovY*ue/2,i=r?Math.max(.82,this.camera.aspect||1):this.camera.aspect||1,s=Math.atan(Math.tan(o)*i);this.azT=n??this.azimuth,this.polT=Math.max(15,Math.min(80,a?.polarDeg??55))*ue;let l=this.framedOn(e,o,s);this.targetT.set(l.center[0],l.center[1],l.center[2]),this.distT=l.distance*Math.max(1.05,Math.min(2,a?.margin??nn))}framedOn(e,n,r){return Ea(e,Math.tan(r),Math.tan(n),this.azT,this.polT,a=>this.fitDistance({...e,center:a},n,r,this.azT,this.polT))}fitDistance(e,n,r,a,o){let i=Math.max(1,e.radius),s=Math.max(i/Math.tan(n),i/Math.tan(r)),l=e.box;if(!l)return s;let m=Mo(a,o);if(!m)return s;let{fx:f,fy:u,fz:c,rx:h,rz:d,ux:b,uy:p,uz:x}=m,A=Math.tan(r),S=Math.tan(n),I=1;for(let w=0;w<8;w++){let D=(w&1?l.max[0]:l.min[0])-e.center[0],G=(w&2?l.max[1]:l.min[1])-e.center[1],F=(w&4?l.max[2]:l.min[2])-e.center[2],z=D*f+G*u+F*c,B=Math.abs(D*h+F*d),U=Math.abs(D*b+G*p+F*x);I=Math.max(I,B/A-z,U/S-z)}let M=Math.min(s,Math.max(I,i*.35)),E=e.fitPoints;if(!E||E.length<9)return M;let k=0,g=1/(A*wo),R=1/(S*wo);for(let w=0;w+2<E.length;w+=3){let D=E[w]-e.center[0],G=E[w+1]-e.center[1],F=E[w+2]-e.center[2],z=D*f+G*u+F*c,B=Math.abs(D*h+F*d),U=Math.abs(D*b+G*p+F*x);k=Math.max(k,B*g-z,U*R-z)}return Math.min(M*1.5,Math.max(M*.55,k))}updateClipping(e){let n=this.camera.position.x-e.center[0],r=this.camera.position.y-e.center[1],a=this.camera.position.z-e.center[2],o=Math.hypot(this.camera.position.x-this.target.x,this.camera.position.y-this.target.y,this.camera.position.z-this.target.z),i=this.interactionEnabled&&Math.abs(o-this.distance)<=this.distance*.01,{near:s,far:l}=_a(Math.hypot(n,r,a),e.radius,i?this.distance:null);this.camera.perspective({near:s,far:l,aspect:this.camera.aspect})}update(){let e=this.azT-this.azimuth,n=this.polT-this.polar,r=this.distT-this.distance,a=this.targetT.x-this.target.x,o=this.targetT.y-this.target.y,i=this.targetT.z-this.target.z,s=Math.max(1e-4,this.distance*1e-4),l=Math.abs(e)>1e-4||Math.abs(n)>1e-4||Math.abs(r)>1e-4||Math.abs(a)>s||Math.abs(o)>s||Math.abs(i)>s;return this.azimuth+=e*Oe,this.polar+=n*Oe,this.distance+=r*Oe,this.target.x+=a*Oe,this.target.y+=o*Oe,this.target.z+=i*Oe,l&&this.applyPosition(),l}get currentAzimuth(){return this.azimuth}get currentDistance(){return this.distance}get targetDistance(){return this.distT}syncFromCamera(){let e=this.camera.position.x-this.target.x,n=this.camera.position.y-this.target.y,r=this.camera.position.z-this.target.z,a=Math.hypot(e,n,r)||1,o=Math.max(en,Math.min(tn,Math.acos(Math.max(-1,Math.min(1,n/a)))));this.distance=this.distT=a,this.polar=this.polT=o,this.azimuth=this.azT=Math.atan2(e,r)}snapshot(){let e=this.target.clone(),n=this.targetT.clone(),{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}=this,m=this.camera.position.clone(),f=[...this.camera.quaternion],u=this.camera.fov;return()=>{this.target.copy(e),this.targetT.copy(n),Object.assign(this,{azimuth:r,azT:a,polar:o,polT:i,distance:s,distT:l}),this.camera.position.copy(m),this.camera.quaternion.set(f[0],f[1],f[2],f[3]),this.camera.perspective({fov:u,aspect:this.camera.aspect}),this.camera.updateMatrixWorld()}}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),n=this.target.x+this.distance*e*Math.sin(this.azimuth),r=this.target.y+this.distance*Math.cos(this.polar),a=this.target.z+this.distance*e*Math.cos(this.azimuth);this.camera.position.set(n,r,a),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()}},Ta=.1,Ra=.25;function _a(t,e,n){let r=Math.max(1,e)*1.18,a=n==null?Ra:Math.max(.05,n*Ta),o=Math.max(a,t-r),i=Math.max(o+10,t+r);return{near:o,far:i}}var Mt=class{constructor(e){this.rafId=0;this.running=!1;this.lastTime=0;this.fpsEma=0;this.rendered=0;this.tick=e=>{let n=this.lastTime?(e-this.lastTime)/1e3:.016666666666666666;if(this.lastTime=e,n>0){let a=1/n;this.fpsEma=this.fpsEma?this.fpsEma*.9+a*.1:a}this.rendered++,this.frame(n)?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}};function Ao(t){let e=!1;return n=>{n!==e&&(e=n,n?t.dataset.slReady="1":delete t.dataset.slReady)}}var Ne=2.5,Ia=1.15,ot=12,He=22,Po=6,Co=9.5,Eo=.9,To=2.2,on=30,rn=4,At=8192;var cl=He+rn;function Ro(t,e){let n=e*1.4,r=e*3.2;if(t<=n)return{scale:1,fade:0,minPixels:Ne};let a=Math.min(1,(t-n)/Math.max(.001,r-n));return{scale:1-a*.4,fade:a*.55,minPixels:Ne+a*(Ia-Ne)}}function _o(t,e,n){return!(t>0)||!(e>0)||!(n>0)?!1:e*n/t>=64}var Fa=12;function Io(t,e,n,r,a){if(!(t>0)||!(e>0)||!(n>0)||!(r>0)||!(a>0))return!1;let o=Math.tan(r/2*Math.PI/180);if(!(o>0))return!1;let i=e/(n*o)*(a/2);return Math.PI*i*i/t>=Fa}import{Geometry as Da,Mesh as ka,Program as Va,Transform as La}from"ogl";var Oa=.05,za=1.1,Na=12,Ha=1.6,Ga=1,Ba=2.5,Wa=650,Do=[[-.15,0,0,.15,.13,.42],[-.13,-.45,.36,.13,.02,.47]],ko={centre:[0,0,-.05],hipRadius:.15,shoulderRadius:.2,height:.56,sides:8,depth:.62},an={centre:[0,.74,-.04],radii:[.1,.12,.11]},Ge={height:6,baseRadius:.16,topRadius:.3,fadeInFromM:16,fullByM:40},Ua=90,ml={height:an.centre[1]+an.radii[1],radius:Math.max(ko.shoulderRadius,...Do.map(t=>Math.max(Math.abs(t[0]),Math.abs(t[3]))))};function Ya(t,e){if(e)return 0;let n=(t-Ge.fadeInFromM)/(Ge.fullByM-Ge.fadeInFromM);return Math.max(0,Math.min(1,n))}function Xa(t,e){return!e&&t<Ua}var Fo=24;function qa(t){let e=[],n=[],r=[],a=(u,c,h)=>{e.push(...u),n.push(...c),r.push(h)};for(let u=0;u<16;u++){let c=u/16*Math.PI*2,h=(u+1)/16*Math.PI*2,d=S=>[Math.cos(S),0,Math.sin(S)],b=[Math.cos(c)*.012,0,Math.sin(c)*.012],p=[Math.cos(h)*.012,0,Math.sin(h)*.012],x=[Math.cos(c)*.03,1,Math.sin(c)*.03],A=[Math.cos(h)*.03,1,Math.sin(h)*.03];a(b,d(c),0),a(x,d(c),0),a(A,d(h),0),a(b,d(c),0),a(A,d(h),0),a(p,d(h),0)}let l=.16,m=.24,f=.01;for(let u=0;u<48;u++){let c=u/48*Math.PI*2,h=(u+1)/48*Math.PI*2,d=[Math.cos(c)*l,f,Math.sin(c)*l],b=[Math.cos(c)*m,f,Math.sin(c)*m],p=[Math.cos(h)*m,f,Math.sin(h)*m],x=[Math.cos(h)*l,f,Math.sin(h)*l];for(let A of[d,b,p,d,p,x])a(A,[0,1,0],1)}for(let[u,c,h,d,b,p]of Do){let x=[[[0,0,1],[[u,c,p],[d,c,p],[d,b,p],[u,b,p]]],[[0,0,-1],[[d,c,h],[u,c,h],[u,b,h],[d,b,h]]],[[1,0,0],[[d,c,p],[d,c,h],[d,b,h],[d,b,p]]],[[-1,0,0],[[u,c,h],[u,c,p],[u,b,p],[u,b,h]]],[[0,1,0],[[u,b,p],[d,b,p],[d,b,h],[u,b,h]]],[[0,-1,0],[[u,c,h],[d,c,h],[d,c,p],[u,c,p]]]];for(let[A,[S,I,M,E]]of x)for(let k of[S,I,M,S,M,E])a(k,A,2)}{let{centre:u,hipRadius:c,shoulderRadius:h,height:d,sides:b,depth:p}=ko,x=(A,S,I)=>{let M=A/b*Math.PI*2+Math.PI/b;return[u[0]+Math.cos(M)*S,u[1]+I,u[2]+Math.sin(M)*S*p]};for(let A=0;A<b;A++){let S=x(A,c,0),I=x(A+1,c,0),M=x(A+1,h,d),E=x(A,h,d),k=[I[0]-S[0],I[1]-S[1],I[2]-S[2]],g=[E[0]-S[0],E[1]-S[1],E[2]-S[2]],R=[k[1]*g[2]-k[2]*g[1],k[2]*g[0]-k[0]*g[2],k[0]*g[1]-k[1]*g[0]],w=Math.hypot(...R)||1;R=[R[0]/w,R[1]/w,R[2]/w],R[0]*(S[0]-u[0])+R[2]*(S[2]-u[2])<0&&(R=[-R[0],-R[1],-R[2]]);for(let D of[S,I,M,S,M,E])a(D,R,2);a([u[0],u[1]+d,u[2]],[0,1,0],2),a(E,[0,1,0],2),a(M,[0,1,0],2)}}{let{centre:u,radii:c}=an,h=8,d=(b,p)=>{let x=b/16*Math.PI*2,A=p/h*Math.PI,S=[Math.sin(A)*Math.cos(x),Math.cos(A),Math.sin(A)*Math.sin(x)];return[[u[0]+S[0]*c[0],u[1]+S[1]*c[1],u[2]+S[2]*c[2]],S]};for(let b=0;b<16;b++)for(let p=0;p<h;p++){let x=d(b,p),A=d(b+1,p),S=d(b+1,p+1),I=d(b,p+1);for(let[M,E]of[x,A,S,x,S,I])a(M,E,2)}}for(let u=0;u<32;u++){let c=u/32*Math.PI*2,h=(u+1)/32*Math.PI*2,d=Ge.baseRadius,b=Ge.topRadius,p=[Math.cos(c)*d,0,Math.sin(c)*d],x=[Math.cos(h)*d,0,Math.sin(h)*d],A=[Math.cos(c)*b,1,Math.sin(c)*b],S=[Math.cos(h)*b,1,Math.sin(h)*b],I=[Math.cos(c),0,Math.sin(c)],M=[Math.cos(h),0,Math.sin(h)];a(p,I,3),a(A,I,3),a(S,M,3),a(p,I,3),a(S,M,3),a(x,M,3)}return new Da(t,{position:{size:3,data:new Float32Array(e)},normal:{size:3,data:new Float32Array(n)},part:{size:1,data:new Float32Array(r)}})}var ja=`#version 300 es
|
|
2
2
|
precision highp float;
|
|
3
3
|
in vec3 position; in vec3 normal; in float part;
|
|
4
4
|
uniform mat4 modelViewMatrix; uniform mat4 projectionMatrix; uniform mat3 normalMatrix;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as f,F as d}from"../../chunk-
|
|
1
|
+
import{C as f,F as d}from"../../chunk-EYJ5T5JM.js";import"../../chunk-GCIZT3CV.js";import"../../chunk-O4ZAGGMP.js";import"../../chunk-VSX4JWN7.js";import"../../chunk-GZYHULZY.js";import"../../chunk-4SHLBEG5.js";import"../../chunk-QFX6XSO6.js";import"../../chunk-DO545QTN.js";import"../../chunk-4N5CHKHD.js";import"../../chunk-4LW4TZZR.js";import"../../chunk-TFYAMLCK.js";import"../../chunk-DDQWZ323.js";import"../../chunk-522ENS2Q.js";import"../../chunk-UKODEMIM.js";import{eb as i}from"../../chunk-HKVCBUON.js";import"../../chunk-KTMZ3QAO.js";import"../../chunk-JBOTRSMY.js";import"../../chunk-CRCGO52K.js";function p(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(t=>t.buffer)}var c=self;c.onmessage=e=>{let s=performance.now(),t=!e.data.seats,r=e.data.seats??i(e.data.doc),{input:u,estimate:a}=d({doc:e.data.doc,seats:r,eventConfigurationId:e.data.eventConfigurationId,eventConfiguration:e.data.eventConfiguration,registeredShellGlb:e.data.registeredShellGlb,estimate:e.data.estimate}),o=f(u),n=p(o);a&&n.push(a.eyeHeightM.buffer,a.focal.buffer),c.postMessage({model:o,buildMs:performance.now()-s,...t?{seats:r}:{},...a?{estimate:a}:{}},n)};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seatlayer/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.105.0",
|
|
4
4
|
"description": "SeatLayer's seat map rendering engine — the seating chart runtime behind @seatlayer/js and the React, Vue, and Angular SDKs.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": {
|
package/dist/chunk-6YTPIDLM.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as X}from"./chunk-TFYAMLCK.js";import{O as v,Xa as L,Ya as j,cb as $,eb as B,fb as D}from"./chunk-HKVCBUON.js";var W=.08,U=.045;function Y(t){return`__floor__:${encodeURIComponent(t)}`}function R(t,n,r){return{...t,objects:n,floors:void 0,...r?{focalPoint:r}:{},referenceImage:void 0,backgroundImage:void 0}}function N(t,n,r){let s=t.focalPoint??n.focalPoint;return s?s.x:r.x+r.width/2}function V(t){let n=t.floors??[];if(!n.length)return[];let r=n.map(e=>D(R(t,e.objects,e.focalPoint),{freeText:"exclude"})),c=Math.max(1,...r.map(e=>e.width))*W,o=0;return n.map((e,a)=>{let i=r[a],l=o-(i.y+i.height);return o-=i.height+c,{floorId:e.id,label:e.name??e.id,level:a,levelBadge:a===0?"G":String(a),translation:{x:-N(e,t,i),y:l},bounds:i}})}function Z(t,n,r,s){let c=n==="name"?t.label:t.levelBadge;if(!c)return[];let o=Math.max(1,r*U),e=t.bounds.x+t.translation.x-o*2.4,a=t.bounds.y+t.translation.y+o*.4,i=`floor-level-${t.floorId}`,l={type:"text",id:`${i}-text`,text:c,position:{x:e,y:a},fontSize:o,rotation:0,color:s,bold:!0};if(n==="name")return[l];let h=o*.95;return[{type:"shape",id:`${i}-badge`,kind:"ellipse",x:e-h*.35,y:a-h*.3,width:h*2,height:h*2,fill:"transparent",stroke:{color:s,width:Math.max(1,o*.09)},opacity:.8},l]}function at(t,n={}){let r=t.floors;if(!r||r.length<2)return t;let s=V(t),c=[];r.forEach((l,h)=>{let{x:p,y:x}=s[h].translation;for(let b of l.objects)h>0&&b.type==="shape"&&b.role==="stage"||c.push($(b,p,x))});let o={...t,objects:c,floors:void 0},e=D(o,{freeText:"exclude"}),a=Math.max(1,e.width,e.height),i=t.theme?.textColor??"#94a3b8";for(let l of s)c.push(...Z(l,n.labelStyle??"number",a,i));return{...o,objects:c,referenceImage:void 0,backgroundImage:void 0}}function it(t){if(!t.floors||t.floors.length<2)return t;let n=!t.zones?.length,r=new Set,s=t.floors.flatMap(o=>o.objects.flatMap(e=>{if(e.type==="shape"&&e.role==="stage"){let a=JSON.stringify([e.kind,e.x,e.y,e.width,e.height,e.points,e.rotation??0,e.label,e.heightM,e.eventConfigurationIds]);if(r.has(a))return[];r.add(a)}return n&&e.type==="section"?[{...e,zone:Y(o.id)}]:[e]})),c=n?t.floors.map(o=>({id:Y(o.id),label:o.name,focalPoint:{...o.focalPoint}})):t.zones;return{...t,objects:s,zones:c,floors:void 0,referenceImage:void 0,backgroundImage:X(t)}}function q(t){return t.floorOverview==="combined"?"combined":"separated"}function ct(t){if((t.floors??[]).length<2)return"separated";let r=z.get(t);if(r)return r;let s=H(t)?"separated":"combined";return z.set(t,s),s}var G=.1,E=18,z=new WeakMap;function H(t){let n=t.floors??[],r=(o,e)=>`${Math.floor(o/E)}:${Math.floor(e/E)}`,s=n.map(o=>{let e=B(R(t,o.objects,o.focalPoint)).map(i=>({x:i.x,y:i.y})),a={areas:[],seats:new Map};for(let i of o.objects)i.type==="section"&&i.outline?.length>=3&&a.areas.push({outer:i.outline,holes:i.holes}),i.type==="gaArea"&&i.points?.length>=3&&a.areas.push({outer:i.points,holes:i.holes});for(let i of e){let l=r(i.x,i.y),h=a.seats.get(l);h?h.push(i):a.seats.set(l,[i])}return{seats:e,footprint:a}}),c=(o,e)=>{let a=Math.floor(o.x/E),i=Math.floor(o.y/E);for(let l=-1;l<=1;l+=1)for(let h=-1;h<=1;h+=1)for(let p of e.seats.get(`${a+l}:${i+h}`)??[])if(Math.hypot(p.x-o.x,p.y-o.y)<E)return!0;return!1};return s.some((o,e)=>{if(!o.seats.length)return!1;let a=s.filter((l,h)=>h!==e).map(l=>l.footprint),i=0;for(let l of o.seats)a.some(h=>h.areas.some(p=>L(l,p.outer,p.holes))||c(l,h))&&(i+=1);return i/o.seats.length>G})}var T="level-context:";function lt(t,n){let r=t.floors??[];if(r.length<2||q(t)!=="combined")return[];let s="#8a93a6",c=[],o=r.find(a=>a.id===n),e=o?D(R(t,o.objects,o.focalPoint),{freeText:"exclude"}):null;for(let a of r){if(a.id===n)continue;let i=0;for(let x of a.objects){let b=x.type==="section"?x.outline:x.type==="gaArea"?x.points:null;if(!b||b.length<3)continue;let d={type:"shape",id:`${T}${a.id}:${i++}`,kind:"polygon",label:"",points:b.map(m=>({...m})),fill:"transparent",stroke:{color:s,width:1.5},opacity:.35};c.push(d)}let l=D(R(t,a.objects,a.focalPoint),{freeText:"exclude"});if(!i||!e||!K(l,e))continue;let h=c.filter(x=>x.type==="shape"&&x.id.startsWith(`${T}${a.id}:`)&&!!x.points),p=h.reduce((x,b)=>Q(b.points)>Q(x.points)?b:x,h[0]);c.push({type:"text",id:`${T}${a.id}:name`,text:a.name??a.id,position:j(p.points,void 0),fontSize:Math.max(1,Math.max(e.width,e.height)*.024),rotation:0,color:s,opacity:.6})}return c}function K(t,n){return t.x>=n.x&&t.y>=n.y&&t.x+t.width<=n.x+n.width&&t.y+t.height<=n.y+n.height}function Q(t){let n=t.map(s=>s.x),r=t.map(s=>s.y);return(Math.max(...n)-Math.min(...n))*(Math.max(...r)-Math.min(...r))}function ht(t){let n=t.floors;if(!n?.length)return null;let r=n.find(o=>o.objects.some(e=>e.type==="shape"&&e.role==="stage"));if(r)return r.id;let s=n[0],c=-1;for(let o of n){let e=D(R(t,o.objects,o.focalPoint),{freeText:"exclude"}),a=e.width*e.height;a>c&&(c=a,s=o)}return s.id}var ft=640;function ut(t,n){return(t.floors?.length??0)<2?null:"all"}var J=9;function tt(t){if(t.kind==="circle")return{hx:t.r,hy:t.r};let n=t.width/2,r=t.height/2,s=t.rotation??0;if(!s)return{hx:n,hy:r};let c=s*Math.PI/180,o=Math.abs(Math.cos(c)),e=Math.abs(Math.sin(c));return{hx:n*o+r*e,hy:n*e+r*o}}function et(t,n,r){let s=n-t.seat.x,c=r-t.seat.y;if(t.shape.kind==="circle")return s*s+c*c<=t.shape.r*t.shape.r;let o=t.shape.rotation??0,e=s,a=c;if(o){let i=-o*Math.PI/180,l=Math.cos(i),h=Math.sin(i);e=s*l-c*h,a=s*h+c*l}return Math.abs(e)<=t.shape.width/2&&Math.abs(a)<=t.shape.height/2}function nt(t,n,r,s,c){if(t.shape.kind==="circle"){let d=Math.min(Math.max(t.seat.x,n),s),m=Math.min(Math.max(t.seat.y,r),c),y=t.seat.x-d,g=t.seat.y-m;return y*y+g*g<=t.shape.r*t.shape.r}let o=t.shape.rotation??0;if(!o)return t.seat.x-t.hx<=s&&t.seat.x+t.hx>=n&&t.seat.y-t.hy<=c&&t.seat.y+t.hy>=r;let e=o*Math.PI/180,a=Math.cos(e),i=Math.sin(e),l=t.shape.width/2,h=t.shape.height/2,p=[[-l,-h],[l,-h],[l,h],[-l,h]].map(([d,m])=>[t.seat.x+d*a-m*i,t.seat.y+d*i+m*a]),x=[[n,r],[s,r],[s,c],[n,c]],b=[[1,0],[0,1],[a,i],[-i,a]];for(let[d,m]of b){let y=1/0,g=-1/0;for(let[O,k]of p){let f=O*d+k*m;f<y&&(y=f),f>g&&(g=f)}let S=1/0,w=-1/0;for(let[O,k]of x){let f=O*d+k*m;f<S&&(S=f),f>w&&(w=f)}if(g<S||w<y)return!1}return!0}function xt(t,n={}){let r=n.seatRadius??J,s=t.length,c=new Array(s),o=1/0,e=1/0,a=-1/0,i=-1/0,l=0;for(let f=0;f<s;f++){let u=t[f],F=n.shapeOf?.(u)??{kind:"circle",r},{hx:I,hy:M}=tt(F);c[f]={seat:u,shape:F,hx:I,hy:M},u.x-I<o&&(o=u.x-I),u.y-M<e&&(e=u.y-M),u.x+I>a&&(a=u.x+I),u.y+M>i&&(i=u.y+M),I>l&&(l=I),M>l&&(l=M)}s===0&&(o=0,e=0,a=0,i=0);let h=l>0?l*4:1,p=Math.max(a-o,0),x=Math.max(i-e,0),b=Math.max(64,n.maxCells??s*4),d=h,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);for(;m*y>b&&(m>1||y>1);)d*=2,m=Math.max(1,Math.ceil(p/d)||1),y=Math.max(1,Math.ceil(x/d)||1);let g=m*y,S=new Int32Array(g+1),w=0;for(let f=0;f<s;f++){let u=c[f],F=v(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),I=v(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=v(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),_=v(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=_;P++)for(let C=F;C<=I;C++)S[P*m+C+1]++,w++}for(let f=0;f<g;f++)S[f+1]+=S[f];let O=new Int32Array(w),k=S.slice(0,g);for(let f=0;f<s;f++){let u=c[f],F=v(Math.floor((u.seat.x-u.hx-o)/d),0,m-1),I=v(Math.floor((u.seat.x+u.hx-o)/d),0,m-1),M=v(Math.floor((u.seat.y-u.hy-e)/d),0,y-1),_=v(Math.floor((u.seat.y+u.hy-e)/d),0,y-1);for(let P=M;P<=_;P++)for(let C=F;C<=I;C++){let A=P*m+C;O[k[A]++]=f}}return{seats:t,entries:c,minX:o,minY:e,cell:d,cols:m,rows:y,cellStart:S,items:O,stamp:new Int32Array(s),epoch:0}}function yt(t,n,r={}){let{cols:s,rows:c,cell:o,minX:e,minY:a,cellStart:i,items:l,entries:h}=t,p=Math.floor((n.x-e)/o),x=Math.floor((n.y-a)/o);if(p<0||x<0||p>=s||x>=c)return null;let b=x*s+p,d=i[b+1],m=-1,y=1/0;for(let g=i[b];g<d;g++){let S=l[g],w=h[S];if(r.filter&&!r.filter(w.seat.id,w.seat)||!et(w,n.x,n.y))continue;let O=n.x-w.seat.x,k=n.y-w.seat.y,f=O*O+k*k;(f<y||f===y&&S<m)&&(y=f,m=S)}return m<0?null:h[m].seat.id}function pt(t,n,r,s={}){if(!(r>0))return null;let{cols:c,rows:o,cell:e,minX:a,minY:i,cellStart:l,items:h,entries:p}=t,x=Math.max(0,Math.floor((n.x-r-a)/e)),b=Math.min(c-1,Math.floor((n.x+r-a)/e)),d=Math.max(0,Math.floor((n.y-r-i)/e)),m=Math.min(o-1,Math.floor((n.y+r-i)/e));if(x>b||d>m)return null;let y=-1,g=r*r,S=t.stamp,w=++t.epoch;for(let O=d;O<=m;O++){let k=O*c;for(let f=x;f<=b;f++){let u=k+f,F=l[u+1];for(let I=l[u];I<F;I++){let M=h[I];if(S[M]===w)continue;S[M]=w;let _=p[M];if(s.filter&&!s.filter(_.seat.id,_.seat))continue;let P=n.x-_.seat.x,C=n.y-_.seat.y,A=P*P+C*C;(A<g||A===g&&M<y)&&(g=A,y=M)}}}return y<0?null:p[y].seat.id}function bt(t,n,r={}){let s=Math.min(n.x,n.x+n.width),c=Math.max(n.x,n.x+n.width),o=Math.min(n.y,n.y+n.height),e=Math.max(n.y,n.y+n.height),a=r.mode??"center",{cols:i,rows:l,cell:h,minX:p,minY:x,cellStart:b,items:d,entries:m}=t,y=Math.max(0,Math.floor((s-p)/h)),g=Math.min(i-1,Math.floor((c-p)/h)),S=Math.max(0,Math.floor((o-x)/h)),w=Math.min(l-1,Math.floor((e-x)/h));if(y>g||S>w)return[];let O=[],k=t.stamp,f=++t.epoch;for(let u=S;u<=w;u++){let F=u*i;for(let I=y;I<=g;I++){let M=F+I,_=b[M+1];for(let P=b[M];P<_;P++){let C=d[P];if(k[C]===f)continue;k[C]=f;let A=m[C];if(r.filter&&!r.filter(A.seat.id,A.seat))continue;(a==="center"?A.seat.x>=s&&A.seat.x<=c&&A.seat.y>=o&&A.seat.y<=e:nt(A,s,o,c,e))&&O.push(C)}}}return O.sort((u,F)=>u-F),O.map(u=>m[u].seat.id)}function gt(t){let n=t.cols*t.rows,r=0,s=0;for(let o=0;o<n;o++){let e=t.cellStart[o+1]-t.cellStart[o];e>0&&r++,e>s&&(s=e)}let c=t.items.length;return{cell:t.cell,cols:t.cols,rows:t.rows,cells:n,occupiedCells:r,refs:c,maxPerCell:s,meanPerOccupiedCell:r?c/r:0}}export{W as a,Y as b,V as c,at as d,it as e,q as f,ct as g,G as h,T as i,lt as j,ht as k,ft as l,ut as m,J as n,xt as o,yt as p,pt as q,bt as r,gt as s};
|