@seatlayer/core 0.106.1 → 0.106.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-C5GKFG36.js → chunk-45W3GKPP.js} +1 -1
- package/dist/{chunk-UGMXII72.js → chunk-6DZ2EVH2.js} +1 -1
- package/dist/{chunk-TAKLS47V.js → chunk-IFQFHR6Q.js} +1 -1
- package/dist/chunk-J33DNOMI.js +1 -0
- package/dist/{chunk-MLPJTJFE.js → chunk-N562FZPD.js} +1 -1
- package/dist/{chunk-3YNO3XCY.js → chunk-NXZ2GLII.js} +1 -1
- package/dist/{chunk-M4J7U2E2.js → chunk-QXJEN5LV.js} +1 -1
- package/dist/{chunk-V65VJE6F.js → chunk-RI4LNRP4.js} +1 -1
- package/dist/{chunk-FQTSVDD4.js → chunk-T7DQX3MB.js} +1 -1
- package/dist/chunk-WGRLTDLW.js +1 -0
- package/dist/{chunk-INCPWAWP.js → chunk-YGRBCSUI.js} +1 -1
- package/dist/core/chart-ops/index.js +1 -1
- package/dist/core/inventory/index.cjs +1 -1
- package/dist/core/inventory/index.js +1 -1
- package/dist/core/layout/index.cjs +1 -1
- package/dist/core/layout/index.js +1 -1
- package/dist/core/sections/index.cjs +1 -1
- package/dist/core/sections/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -1
- package/dist/view3d/index.cjs +44 -44
- package/dist/view3d/index.js +1 -1
- package/dist/view3d/scene/scene.worker.cjs +1 -1
- package/dist/view3d/scene/scene.worker.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-3DHQYZ47.js +0 -1
- package/dist/chunk-5R6I2XL7.js +0 -1
package/dist/view3d/index.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-3DHQYZ47.js";import"../chunk-M4J7U2E2.js";import"../chunk-UGMXII72.js";import"../chunk-3YNO3XCY.js";import"../chunk-C5GKFG36.js";import"../chunk-LWBTU56C.js";import"../chunk-FQTSVDD4.js";import"../chunk-TAKLS47V.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-4N5CHKHD.js";import{b as qn,c as qt,d as jn,n as $n}from"../chunk-JXIX3PNI.js";import"../chunk-M4NGX5NM.js";import"../chunk-MADX5HYP.js";import"../chunk-R6BN4HDQ.js";import"../chunk-MLPJTJFE.js";import{eb as Un}from"../chunk-5R6I2XL7.js";import"../chunk-S3VH7IDA.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-WGRLTDLW.js";import"../chunk-6DZ2EVH2.js";import"../chunk-45W3GKPP.js";import{d as gt}from"../chunk-YPVYZYMH.js";import"../chunk-LWBTU56C.js";import"../chunk-QXJEN5LV.js";import"../chunk-NXZ2GLII.js";import"../chunk-T7DQX3MB.js";import"../chunk-IFQFHR6Q.js";import"../chunk-4N5CHKHD.js";import{b as qn,c as qt,d as jn,n as $n}from"../chunk-JXIX3PNI.js";import"../chunk-M4NGX5NM.js";import"../chunk-MADX5HYP.js";import"../chunk-R6BN4HDQ.js";import"../chunk-N562FZPD.js";import{eb as Un}from"../chunk-J33DNOMI.js";import"../chunk-S3VH7IDA.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;
|