@epigraph/solutions 0.19.0 → 0.21.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/README.md +8 -0
- package/dist/epigraph-solutions.js +8 -8
- package/package.json +4 -5
package/README.md
CHANGED
|
@@ -11,3 +11,11 @@ A collection of solutions offered by Epigraph. The intent of this initiative to
|
|
|
11
11
|
## `<epigraph-tour/>`
|
|
12
12
|
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
13
13
|
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
14
|
+
|
|
15
|
+
## `<epigraph-previewer/>`
|
|
16
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
17
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
18
|
+
|
|
19
|
+
## `<epigraph-hotspot-tool/>`
|
|
20
|
+
- Quickstart Guide: https://docs.myepigraph.com/docs/epigraph-tour-quickstart#/
|
|
21
|
+
- Knowledgebase: https://docs.myepigraph.com/update/docs/epigraph-tour-knowledgebase#/
|
|
@@ -4201,7 +4201,7 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
4201
4201
|
* https://github.com/yomotsu/camera-controls
|
|
4202
4202
|
* (c) 2017 @yomotsu
|
|
4203
4203
|
* Released under the MIT License.
|
|
4204
|
-
*/const ii={LEFT:1,RIGHT:2,MIDDLE:4},_e=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),Io={NONE:0,IN:1,OUT:-1};function fa(o){return o.isPerspectiveCamera}function Cr(o){return o.isOrthographicCamera}const xr=Math.PI*2,Iv=Math.PI/2,vC=1e-5,Cc=Math.PI/180;function ss(o,e,t){return Math.max(e,Math.min(t,o))}function Qt(o,e=vC){return Math.abs(o)<e}function Ot(o,e,t=vC){return Qt(o-e,t)}function Mv(o,e){return Math.round(o/e)*e}function Tc(o){return isFinite(o)?o:o<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ic(o){return Math.abs(o)<Number.MAX_VALUE?o:o*(1/0)}function Vh(o,e,t,i,a=1/0,l){i=Math.max(1e-4,i);const u=2/i,d=u*l,p=1/(1+d+.48*d*d+.235*d*d*d);let m=o-e;const A=e,_=a*i;m=ss(m,-_,_),e=o-m;const b=(t.value+u*m)*l;t.value=(t.value-u*b)*p;let w=e+(m+b)*p;return A-o>0==w>A&&(w=A,t.value=(w-A)/l),w}function Rv(o,e,t,i,a=1/0,l,u){i=Math.max(1e-4,i);const d=2/i,p=d*l,m=1/(1+p+.48*p*p+.235*p*p*p);let A=e.x,_=e.y,b=e.z,w=o.x-A,E=o.y-_,C=o.z-b;const T=A,x=_,P=b,M=a*i,R=M*M,D=w*w+E*E+C*C;if(D>R){const V=Math.sqrt(D);w=w/V*M,E=E/V*M,C=C/V*M}A=o.x-w,_=o.y-E,b=o.z-C;const G=(t.x+d*w)*l,U=(t.y+d*E)*l,H=(t.z+d*C)*l;t.x=(t.x-d*G)*m,t.y=(t.y-d*U)*m,t.z=(t.z-d*H)*m,u.x=A+(w+G)*m,u.y=_+(E+U)*m,u.z=b+(C+H)*m;const k=T-o.x,$=x-o.y,Q=P-o.z,Z=u.x-T,X=u.y-x,s=u.z-P;return k*Z+$*X+Q*s>0&&(u.x=T,u.y=x,u.z=P,t.x=(u.x-T)/l,t.y=(u.y-x)/l,t.z=(u.z-P)/l),u}function vm(o,e){e.set(0,0),o.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=o.length,e.y/=o.length}function wm(o,e){return Cr(o)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class iF{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e)}}}var Em;const nF="3.1.0",Qh=1/8,sF=/Mac/.test((Em=globalThis?.navigator)===null||Em===void 0?void 0:Em.platform);let rt,Bv,qh,xm,_n,ut,Rt,Mo,Mc,As,_s,pa,Pv,Lv,Cn,Ro,Bo,Dv,Sm,Nv,Cm,Tm,jh;class Ua extends iF{static install(e){rt=e.THREE,Bv=Object.freeze(new rt.Vector3(0,0,0)),qh=Object.freeze(new rt.Vector3(0,1,0)),xm=Object.freeze(new rt.Vector3(0,0,1)),_n=new rt.Vector2,ut=new rt.Vector3,Rt=new rt.Vector3,Mo=new rt.Vector3,Mc=new rt.Vector3,As=new rt.Vector3,_s=new rt.Vector3,pa=new rt.Vector3,Pv=new rt.Vector3,Lv=new rt.Vector3,Cn=new rt.Spherical,Ro=new rt.Spherical,Bo=new rt.Box3,Dv=new rt.Box3,Sm=new rt.Sphere,Nv=new rt.Quaternion,Cm=new rt.Quaternion,Tm=new rt.Matrix4,jh=new rt.Raycaster}static get ACTION(){return _e}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=_e.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Io.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new rt.Vector3,this._focalOffsetVelocity=new rt.Vector3,this._zoomVelocity={value:0},this._truckInternal=(x,P,M,R)=>{let D,G;if(fa(this._camera)){const U=ut.copy(this._camera.position).sub(this._target),H=this._camera.getEffectiveFOV()*Cc,k=U.length()*Math.tan(H*.5);D=this.truckSpeed*x*k/this._elementRect.height,G=this.truckSpeed*P*k/this._elementRect.height}else if(Cr(this._camera)){const U=this._camera;D=this.truckSpeed*x*(U.right-U.left)/U.zoom/this._elementRect.width,G=this.truckSpeed*P*(U.top-U.bottom)/U.zoom/this._elementRect.height}else return;R?(M?this.setFocalOffset(this._focalOffsetEnd.x+D,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(D,0,!0),this.forward(-G,!0)):M?this.setFocalOffset(this._focalOffsetEnd.x+D,this._focalOffsetEnd.y+G,this._focalOffsetEnd.z,!0):this.truck(D,G,!0)},this._rotateInternal=(x,P)=>{const M=xr*this.azimuthRotateSpeed*x/this._elementRect.height,R=xr*this.polarRotateSpeed*P/this._elementRect.height;this.rotate(M,R,!0)},this._dollyInternal=(x,P,M)=>{const R=Math.pow(.95,-x*this.dollySpeed),D=this._sphericalEnd.radius,G=this._sphericalEnd.radius*R,U=ss(G,this.minDistance,this.maxDistance),H=U-G;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(G,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(H,!0),this._dollyToNoClamp(U,!0)):this._dollyToNoClamp(U,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?G:U)-D,this._dollyControlCoord.set(P,M)),this._lastDollyDirection=Math.sign(-x)},this._zoomInternal=(x,P,M)=>{const R=Math.pow(.95,x*this.dollySpeed),D=this._zoom,G=this._zoom*R;this.zoomTo(G,!0),this.dollyToCursor&&(this._changedZoom+=G-D,this._dollyControlCoord.set(P,M))},typeof rt>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new rt.Quaternion().setFromUnitVectors(this._camera.up,qh),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=_e.NONE,this._target=new rt.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new rt.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new rt.Spherical().setFromVector3(ut.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new rt.Vector3,new rt.Vector3,new rt.Vector3,new rt.Vector3],this._updateNearPlaneCorners(),this._boundary=new rt.Box3(new rt.Vector3(-1/0,-1/0,-1/0),new rt.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new rt.Vector2,this.mouseButtons={left:_e.ROTATE,middle:_e.DOLLY,right:_e.TRUCK,wheel:fa(this._camera)?_e.DOLLY:Cr(this._camera)?_e.ZOOM:_e.NONE},this.touches={one:_e.TOUCH_ROTATE,two:fa(this._camera)?_e.TOUCH_DOLLY_TRUCK:Cr(this._camera)?_e.TOUCH_ZOOM_TRUCK:_e.NONE,three:_e.TOUCH_TRUCK};const i=new rt.Vector2,a=new rt.Vector2,l=new rt.Vector2,u=x=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const R=this._domElement.getBoundingClientRect(),D=x.clientX/R.width,G=x.clientY/R.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||G<this._interactiveArea.top||G>this._interactiveArea.bottom)return}const P=x.pointerType!=="mouse"?null:(x.buttons&ii.LEFT)===ii.LEFT?ii.LEFT:(x.buttons&ii.MIDDLE)===ii.MIDDLE?ii.MIDDLE:(x.buttons&ii.RIGHT)===ii.RIGHT?ii.RIGHT:null;if(P!==null){const R=this._findPointerByMouseButton(P);R&&this._disposePointer(R)}if((x.buttons&ii.LEFT)===ii.LEFT&&this._lockedPointer)return;const M={pointerId:x.pointerId,clientX:x.clientX,clientY:x.clientY,deltaX:0,deltaY:0,mouseButton:P};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.ownerDocument.addEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",p),this._isDragging=!0,b(x)},d=x=>{x.cancelable&&x.preventDefault();const P=x.pointerId,M=this._lockedPointer||this._findPointerById(P);if(M){if(M.clientX=x.clientX,M.clientY=x.clientY,M.deltaX=x.movementX,M.deltaY=x.movementY,this._state=0,x.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(x.buttons&ii.LEFT)===ii.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(x.buttons&ii.MIDDLE)===ii.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(x.buttons&ii.RIGHT)===ii.RIGHT&&(this._state=this._state|this.mouseButtons.right);w()}},p=x=>{const P=this._findPointerById(x.pointerId);if(!(P&&P===this._lockedPointer)){if(P&&this._disposePointer(P),x.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=_e.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=_e.NONE;E()}};let m=-1;const A=x=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===_e.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const G=this._domElement.getBoundingClientRect(),U=x.clientX/G.width,H=x.clientY/G.height;if(U<this._interactiveArea.left||U>this._interactiveArea.right||H<this._interactiveArea.top||H>this._interactiveArea.bottom)return}if(x.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===_e.ROTATE||this.mouseButtons.wheel===_e.TRUCK){const G=performance.now();m-G<1e3&&this._getClientRect(this._elementRect),m=G}const P=sF?-1:-3,M=x.deltaMode===1||x.ctrlKey?x.deltaY/P:x.deltaY/(P*10),R=this.dollyToCursor?(x.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(x.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case _e.ROTATE:{this._rotateInternal(x.deltaX,x.deltaY),this._isUserControllingRotate=!0;break}case _e.TRUCK:{this._truckInternal(x.deltaX,x.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case _e.SCREEN_PAN:{this._truckInternal(x.deltaX,x.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case _e.OFFSET:{this._truckInternal(x.deltaX,x.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case _e.DOLLY:{this._dollyInternal(-M,R,D),this._isUserControllingDolly=!0;break}case _e.ZOOM:{this._zoomInternal(-M,R,D),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=x=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Ua.ACTION.NONE){const P=x instanceof PointerEvent?x.pointerId:0,M=this._findPointerById(P);M&&this._disposePointer(M),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p);return}x.preventDefault()}},b=x=>{if(!this._enabled)return;if(vm(this._activePointers,_n),this._getClientRect(this._elementRect),i.copy(_n),a.copy(_n),this._activePointers.length>=2){const M=_n.x-this._activePointers[1].clientX,R=_n.y-this._activePointers[1].clientY,D=Math.sqrt(M*M+R*R);l.set(0,D);const G=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,U=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;a.set(G,U)}if(this._state=0,!x)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in x&&x.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(x.buttons&ii.LEFT)===ii.LEFT&&(this._state=this._state|this.mouseButtons.left),(x.buttons&ii.MIDDLE)===ii.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(x.buttons&ii.RIGHT)===ii.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&_e.ZOOM)===_e.ZOOM||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},w=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,vm(this._activePointers,_n);const P=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,M=P?-P.deltaX:a.x-_n.x,R=P?-P.deltaY:a.y-_n.y;if(a.copy(_n),((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(M,R),this._isUserControllingRotate=!0),(this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.ZOOM)===_e.ZOOM){const D=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,G=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,U=this.dollyDragInverted?-1:1;(this._state&_e.DOLLY)===_e.DOLLY?(this._dollyInternal(U*R*Qh,D,G),this._isUserControllingDolly=!0):(this._zoomInternal(U*R*Qh,D,G),this._isUserControllingZoom=!0)}if((this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE){const D=_n.x-this._activePointers[1].clientX,G=_n.y-this._activePointers[1].clientY,U=Math.sqrt(D*D+G*G),H=l.y-U;l.set(0,U);const k=this.dollyToCursor?(a.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(a.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET?(this._dollyInternal(H*Qh,k,$),this._isUserControllingDolly=!0):(this._zoomInternal(H*Qh,k,$),this._isUserControllingZoom=!0)}((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(M,R,!1,!1),this._isUserControllingTruck=!0),((this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(M,R,!1,!0),this._isUserControllingTruck=!0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(M,R,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},E=()=>{vm(this._activePointers,_n),a.copy(_n),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",C),this._domElement.ownerDocument.addEventListener("pointerlockerror",T),this._domElement.ownerDocument.addEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",p),b())},this.unlockPointer=()=>{var x,P,M;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(x=this._domElement)===null||x===void 0||x.ownerDocument.exitPointerLock(),(P=this._domElement)===null||P===void 0||P.ownerDocument.removeEventListener("pointerlockchange",C),(M=this._domElement)===null||M===void 0||M.ownerDocument.removeEventListener("pointerlockerror",T),this.cancel()};const C=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},T=()=>{this.unlockPointer()};this._addAllEventListeners=x=>{this._domElement=x,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",u),this._domElement.addEventListener("pointercancel",p),this._domElement.addEventListener("wheel",A,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",u),this._domElement.removeEventListener("pointercancel",p),this._domElement.removeEventListener("wheel",A,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.ownerDocument.removeEventListener("pointerlockchange",C),this._domElement.ownerDocument.removeEventListener("pointerlockerror",T))},this.cancel=()=>{this._state!==_e.NONE&&(this._state=_e.NONE,this._activePointers.length=0,E())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ss(e.width,0,1),this._interactiveArea.height=ss(e.height,0,1),this._interactiveArea.x=ss(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ss(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const a=ss(e,this.minAzimuthAngle,this.maxAzimuthAngle),l=ss(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=a,this._sphericalEnd.phi=l,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const u=!i||Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(u)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0,this._dollyToNoClamp(ss(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const u=this._collisionTest(),d=Ot(u,this._spherical.radius);if(!(i>e)&&d)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,u)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const l=!t||Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Mc).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ss(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||Ot(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),As.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),As.multiplyScalar(e),_s.multiplyScalar(-t);const a=ut.copy(As).add(_s),l=Rt.copy(this._targetEnd).add(a);return this.moveTo(l.x,l.y,l.z,i)}forward(e,t=!1){ut.setFromMatrixColumn(this._camera.matrix,0),ut.crossVectors(this._camera.up,ut),ut.multiplyScalar(e);const i=Rt.copy(this._targetEnd).add(ut);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return ut.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ut.x,this._targetEnd.y+ut.y,this._targetEnd.z+ut.z,t)}moveTo(e,t,i,a=!1){this._isUserControllingTruck=!1;const l=ut.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,l,this.boundaryFriction),this._needsUpdate=!0,a||this._target.copy(this._targetEnd);const u=!a||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(u)}lookInDirectionOf(e,t,i,a=!1){const d=ut.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(d.x,d.y,d.z,a)}fitToBox(e,t,{cover:i=!1,paddingLeft:a=0,paddingRight:l=0,paddingBottom:u=0,paddingTop:d=0}={}){const p=[],m=e.isBox3?Bo.copy(e):Bo.setFromObject(e);m.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const A=Mv(this._sphericalEnd.theta,Iv),_=Mv(this._sphericalEnd.phi,Iv);p.push(this.rotateTo(A,_,t));const b=ut.setFromSpherical(this._sphericalEnd).normalize(),w=Nv.setFromUnitVectors(b,xm),E=Ot(Math.abs(b.y),1);E&&w.multiply(Cm.setFromAxisAngle(qh,A)),w.multiply(this._yAxisUpSpaceInverse);const C=Dv.makeEmpty();Rt.copy(m.min).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setX(m.max.x).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setY(m.max.y).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setZ(m.min.z).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setZ(m.max.z).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setY(m.min.y).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setX(m.min.x).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).applyQuaternion(w),C.expandByPoint(Rt),C.min.x-=a,C.min.y-=u,C.max.x+=l,C.max.y+=d,w.setFromUnitVectors(xm,b),E&&w.premultiply(Cm.invert()),w.premultiply(this._yAxisUpSpace);const T=C.getSize(ut),x=C.getCenter(Rt).applyQuaternion(w);if(fa(this._camera)){const P=this.getDistanceToFitBox(T.x,T.y,T.z,i);p.push(this.moveTo(x.x,x.y,x.z,t)),p.push(this.dollyTo(P,t)),p.push(this.setFocalOffset(0,0,0,t))}else if(Cr(this._camera)){const P=this._camera,M=P.right-P.left,R=P.top-P.bottom,D=i?Math.max(M/T.x,R/T.y):Math.min(M/T.x,R/T.y);p.push(this.moveTo(x.x,x.y,x.z,t)),p.push(this.zoomTo(D,t)),p.push(this.setFocalOffset(0,0,0,t))}return Promise.all(p)}fitToSphere(e,t){const i=[],l="isObject3D"in e?Ua.createBoundingSphere(e,Sm):Sm.copy(e);if(i.push(this.moveTo(l.center.x,l.center.y,l.center.z,t)),fa(this._camera)){const u=this.getDistanceToFitSphere(l.radius);i.push(this.dollyTo(u,t))}else if(Cr(this._camera)){const u=this._camera.right-this._camera.left,d=this._camera.top-this._camera.bottom,p=2*l.radius,m=Math.min(u/p,d/p);i.push(this.zoomTo(m,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,a,l,u,d=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0;const p=Rt.set(a,l,u),m=ut.set(e,t,i);this._targetEnd.copy(p),this._sphericalEnd.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!d||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold)&&Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerp(e,t,i,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0;const l=ut.set(...e.target);if("spherical"in e)Cn.set(...e.spherical);else{const _=Rt.set(...e.position);Cn.setFromVector3(_.sub(l).applyQuaternion(this._yAxisUpSpace))}const u=Mo.set(...t.target);if("spherical"in t)Ro.set(...t.spherical);else{const _=Rt.set(...t.position);Ro.setFromVector3(_.sub(u).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(l.lerp(u,i));const d=Ro.theta-Cn.theta,p=Ro.phi-Cn.phi,m=Ro.radius-Cn.radius;this._sphericalEnd.set(Cn.radius+m*i,Cn.phi+p*i,Cn.theta+d*i),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!a||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold)&&Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerpLookAt(e,t,i,a,l,u,d,p,m,A,_,b,w,E=!1){return this.lerp({position:[e,t,i],target:[a,l,u]},{position:[d,p,m],target:[A,_,b]},w,E)}setPosition(e,t,i,a=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,a)}setTarget(e,t,i,a=!1){const l=this.getPosition(ut),u=this.setLookAt(l.x,l.y,l.z,e,t,i,a);return this._sphericalEnd.phi=ss(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),u}setFocalOffset(e,t,i,a=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,a||this._focalOffset.copy(this._focalOffsetEnd);const l=!a||Ot(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Ot(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Ot(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(l)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),As.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_s.setFromMatrixColumn(this._camera.matrixWorldInverse,1),pa.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const a=ut.set(e,t,i),l=a.distanceTo(this._camera.position),u=a.sub(this._camera.position);As.multiplyScalar(u.x),_s.multiplyScalar(u.y),pa.multiplyScalar(u.z),ut.copy(As).add(_s).add(pa),ut.z=ut.z+l,this.dollyTo(l,!1),this.setFocalOffset(-ut.x,ut.y,-ut.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,a){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new rt.Vector4,typeof e=="number"?this._viewport.set(e,t,i,a):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,a=!1){if(wm(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const l=e/t,u=this._camera.getEffectiveFOV()*Cc,d=this._camera.aspect;return((a?l>d:l<d)?t:e/d)*.5/Math.tan(u*.5)+i*.5}getDistanceToFitSphere(e){if(wm(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*Cc,i=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,a=1<this._camera.aspect?t:i;return e/Math.sin(a*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new rt.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%xr+xr)%xr,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=xr),this._spherical.theta+=xr*Math.round((this._sphericalEnd.theta-this._spherical.theta)/xr),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!Ot(this._camera.up.x,this._cameraUp0.x)||!Ot(this._camera.up.y,this._cameraUp0.y)||!Ot(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(ut);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,qh),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=ut.subVectors(this._target,this._camera.position).normalize(),t=Rt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(ut);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,a=this._sphericalEnd.radius-this._spherical.radius,l=Pv.subVectors(this._targetEnd,this._target),u=Lv.subVectors(this._focalOffsetEnd,this._focalOffset),d=this._zoomEnd-this._zoom;if(Qt(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Vh(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,_,1/0,e),this._needsUpdate=!0}if(Qt(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Vh(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,_,1/0,e),this._needsUpdate=!0}if(Qt(a))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const _=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Vh(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,_,this.maxSpeed,e),this._needsUpdate=!0}if(Qt(l.x)&&Qt(l.y)&&Qt(l.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const _=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;Rv(this._target,this._targetEnd,this._targetVelocity,_,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(Qt(u.x)&&Qt(u.y)&&Qt(u.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const _=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;Rv(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,_,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(Qt(d))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const _=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Vh(this._zoom,this._zoomEnd,this._zoomVelocity,_,1/0,e)}if(this.dollyToCursor){if(fa(this._camera)&&this._changedDolly!==0){const _=this._spherical.radius-this._lastDistance,b=this._camera,w=this._getCameraDirection(Mc),E=ut.copy(w).cross(b.up).normalize();E.lengthSq()===0&&(E.x=1);const C=Rt.crossVectors(E,w),T=this._sphericalEnd.radius*Math.tan(b.getEffectiveFOV()*Cc*.5),P=(this._sphericalEnd.radius-_-this._sphericalEnd.radius)/this._sphericalEnd.radius,M=Mo.copy(this._targetEnd).add(E.multiplyScalar(this._dollyControlCoord.x*T*b.aspect)).add(C.multiplyScalar(this._dollyControlCoord.y*T)),R=ut.copy(this._targetEnd).lerp(M,P),D=this._lastDollyDirection===Io.IN&&this._spherical.radius<=this.minDistance,G=this._lastDollyDirection===Io.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(D||G)){this._sphericalEnd.radius-=_,this._spherical.radius-=_;const H=Rt.copy(w).multiplyScalar(-_);R.add(H)}this._boundary.clampPoint(R,R);const U=Rt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(U),this._changedDolly-=_,Qt(this._changedDolly)&&(this._changedDolly=0)}else if(Cr(this._camera)&&this._changedZoom!==0){const _=this._zoom-this._lastZoom,b=this._camera,w=ut.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(b.near+b.far)/(b.near-b.far)).unproject(b),E=Rt.set(0,0,-1).applyQuaternion(b.quaternion),C=Mo.copy(w).add(E.multiplyScalar(-w.dot(b.up))),x=-(this._zoom-_-this._zoom)/this._zoom,P=this._getCameraDirection(Mc),M=this._targetEnd.dot(P),R=ut.copy(this._targetEnd).lerp(C,x),D=R.dot(P),G=P.multiplyScalar(D-M);R.sub(G),this._boundary.clampPoint(R,R);const U=Rt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(U),this._changedZoom-=_,Qt(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const p=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,p),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!Qt(this._focalOffset.x)||!Qt(this._focalOffset.y)||!Qt(this._focalOffset.z))&&(As.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),pa.setFromMatrixColumn(this._camera.matrix,2),As.multiplyScalar(this._focalOffset.x),_s.multiplyScalar(-this._focalOffset.y),pa.multiplyScalar(this._focalOffset.z),ut.copy(As).add(_s).add(pa),this._camera.position.add(ut),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),ut.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const A=this._needsUpdate;return A&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):A?(this.dispatchEvent({type:"update"}),Qt(t,this.restThreshold)&&Qt(i,this.restThreshold)&&Qt(a,this.restThreshold)&&Qt(l.x,this.restThreshold)&&Qt(l.y,this.restThreshold)&&Qt(l.z,this.restThreshold)&&Qt(u.x,this.restThreshold)&&Qt(u.y,this.restThreshold)&&Qt(u.z,this.restThreshold)&&Qt(d,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!A&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=A,this._needsUpdate=!1,A}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Tc(this.maxDistance),minZoom:this.minZoom,maxZoom:Tc(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Tc(this.maxPolarAngle),minAzimuthAngle:Tc(this.minAzimuthAngle),maxAzimuthAngle:Tc(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:ut.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=Ic(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=Ic(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=Ic(i.maxPolarAngle),this.minAzimuthAngle=Ic(i.minAzimuthAngle),this.maxAzimuthAngle=Ic(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),Cn.setFromVector3(ut.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(Cn.theta,Cn.phi,t),this.dollyTo(Cn.radius,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",nF),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const a=t.lengthSq();if(a===0)return e;const l=Rt.copy(t).add(e),d=this._boundary.clampPoint(l,Mo).sub(l),p=d.lengthSq();if(p===0)return e.add(t);if(p===a)return e;if(i===0)return e.add(t).add(d);{const m=1+i*p/t.dot(d);return e.add(Rt.copy(t).multiplyScalar(m)).add(d.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(fa(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*Cc,a=Math.tan(i*.5)*t,l=a*e.aspect;this._nearPlaneCorners[0].set(-l,-a,0),this._nearPlaneCorners[1].set(l,-a,0),this._nearPlaneCorners[2].set(l,a,0),this._nearPlaneCorners[3].set(-l,a,0)}else if(Cr(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,a=e.right*t,l=e.top*t,u=e.bottom*t;this._nearPlaneCorners[0].set(i,l,0),this._nearPlaneCorners[1].set(a,l,0),this._nearPlaneCorners[2].set(a,u,0),this._nearPlaneCorners[3].set(i,u,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||wm(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(Mc);Tm.lookAt(Bv,i,this._camera.up);for(let a=0;a<4;a++){const l=Rt.copy(this._nearPlaneCorners[a]);l.applyMatrix4(Tm);const u=Mo.addVectors(this._target,l);jh.set(u,i),jh.far=this._spherical.radius+1;const d=jh.intersectObjects(this.colliderMeshes);d.length!==0&&d[0].distance<e&&(e=d[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new rt.Sphere){const i=t,a=i.center;Bo.makeEmpty(),e.traverseVisible(u=>{u.isMesh&&Bo.expandByObject(u)}),Bo.getCenter(a);let l=0;return e.traverseVisible(u=>{if(!u.isMesh)return;const d=u;if(!d.geometry)return;const p=d.geometry.clone();p.applyMatrix4(d.matrixWorld);const A=p.attributes.position;for(let _=0,b=A.count;_<b;_++)ut.fromBufferAttribute(A,_),l=Math.max(l,a.distanceToSquared(ut))}),i.radius=Math.sqrt(l),i}}class ZA{constructor(e){this.__position=new se,this.__target=new se,this.setPosition(e.position.x,e.position.y,e.position.z),this.setTarget(e.target.x,e.target.y,e.target.z)}getPosition(){return this.__position}setPosition(e,t,i){this.__position.setX(e),this.__position.setY(t),this.__position.setZ(i)}getTarget(){return this.__target}setTarget(e,t,i){this.__target.setX(e),this.__target.setY(t),this.__target.setZ(i)}}class rF extends yC{constructor({appWcRef:e}){super({appWcRef:e}),this._loggerContext="CAMERA MANAGER",this.__cameras={},this.__mainCameraControls={},this.__screenshotCameraControls={},this.__cameraDirection=new se,this.__cameraSpherical=new hl,this.__savedCameraState={position:new se,target:new se}}getCameras(){return this.__cameras}get mainCameraControls(){return this.__mainCameraControls}getScreenshotCameraControls(){return this.__screenshotCameraControls}loadConfiguration(e){e.fov&&(this.__cameras.main.fov=e.fov)}getCurrentCameraTransforms(){const e=new se;this.__cameras.main.getWorldPosition(e);const t=new se;return this.__mainCameraControls.getTarget(t),{position:e,target:t}}getCurrentCameraRotation(){return{azimuthAngle:this.__mainCameraControls.azimuthAngle,polarAngle:this.__mainCameraControls.polarAngle,distance:this.__mainCameraControls.distance}}getCameraFocalLength(){return this.__cameras.main.getFocalLength()}setCameraFocalLength(e){this.__cameras.main.setFocalLength(e)}async fitCameraToSceneBounds(e=!0){const t=this._appWcRef.getSceneSphericalBoundsForCameraFocus();return await this.fitCameraToObject({objectToFocus:t,enableTransition:e})}__onMainCameraControlsControlStart(e){const t=this.__mainCameraControls,i=t.currentAction===t.mouseButtons?.right||t.currentAction===t.touches?.two;e.canPan&&i?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"pan"}):t.currentAction===t.mouseButtons?.left?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"rotate"}):this._appWcRef.eventsManager.cameraControlsStart.fire({type:null})}__onMainCameraControlsControlEnd(){this._appWcRef.eventsManager.inputEnd.fire()}saveCurrentCameraTransforms(){this.__mainCameraControls.getPosition(this.__savedCameraState.position),this.__mainCameraControls.getTarget(this.__savedCameraState.target)}resetCurrentCameraTransformsToLastSavedState(e=!0){const t=new ZA({position:{x:this.__savedCameraState.position.x,y:this.__savedCameraState.position.y,z:this.__savedCameraState.position.z},target:{x:this.__savedCameraState.target.x,y:this.__savedCameraState.target.y,z:this.__savedCameraState.target.z}});this.moveCameraToLocation({newCameraTransforms:t,transition:e})}setCameraZoomLimits({minDistance:e,maxDistance:t}){const i=this._appWcRef.getSceneSphericalBoundsForCameraFocus().radius,a=i<=0?1:i;e&&(this.__mainCameraControls.minDistance=a*e),t&&(this.__mainCameraControls.maxDistance=a*t),this.fitCameraToSceneBounds()}disableCameraZoomLimits(){this.setCameraZoomLimits({minDistance:-1/0,maxDistance:1/0})}normalizeAngle(e){const t=Math.PI*2;return Is.euclideanModulo(e,t)}absoluteAngle(e,t){const i=Math.PI*2,a=e-t;return Is.euclideanModulo(a+Math.PI,i)-Math.PI}async moveCameraToLocation({newCameraTransforms:e,freezeCamera:t=!1,transition:i=!0,targetCameraControlsRef:a=this.__mainCameraControls}){const l=e.getPosition(),u=e.getTarget();a.enabled=!1,this.__cameraDirection.set(0,0,0),this.__cameraDirection.subVectors(l,u),this.__cameraDirection.normalize();const d=l.distanceTo(u);this.__cameraSpherical.setFromVector3(this.__cameraDirection);const p=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.theta),this.normalizeAngle(a.azimuthAngle)),m=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.phi),this.normalizeAngle(a.polarAngle));a.rotate(p,m,i),a.moveTo(u.x,u.y,u.z,i),a.dollyTo(d,i),t||(a.enabled=!0)}async rotateCameraToLocation({azimuthAngle:e,polarAngle:t,distance:i,transition:a=!0,targetCameraControlsRef:l=this.__mainCameraControls}){e&&l.rotateAzimuthTo(e,a),t&&l.rotatePolarTo(t,a),i&&l.dollyTo(i,a)}async resetCameraToDefault(e){const{canZoom:t,canPan:i,minDistance:a,maxDistance:l,minPolarAngle:u,maxPolarAngle:d,minAzimuthAngle:p,maxAzimuthAngle:m}=e,A=Ua.ACTION;this.__mainCameraControls.mouseButtons.left=A.ROTATE,this.__mainCameraControls.touches.one=A.TOUCH_ROTATE,this.__mainCameraControls.mouseButtons.wheel=t?A.DOLLY:A.NONE,this.__mainCameraControls.touches.two=t?A.TOUCH_DOLLY:A.NONE,this.__mainCameraControls.mouseButtons.middle=A.NONE,this.__mainCameraControls.mouseButtons.right=i?A.TRUCK:A.NONE,this.__mainCameraControls.touches.two=i?A.TOUCH_TRUCK:A.NONE,this.__mainCameraControls.enabled=!0,t&&i&&(this.__mainCameraControls.touches.two=i?A.TOUCH_DOLLY_TRUCK:A.NONE),this.setCameraZoomLimits({minDistance:a??.5,maxDistance:l??5}),this.__mainCameraControls.minPolarAngle=u,this.__mainCameraControls.maxPolarAngle=d,this.__mainCameraControls.minAzimuthAngle=p,this.__mainCameraControls.maxAzimuthAngle=m}async fitCameraToObject({objectToFocus:e,enableTransition:t=!0}){return await this.__mainCameraControls.fitToSphere(e,t)}async wiggleCamera(){const e=this.__mainCameraControls.azimuthAngle,t=[0,.4,-.3,0];for(const i of t){if(!this._appWcRef.playInteractionPrompt)break;await this.__mainCameraControls.rotateAzimuthTo(e+i,!0)}}async setup({mainRenderer:e,screenshotRenderer:t,cameraSettings:i}){const{focalLength:a}=i;this.__cameras={main:new bi(75,window.innerWidth/window.innerHeight,.1,1e3),screenshot:new bi(75,window.innerWidth/window.innerHeight,.1,1e3)},this.__cameras.main.name="MainCamera",this.__cameras.screenshot.name="ScreenshotCamera",this.__cameras.main.position.setZ(100);const l={Vector2:He,Vector3:se,Vector4:Bt,Quaternion:zi,Matrix4:tt,Spherical:hl,Box3:vi,Sphere:vn,Raycaster:o_};Ua.install({THREE:l}),this.__mainCameraControls=new Ua(this.__cameras.main,e.domElement),this.__screenshotCameraControls=new Ua(this.__cameras.screenshot,t.domElement),this.__cameras.main.setFocalLength(a),this.__cameras.main.near=.01,this.__cameras.main.far=1e3,await this.resetCameraToDefault(i),this.__mainCameraControls.addEventListener("controlstart",()=>{this.__onMainCameraControlsControlStart(i)}),this.__mainCameraControls.addEventListener("controlend",()=>{this.__onMainCameraControlsControlEnd()}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.appReadyEvent.name,()=>{this.setCameraZoomLimits({minDistance:i.minDistance,maxDistance:i.maxDistance})}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraMoveToTransform.name,(u=>{u.detail.saveFirst&&this.saveCurrentCameraTransforms();const{position:d,target:p}=u.detail.cameraTransforms,m=new ZA({position:d,target:p});this.moveCameraToLocation({newCameraTransforms:m})})),this._appWcRef.addEventListener(this._appWcRef.eventsManager.hotspotsVisibilityChanged.name,(u=>{const d=this.mainCameraControls,p=u.detail.visible?d.maxDistance+.3:d.maxDistance-.3;d.maxDistance=p}))}}const aF='@font-face{font-family:Helvetica Neue;src:url(https://asset.myepigraph.com/design-assets/fonts/HelveticaNeue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:PPMori-Regular;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:PPMori-Bold;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Bold.woff2) format("woff2");font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Bold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-BoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-ExtraBold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-ExtraBoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Italic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Italic-VariableFont_wght.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Medium.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-MediumItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Regular.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-SemiBold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-SemiBoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-VariableFont_wght.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter-VariableFont_slnt_wght.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter_18pt-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}',oF={Color:{Black:{25:{$type:"color",$value:"rgba(0, 0, 0, 0.0000)"},50:{$type:"color",$value:"rgba(0, 0, 0, 0.0500)"},100:{$type:"color",$value:"rgba(0, 0, 0, 0.1000)"},200:{$type:"color",$value:"rgba(0, 0, 0, 0.2000)"},300:{$type:"color",$value:"rgba(0, 0, 0, 0.3000)"},400:{$type:"color",$value:"rgba(0, 0, 0, 0.4000)"},500:{$type:"color",$value:"rgba(0, 0, 0, 0.5000)"},600:{$type:"color",$value:"rgba(0, 0, 0, 0.6000)"},700:{$type:"color",$value:"rgba(0, 0, 0, 0.7000)"},800:{$type:"color",$value:"rgba(0, 0, 0, 0.8000)"},900:{$type:"color",$value:"rgba(0, 0, 0, 0.9000)"},1e3:{$type:"color",$value:"#000000"}},White:{25:{$type:"color",$value:"rgba(255, 255, 255, 0.0250)"},50:{$type:"color",$value:"rgba(255, 255, 255, 0.0500)"},100:{$type:"color",$value:"rgba(255, 255, 255, 0.1000)"},200:{$type:"color",$value:"rgba(255, 255, 255, 0.2000)"},300:{$type:"color",$value:"rgba(255, 255, 255, 0.3000)"},400:{$type:"color",$value:"rgba(255, 255, 255, 0.4000)"},500:{$type:"color",$value:"rgba(255, 255, 255, 0.5000)"},600:{$type:"color",$value:"rgba(255, 255, 255, 0.6000)"},700:{$type:"color",$value:"rgba(255, 255, 255, 0.7000)"},800:{$type:"color",$value:"rgba(255, 255, 255, 0.8000)"},900:{$type:"color",$value:"rgba(255, 255, 255, 0.9000)"},1e3:{$type:"color",$value:"#ffffff"}},Green:{100:{$type:"color",$value:"#ebffee"},200:{$type:"color",$value:"#cff7d3"},300:{$type:"color",$value:"#aff4c6"},400:{$type:"color",$value:"#85e0a3"},500:{$type:"color",$value:"#14ae5c"},600:{$type:"color",$value:"#009951"},700:{$type:"color",$value:"#008043"},800:{$type:"color",$value:"#02542d"},900:{$type:"color",$value:"#024023"},1e3:{$type:"color",$value:"#062d1b"}},Red:{100:{$type:"color",$value:"#fee9e7"},200:{$type:"color",$value:"#fdd3d0"},300:{$type:"color",$value:"#fcb3ad"},400:{$type:"color",$value:"#f4776a"},500:{$type:"color",$value:"#ec221f"},600:{$type:"color",$value:"#c00f0c"},700:{$type:"color",$value:"#900b09"},800:{$type:"color",$value:"#690807"},900:{$type:"color",$value:"#4d0b0a"},1e3:{$type:"color",$value:"#300603"}},Yellow:{100:{$type:"color",$value:"#fffbeb"},200:{$type:"color",$value:"#fff1c2"},300:{$type:"color",$value:"#ffe8a3"},400:{$type:"color",$value:"#e8b931"},500:{$type:"color",$value:"#e5a000"},600:{$type:"color",$value:"#bf6a02"},700:{$type:"color",$value:"#975102"},800:{$type:"color",$value:"#682d03"},900:{$type:"color",$value:"#522504"},1e3:{$type:"color",$value:"#401b01"}},Blue:{100:{$type:"color",$value:"#fbfdff"},200:{$type:"color",$value:"#eaf4ff"},300:{$type:"color",$value:"#d5ebff"},400:{$type:"color",$value:"#c0e1ff"},500:{$type:"color",$value:"#91d0ff"},600:{$type:"color",$value:"#0094d5"},700:{$type:"color",$value:"#00679b"},800:{$type:"color",$value:"#003a5a"},900:{$type:"color",$value:"#003a5a"},1e3:{$type:"color",$value:"#002133"}},Slate:{100:{$type:"color",$value:"#f5f5f5"},200:{$type:"color",$value:"#e3e3e3"},300:{$type:"color",$value:"#cdcdcd"},400:{$type:"color",$value:"#b2b2b2"},500:{$type:"color",$value:"#949494"},600:{$type:"color",$value:"#767676"},700:{$type:"color",$value:"#5a5a5a"},800:{$type:"color",$value:"#434343"},900:{$type:"color",$value:"#303030"},1e3:{$type:"color",$value:"#242424"}},Grey:{25:{$type:"color",$value:"#f5f5f5"},50:{$type:"color",$value:"#f2f2f2"},100:{$type:"color",$value:"#e6e6e6"},200:{$type:"color",$value:"#cccccc"},300:{$type:"color",$value:"#b3b3b3"},400:{$type:"color",$value:"#999999"},500:{$type:"color",$value:"#7b7b7b"},600:{$type:"color",$value:"#666666"},700:{$type:"color",$value:"#4d4d4d"},800:{$type:"color",$value:"#333333"},900:{$type:"color",$value:"#1a1a1a"},1e3:{$type:"color",$value:"#0d0d0d"}},GreyAlpha:{25:{$type:"color",$value:"rgba(248, 248, 248, 0.8000)"},100:{$type:"color",$value:"rgba(242, 242, 242, 0.8000)"},500:{$type:"color",$value:"rgba(204, 204, 204, 0.2000)"},700:{$type:"color",$value:"rgba(204, 204, 204, 0.6000)"},800:{$type:"color",$value:"rgba(186, 186, 186, 0.6000)"},900:{$type:"color",$value:"rgba(50, 50, 50, 0.9000)"},"05":{$type:"color",$value:"rgba(253, 253, 253, 0.8000)"}}},Unit:{Space:{0:{$type:"number",$value:"0px"},100:{$type:"number",$value:"4px"},150:{$type:"number",$value:"6px"},200:{$type:"number",$value:"8px"},300:{$type:"number",$value:"12px"},400:{$type:"number",$value:"16px"},500:{$type:"number",$value:"20px"},600:{$type:"number",$value:"24px"},800:{$type:"number",$value:"32px"},1e3:{$type:"number",$value:"40px"},1200:{$type:"number",$value:"48px"},1600:{$type:"number",$value:"64px"},2e3:{$type:"number",$value:"80px"},2400:{$type:"number",$value:"96px"},2800:{$type:"number",$value:"112px"},3200:{$type:"number",$value:"128px"},3600:{$type:"number",$value:"144px"},4e3:{$type:"number",$value:"160px"},4400:{$type:"number",$value:"176px"},4800:{$type:"number",$value:"192px"},5200:{$type:"number",$value:"208px"},5600:{$type:"number",$value:"224px"},6e3:{$type:"number",$value:"240px"},6400:{$type:"number",$value:"256px"},7200:{$type:"number",$value:"288px"},8e3:{$type:"number",$value:"320px"},9600:{$type:"number",$value:"384px"},"0125":{$type:"number",$value:"0.5px"},"025":{$type:"number",$value:"1px"},"0325":{$type:"number",$value:"1.5px"},"050":{$type:"number",$value:"2px"}},Stack:{100:{$type:"number",$value:"-4px"},200:{$type:"number",$value:"-8px"},300:{$type:"number",$value:"-12px"},400:{$type:"number",$value:"-16px"},800:{$type:"number",$value:"-32px"},1e3:{$type:"number",$value:"-40px"},1600:{$type:"number",$value:"-64px"},2400:{$type:"number",$value:"-96px"},3200:{$type:"number",$value:"-128px"},4e3:{$type:"number",$value:"-160px"},4800:{$type:"number",$value:"-192px"},5600:{$type:"number",$value:"-224px"},7200:{$type:"number",$value:"-288px"},9600:{$type:"number",$value:"-384px"},"0125":{$type:"number",$value:"-0.5px"},"025":{$type:"number",$value:"-1px"},"0325":{$type:"number",$value:"-1.5px"},"050":{$type:"number",$value:"-2px"},"075":{$type:"number",$value:"-3px"}},Size:{4:{$type:"number",$value:"4px"},6:{$type:"number",$value:"6px"},8:{$type:"number",$value:"8px"},10:{$type:"number",$value:"10px"},12:{$type:"number",$value:"12px"},14:{$type:"number",$value:"14px"},16:{$type:"number",$value:"16px"},18:{$type:"number",$value:"18px"},20:{$type:"number",$value:"20px"},22:{$type:"number",$value:"22px"},24:{$type:"number",$value:"24px"},28:{$type:"number",$value:"28px"},30:{$type:"number",$value:"30px"},32:{$type:"number",$value:"32px"},40:{$type:"number",$value:"40px"},48:{$type:"number",$value:"48px"},64:{$type:"number",$value:"64px"},80:{$type:"number",$value:"80px"},96:{$type:"number",$value:"96px"},112:{$type:"number",$value:"112px"},128:{$type:"number",$value:"128px"},144:{$type:"number",$value:"144px"},160:{$type:"number",$value:"160px"},176:{$type:"number",$value:"176px"},224:{$type:"number",$value:"224px"}},Resolution:{XxsmallScreenMin:{$type:"number",$value:"375px"},XsmallScreenMin:{$type:"number",$value:"480px"},SmallScreenMin:{$type:"number",$value:"576px"},MediumScreenMin:{$type:"number",$value:"768px"},LargeScreenMin:{$type:"number",$value:"992px"},XlargeScreenMin:{$type:"number",$value:"1200px"},XxlargeScreenMin:{$type:"number",$value:"1400px"},XxxsmallScreenMax:{$type:"number",$value:"374px"},XxsmallScreenMax:{$type:"number",$value:"479px"},XsmallScreenMax:{$type:"number",$value:"575px"},SmallScreenMax:{$type:"number",$value:"767px"},MediumScreenMax:{$type:"number",$value:"991px"},LargeScreenMax:{$type:"number",$value:"1199px"},XlargeScreenMax:{$type:"number",$value:"1399px"},XxlargeScreenMax:{$type:"number",$value:"1920px"}}},Font:{Family:{Main:{$type:"string",$value:"PP Mori"},Body:{$type:"string",$value:"Helvetica LT Pro"},Epigraph:{$type:"string",$value:"PP Mori"}}}},wC={Color:{Brand:{Base:{$type:"color",$value:"#335166",$web:"var(--color-brand-base)"},BaseSecondary:{$type:"color",$value:"#2b4354",$web:"var(--color-brand-base-secondary)"},BaseTertiary:{$type:"color",$value:"#202f3a",$web:"var(--color-brand-base-tertiary)"},Accent:{$type:"color",$value:"#4276cf",$web:"var(--color-brand-accent)"},AccentSecondary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-secondary)"},AccentTertiary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-tertiary)"},Light:{$type:"color",$value:"#f8fbf6",$web:"var(--color-brand-light)"},Dark:{$type:"color",$value:"#111b22",$web:"var(--color-brand-dark)"}}},Font:{Brand:{Heading:{$type:"string",$value:"EB Garamond",$web:"var(--font-brand-heading)"},Paragraph:{$type:"string",$value:"Inter",$web:"var(--font-brand-body)"}}},Unit:{Brand:{Radius:{$type:"number",$value:"4px",$web:"var(--unit-brand-radius)"}}}},Se={Color:{Surface:{Plain:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.100}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.50}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.25}"},ShadowSecondary:{$value:"{Primitives.Color.Black.200}"}},Fill:{Accent:{$value:"{BrandPrimitives.Color.Brand.Accent}"},AccentHover:{$value:"{BrandPrimitives.Color.Brand.AccentSecondary}"},AccentPress:{$value:"{BrandPrimitives.Color.Brand.AccentTertiary}"},Base:{$value:"{BrandPrimitives.Color.Brand.Base}"},BaseHover:{$value:"{BrandPrimitives.Color.Brand.BaseSecondary}"},BasePress:{$value:"{BrandPrimitives.Color.Brand.BaseTertiary}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.700}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.300}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.100}"},SubtlePrimary:{$value:"{Primitives.Color.GreyAlpha.100}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.25}"},DangerPrimary:{$value:"{Primitives.Color.Red.600}"},Disabled:{$value:"{Primitives.Color.Grey.200}"},HotspotSecondary:{$value:"{Primitives.Color.GreyAlpha.800}"}},Icon:{NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"}},Text:{Invert:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.700}"},Disabled:{$value:"{Primitives.Color.Grey.300}"}},Border:{AltContrast:{$value:"{BrandPrimitives.Color.Brand.Dark}"},SubtlePrimary:{$value:"{Primitives.Color.Grey.300}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.700}"}}},Size:{Text:{Small:{$value:"{Primitives.Unit.Size.16}"},Medium:{$value:"{Primitives.Unit.Size.18}"},Large:{$value:"{Primitives.Unit.Size.20}"}},Icon:{Small:{$value:"{Primitives.Unit.Size.20}"},Medium:{$value:"{Primitives.Unit.Size.24}"},Large:{$value:"{Primitives.Unit.Size.28}"}},Radius:{Medium:{$value:"{Primitives.Unit.Space.150}"},Full:{$value:"{Primitives.Unit.Space.6000}"}},Stroke:{Regular:{$value:"{Primitives.Unit.Space.025}"},Thick:{$value:"{Primitives.Unit.Space.050}"}},Shadow:{None:{$value:"{Primitives.Unit.Space.0}"},Xsmall:{$value:"{Primitives.Unit.Space.025}"},Small:{$value:"{Primitives.Unit.Space.0325}"}},Blur:{Small:{$value:"{Primitives.Unit.Space.100}"}}},Space:{Padding:{Small:{$value:"{Primitives.Unit.Space.300}"},Medium:{$value:"{Primitives.Unit.Space.400}"},Regular:{$value:"{Primitives.Unit.Space.600}"}},Gap:{Small:{$value:"{Primitives.Unit.Space.200}"},Regular:{$value:"{Primitives.Unit.Space.400}"},Xxlarge:{$value:"{Primitives.Unit.Space.800}"}}},Font:{Family:{CustomH:{$value:"{BrandPrimitives.Font.Brand.Heading}"},CustomP:{$value:"{BrandPrimitives.Font.Brand.Paragraph}"},Main:{$value:"Helvetica Neue"}},Tracking:{Normal:{$value:"{Primitives.Unit.Space.0}"}}}};function be(o){const e=/\{Primitives\.(.*?)}/,t=String(o).match(e),i=/\{BrandPrimitives\.(.*?)}/,a=String(o).match(i);let l=o;if(t){const u=t[1].split(".");l=oF[u[0]][u[1]][u[2]].$value}else if(a){const u=a[1].split("."),d=wC[u[0]][u[1]][u[2]],p=d.$web;l=`${p.substring(0,p.length-1)}, ${d.$value})`}return hn(l)}const T_={poweredByEpigraphFooterText:"https://asset.myepigraph.com/design-assets/icons/powered-by-epigraph.svg",splashScreenLogo:"https://asset.myepigraph.com/design-assets/icons/default-splash-screen-image.svg",sampleQrCode:"https://asset.myepigraph.com/design-assets/icons/sample-qr-code.png"};function lF(){const o={};for(const[e,t]of Object.entries(wC))for(const[i,a]of Object.entries(t))for(const[l,u]of Object.entries(a)){const d=`${e}${i}${l}`;o[d]={name:hn(u.$web),defaultValue:u.$value,argType:{control:u.$type}}}return o}const cF=lF(),Dl={size:{name:"size",defaultValue:"small",argType:{options:["small","medium","large"],control:"select"}},theme:{name:"theme",defaultValue:"light",argType:{options:["light","dark"],control:"select"}},disabled:{name:"disabled",defaultValue:!1,argType:{control:"boolean"}}};var uF=Object.defineProperty,Yf=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&uF(e,t,a),a};const Yu=class EC extends dl{constructor(){super(),this.epgOnClickEventName="epgonclick",this.disabled=!1,this.theme=Dl.theme.defaultValue.toString(),this.size=Dl.size.defaultValue.toString(),EC.ensureFontsAreLoaded()}static{this.styles=[ct`
|
|
4204
|
+
*/const ii={LEFT:1,RIGHT:2,MIDDLE:4},_e=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),Io={NONE:0,IN:1,OUT:-1};function fa(o){return o.isPerspectiveCamera}function Cr(o){return o.isOrthographicCamera}const xr=Math.PI*2,Iv=Math.PI/2,vC=1e-5,Cc=Math.PI/180;function ss(o,e,t){return Math.max(e,Math.min(t,o))}function Qt(o,e=vC){return Math.abs(o)<e}function Ot(o,e,t=vC){return Qt(o-e,t)}function Mv(o,e){return Math.round(o/e)*e}function Tc(o){return isFinite(o)?o:o<0?-Number.MAX_VALUE:Number.MAX_VALUE}function Ic(o){return Math.abs(o)<Number.MAX_VALUE?o:o*(1/0)}function Vh(o,e,t,i,a=1/0,l){i=Math.max(1e-4,i);const u=2/i,d=u*l,p=1/(1+d+.48*d*d+.235*d*d*d);let m=o-e;const A=e,_=a*i;m=ss(m,-_,_),e=o-m;const b=(t.value+u*m)*l;t.value=(t.value-u*b)*p;let w=e+(m+b)*p;return A-o>0==w>A&&(w=A,t.value=(w-A)/l),w}function Rv(o,e,t,i,a=1/0,l,u){i=Math.max(1e-4,i);const d=2/i,p=d*l,m=1/(1+p+.48*p*p+.235*p*p*p);let A=e.x,_=e.y,b=e.z,w=o.x-A,E=o.y-_,C=o.z-b;const T=A,x=_,P=b,M=a*i,R=M*M,D=w*w+E*E+C*C;if(D>R){const V=Math.sqrt(D);w=w/V*M,E=E/V*M,C=C/V*M}A=o.x-w,_=o.y-E,b=o.z-C;const G=(t.x+d*w)*l,U=(t.y+d*E)*l,H=(t.z+d*C)*l;t.x=(t.x-d*G)*m,t.y=(t.y-d*U)*m,t.z=(t.z-d*H)*m,u.x=A+(w+G)*m,u.y=_+(E+U)*m,u.z=b+(C+H)*m;const k=T-o.x,$=x-o.y,Q=P-o.z,Z=u.x-T,X=u.y-x,s=u.z-P;return k*Z+$*X+Q*s>0&&(u.x=T,u.y=x,u.z=P,t.x=(u.x-T)/l,t.y=(u.y-x)/l,t.z=(u.z-P)/l),u}function vm(o,e){e.set(0,0),o.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=o.length,e.y/=o.length}function wm(o,e){return Cr(o)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class iF{constructor(){this._listeners={}}addEventListener(e,t){const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(t)===-1&&i[e].push(t)}hasEventListener(e,t){const i=this._listeners;return i[e]!==void 0&&i[e].indexOf(t)!==-1}removeEventListener(e,t){const a=this._listeners[e];if(a!==void 0){const l=a.indexOf(t);l!==-1&&a.splice(l,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const i=this._listeners[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let l=0,u=a.length;l<u;l++)a[l].call(this,e)}}}var Em;const nF="3.1.0",Qh=1/8,sF=/Mac/.test((Em=globalThis?.navigator)===null||Em===void 0?void 0:Em.platform);let rt,Bv,qh,xm,_n,ut,Rt,Mo,Mc,As,_s,pa,Pv,Lv,Cn,Ro,Bo,Dv,Sm,Nv,Cm,Tm,jh;class Ua extends iF{static install(e){rt=e.THREE,Bv=Object.freeze(new rt.Vector3(0,0,0)),qh=Object.freeze(new rt.Vector3(0,1,0)),xm=Object.freeze(new rt.Vector3(0,0,1)),_n=new rt.Vector2,ut=new rt.Vector3,Rt=new rt.Vector3,Mo=new rt.Vector3,Mc=new rt.Vector3,As=new rt.Vector3,_s=new rt.Vector3,pa=new rt.Vector3,Pv=new rt.Vector3,Lv=new rt.Vector3,Cn=new rt.Spherical,Ro=new rt.Spherical,Bo=new rt.Box3,Dv=new rt.Box3,Sm=new rt.Sphere,Nv=new rt.Quaternion,Cm=new rt.Quaternion,Tm=new rt.Matrix4,jh=new rt.Raycaster}static get ACTION(){return _e}set verticalDragToForward(e){console.warn("camera-controls: `verticalDragToForward` was removed. Use `mouseButtons.left = CameraControls.ACTION.SCREEN_PAN` instead.")}constructor(e,t){super(),this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.minDistance=Number.EPSILON,this.maxDistance=1/0,this.infinityDolly=!1,this.minZoom=.01,this.maxZoom=1/0,this.smoothTime=.25,this.draggingSmoothTime=.125,this.maxSpeed=1/0,this.azimuthRotateSpeed=1,this.polarRotateSpeed=1,this.dollySpeed=1,this.dollyDragInverted=!1,this.truckSpeed=2,this.dollyToCursor=!1,this.dragToOffset=!1,this.boundaryFriction=0,this.restThreshold=.01,this.colliderMeshes=[],this.cancel=()=>{},this._enabled=!0,this._state=_e.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Io.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new rt.Vector3,this._focalOffsetVelocity=new rt.Vector3,this._zoomVelocity={value:0},this._truckInternal=(x,P,M,R)=>{let D,G;if(fa(this._camera)){const U=ut.copy(this._camera.position).sub(this._target),H=this._camera.getEffectiveFOV()*Cc,k=U.length()*Math.tan(H*.5);D=this.truckSpeed*x*k/this._elementRect.height,G=this.truckSpeed*P*k/this._elementRect.height}else if(Cr(this._camera)){const U=this._camera;D=this.truckSpeed*x*(U.right-U.left)/U.zoom/this._elementRect.width,G=this.truckSpeed*P*(U.top-U.bottom)/U.zoom/this._elementRect.height}else return;R?(M?this.setFocalOffset(this._focalOffsetEnd.x+D,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(D,0,!0),this.forward(-G,!0)):M?this.setFocalOffset(this._focalOffsetEnd.x+D,this._focalOffsetEnd.y+G,this._focalOffsetEnd.z,!0):this.truck(D,G,!0)},this._rotateInternal=(x,P)=>{const M=xr*this.azimuthRotateSpeed*x/this._elementRect.height,R=xr*this.polarRotateSpeed*P/this._elementRect.height;this.rotate(M,R,!0)},this._dollyInternal=(x,P,M)=>{const R=Math.pow(.95,-x*this.dollySpeed),D=this._sphericalEnd.radius,G=this._sphericalEnd.radius*R,U=ss(G,this.minDistance,this.maxDistance),H=U-G;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(G,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(H,!0),this._dollyToNoClamp(U,!0)):this._dollyToNoClamp(U,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?G:U)-D,this._dollyControlCoord.set(P,M)),this._lastDollyDirection=Math.sign(-x)},this._zoomInternal=(x,P,M)=>{const R=Math.pow(.95,x*this.dollySpeed),D=this._zoom,G=this._zoom*R;this.zoomTo(G,!0),this.dollyToCursor&&(this._changedZoom+=G-D,this._dollyControlCoord.set(P,M))},typeof rt>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new rt.Quaternion().setFromUnitVectors(this._camera.up,qh),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=_e.NONE,this._target=new rt.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new rt.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new rt.Spherical().setFromVector3(ut.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new rt.Vector3,new rt.Vector3,new rt.Vector3,new rt.Vector3],this._updateNearPlaneCorners(),this._boundary=new rt.Box3(new rt.Vector3(-1/0,-1/0,-1/0),new rt.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new rt.Vector2,this.mouseButtons={left:_e.ROTATE,middle:_e.DOLLY,right:_e.TRUCK,wheel:fa(this._camera)?_e.DOLLY:Cr(this._camera)?_e.ZOOM:_e.NONE},this.touches={one:_e.TOUCH_ROTATE,two:fa(this._camera)?_e.TOUCH_DOLLY_TRUCK:Cr(this._camera)?_e.TOUCH_ZOOM_TRUCK:_e.NONE,three:_e.TOUCH_TRUCK};const i=new rt.Vector2,a=new rt.Vector2,l=new rt.Vector2,u=x=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const R=this._domElement.getBoundingClientRect(),D=x.clientX/R.width,G=x.clientY/R.height;if(D<this._interactiveArea.left||D>this._interactiveArea.right||G<this._interactiveArea.top||G>this._interactiveArea.bottom)return}const P=x.pointerType!=="mouse"?null:(x.buttons&ii.LEFT)===ii.LEFT?ii.LEFT:(x.buttons&ii.MIDDLE)===ii.MIDDLE?ii.MIDDLE:(x.buttons&ii.RIGHT)===ii.RIGHT?ii.RIGHT:null;if(P!==null){const R=this._findPointerByMouseButton(P);R&&this._disposePointer(R)}if((x.buttons&ii.LEFT)===ii.LEFT&&this._lockedPointer)return;const M={pointerId:x.pointerId,clientX:x.clientX,clientY:x.clientY,deltaX:0,deltaY:0,mouseButton:P};this._activePointers.push(M),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.ownerDocument.addEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",p),this._isDragging=!0,b(x)},d=x=>{x.cancelable&&x.preventDefault();const P=x.pointerId,M=this._lockedPointer||this._findPointerById(P);if(M){if(M.clientX=x.clientX,M.clientY=x.clientY,M.deltaX=x.movementX,M.deltaY=x.movementY,this._state=0,x.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(x.buttons&ii.LEFT)===ii.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(x.buttons&ii.MIDDLE)===ii.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(x.buttons&ii.RIGHT)===ii.RIGHT&&(this._state=this._state|this.mouseButtons.right);w()}},p=x=>{const P=this._findPointerById(x.pointerId);if(!(P&&P===this._lockedPointer)){if(P&&this._disposePointer(P),x.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=_e.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=_e.NONE;E()}};let m=-1;const A=x=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===_e.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const G=this._domElement.getBoundingClientRect(),U=x.clientX/G.width,H=x.clientY/G.height;if(U<this._interactiveArea.left||U>this._interactiveArea.right||H<this._interactiveArea.top||H>this._interactiveArea.bottom)return}if(x.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===_e.ROTATE||this.mouseButtons.wheel===_e.TRUCK){const G=performance.now();m-G<1e3&&this._getClientRect(this._elementRect),m=G}const P=sF?-1:-3,M=x.deltaMode===1||x.ctrlKey?x.deltaY/P:x.deltaY/(P*10),R=this.dollyToCursor?(x.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,D=this.dollyToCursor?(x.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case _e.ROTATE:{this._rotateInternal(x.deltaX,x.deltaY),this._isUserControllingRotate=!0;break}case _e.TRUCK:{this._truckInternal(x.deltaX,x.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case _e.SCREEN_PAN:{this._truckInternal(x.deltaX,x.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case _e.OFFSET:{this._truckInternal(x.deltaX,x.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case _e.DOLLY:{this._dollyInternal(-M,R,D),this._isUserControllingDolly=!0;break}case _e.ZOOM:{this._zoomInternal(-M,R,D),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=x=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Ua.ACTION.NONE){const P=x instanceof PointerEvent?x.pointerId:0,M=this._findPointerById(P);M&&this._disposePointer(M),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p);return}x.preventDefault()}},b=x=>{if(!this._enabled)return;if(vm(this._activePointers,_n),this._getClientRect(this._elementRect),i.copy(_n),a.copy(_n),this._activePointers.length>=2){const M=_n.x-this._activePointers[1].clientX,R=_n.y-this._activePointers[1].clientY,D=Math.sqrt(M*M+R*R);l.set(0,D);const G=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,U=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;a.set(G,U)}if(this._state=0,!x)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in x&&x.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(x.buttons&ii.LEFT)===ii.LEFT&&(this._state=this._state|this.mouseButtons.left),(x.buttons&ii.MIDDLE)===ii.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(x.buttons&ii.RIGHT)===ii.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&_e.ZOOM)===_e.ZOOM||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},w=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,vm(this._activePointers,_n);const P=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,M=P?-P.deltaX:a.x-_n.x,R=P?-P.deltaY:a.y-_n.y;if(a.copy(_n),((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(M,R),this._isUserControllingRotate=!0),(this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.ZOOM)===_e.ZOOM){const D=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,G=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0,U=this.dollyDragInverted?-1:1;(this._state&_e.DOLLY)===_e.DOLLY?(this._dollyInternal(U*R*Qh,D,G),this._isUserControllingDolly=!0):(this._zoomInternal(U*R*Qh,D,G),this._isUserControllingZoom=!0)}if((this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE){const D=_n.x-this._activePointers[1].clientX,G=_n.y-this._activePointers[1].clientY,U=Math.sqrt(D*D+G*G),H=l.y-U;l.set(0,U);const k=this.dollyToCursor?(a.x-this._elementRect.x)/this._elementRect.width*2-1:0,$=this.dollyToCursor?(a.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET?(this._dollyInternal(H*Qh,k,$),this._isUserControllingDolly=!0):(this._zoomInternal(H*Qh,k,$),this._isUserControllingZoom=!0)}((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(M,R,!1,!1),this._isUserControllingTruck=!0),((this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(M,R,!1,!0),this._isUserControllingTruck=!0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(M,R,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},E=()=>{vm(this._activePointers,_n),a.copy(_n),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",C),this._domElement.ownerDocument.addEventListener("pointerlockerror",T),this._domElement.ownerDocument.addEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",p),b())},this.unlockPointer=()=>{var x,P,M;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(x=this._domElement)===null||x===void 0||x.ownerDocument.exitPointerLock(),(P=this._domElement)===null||P===void 0||P.ownerDocument.removeEventListener("pointerlockchange",C),(M=this._domElement)===null||M===void 0||M.ownerDocument.removeEventListener("pointerlockerror",T),this.cancel()};const C=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},T=()=>{this.unlockPointer()};this._addAllEventListeners=x=>{this._domElement=x,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",u),this._domElement.addEventListener("pointercancel",p),this._domElement.addEventListener("wheel",A,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",u),this._domElement.removeEventListener("pointercancel",p),this._domElement.removeEventListener("wheel",A,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),this._domElement.ownerDocument.removeEventListener("pointermove",d,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",p),this._domElement.ownerDocument.removeEventListener("pointerlockchange",C),this._domElement.ownerDocument.removeEventListener("pointerlockerror",T))},this.cancel=()=>{this._state!==_e.NONE&&(this._state=_e.NONE,this._activePointers.length=0,E())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=ss(e.width,0,1),this._interactiveArea.height=ss(e.height,0,1),this._interactiveArea.x=ss(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=ss(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,i=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,i)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,i=!1){this._isUserControllingRotate=!1;const a=ss(e,this.minAzimuthAngle,this.maxAzimuthAngle),l=ss(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=a,this._sphericalEnd.phi=l,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,i||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const u=!i||Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(u)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0,this._dollyToNoClamp(ss(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const i=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const u=this._collisionTest(),d=Ot(u,this._spherical.radius);if(!(i>e)&&d)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,u)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const l=!t||Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(l)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(Mc).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const i=!t||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(i)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=ss(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const i=!t||Ot(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(i)}pan(e,t,i=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,i)}truck(e,t,i=!1){this._camera.updateMatrix(),As.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),As.multiplyScalar(e),_s.multiplyScalar(-t);const a=ut.copy(As).add(_s),l=Rt.copy(this._targetEnd).add(a);return this.moveTo(l.x,l.y,l.z,i)}forward(e,t=!1){ut.setFromMatrixColumn(this._camera.matrix,0),ut.crossVectors(this._camera.up,ut),ut.multiplyScalar(e);const i=Rt.copy(this._targetEnd).add(ut);return this.moveTo(i.x,i.y,i.z,t)}elevate(e,t=!1){return ut.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ut.x,this._targetEnd.y+ut.y,this._targetEnd.z+ut.z,t)}moveTo(e,t,i,a=!1){this._isUserControllingTruck=!1;const l=ut.set(e,t,i).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,l,this.boundaryFriction),this._needsUpdate=!0,a||this._target.copy(this._targetEnd);const u=!a||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(u)}lookInDirectionOf(e,t,i,a=!1){const d=ut.set(e,t,i).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(d.x,d.y,d.z,a)}fitToBox(e,t,{cover:i=!1,paddingLeft:a=0,paddingRight:l=0,paddingBottom:u=0,paddingTop:d=0}={}){const p=[],m=e.isBox3?Bo.copy(e):Bo.setFromObject(e);m.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const A=Mv(this._sphericalEnd.theta,Iv),_=Mv(this._sphericalEnd.phi,Iv);p.push(this.rotateTo(A,_,t));const b=ut.setFromSpherical(this._sphericalEnd).normalize(),w=Nv.setFromUnitVectors(b,xm),E=Ot(Math.abs(b.y),1);E&&w.multiply(Cm.setFromAxisAngle(qh,A)),w.multiply(this._yAxisUpSpaceInverse);const C=Dv.makeEmpty();Rt.copy(m.min).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setX(m.max.x).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setY(m.max.y).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setZ(m.min.z).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.min).setZ(m.max.z).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setY(m.min.y).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).setX(m.min.x).applyQuaternion(w),C.expandByPoint(Rt),Rt.copy(m.max).applyQuaternion(w),C.expandByPoint(Rt),C.min.x-=a,C.min.y-=u,C.max.x+=l,C.max.y+=d,w.setFromUnitVectors(xm,b),E&&w.premultiply(Cm.invert()),w.premultiply(this._yAxisUpSpace);const T=C.getSize(ut),x=C.getCenter(Rt).applyQuaternion(w);if(fa(this._camera)){const P=this.getDistanceToFitBox(T.x,T.y,T.z,i);p.push(this.moveTo(x.x,x.y,x.z,t)),p.push(this.dollyTo(P,t)),p.push(this.setFocalOffset(0,0,0,t))}else if(Cr(this._camera)){const P=this._camera,M=P.right-P.left,R=P.top-P.bottom,D=i?Math.max(M/T.x,R/T.y):Math.min(M/T.x,R/T.y);p.push(this.moveTo(x.x,x.y,x.z,t)),p.push(this.zoomTo(D,t)),p.push(this.setFocalOffset(0,0,0,t))}return Promise.all(p)}fitToSphere(e,t){const i=[],l="isObject3D"in e?Ua.createBoundingSphere(e,Sm):Sm.copy(e);if(i.push(this.moveTo(l.center.x,l.center.y,l.center.z,t)),fa(this._camera)){const u=this.getDistanceToFitSphere(l.radius);i.push(this.dollyTo(u,t))}else if(Cr(this._camera)){const u=this._camera.right-this._camera.left,d=this._camera.top-this._camera.bottom,p=2*l.radius,m=Math.min(u/p,d/p);i.push(this.zoomTo(m,t))}return i.push(this.setFocalOffset(0,0,0,t)),Promise.all(i)}setLookAt(e,t,i,a,l,u,d=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0;const p=Rt.set(a,l,u),m=ut.set(e,t,i);this._targetEnd.copy(p),this._sphericalEnd.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace)),this._needsUpdate=!0,d||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!d||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold)&&Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerp(e,t,i,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Io.NONE,this._changedDolly=0;const l=ut.set(...e.target);if("spherical"in e)Cn.set(...e.spherical);else{const _=Rt.set(...e.position);Cn.setFromVector3(_.sub(l).applyQuaternion(this._yAxisUpSpace))}const u=Mo.set(...t.target);if("spherical"in t)Ro.set(...t.spherical);else{const _=Rt.set(...t.position);Ro.setFromVector3(_.sub(u).applyQuaternion(this._yAxisUpSpace))}this._targetEnd.copy(l.lerp(u,i));const d=Ro.theta-Cn.theta,p=Ro.phi-Cn.phi,m=Ro.radius-Cn.radius;this._sphericalEnd.set(Cn.radius+m*i,Cn.phi+p*i,Cn.theta+d*i),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const A=!a||Ot(this._target.x,this._targetEnd.x,this.restThreshold)&&Ot(this._target.y,this._targetEnd.y,this.restThreshold)&&Ot(this._target.z,this._targetEnd.z,this.restThreshold)&&Ot(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Ot(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Ot(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(A)}lerpLookAt(e,t,i,a,l,u,d,p,m,A,_,b,w,E=!1){return this.lerp({position:[e,t,i],target:[a,l,u]},{position:[d,p,m],target:[A,_,b]},w,E)}setPosition(e,t,i,a=!1){return this.setLookAt(e,t,i,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,a)}setTarget(e,t,i,a=!1){const l=this.getPosition(ut),u=this.setLookAt(l.x,l.y,l.z,e,t,i,a);return this._sphericalEnd.phi=ss(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),u}setFocalOffset(e,t,i,a=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,i),this._needsUpdate=!0,a||this._focalOffset.copy(this._focalOffsetEnd);const l=!a||Ot(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Ot(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Ot(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(l)}setOrbitPoint(e,t,i){this._camera.updateMatrixWorld(),As.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_s.setFromMatrixColumn(this._camera.matrixWorldInverse,1),pa.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const a=ut.set(e,t,i),l=a.distanceTo(this._camera.position),u=a.sub(this._camera.position);As.multiplyScalar(u.x),_s.multiplyScalar(u.y),pa.multiplyScalar(u.z),ut.copy(As).add(_s).add(pa),ut.z=ut.z+l,this.dollyTo(l,!1),this.setFocalOffset(-ut.x,ut.y,-ut.z,!1),this.moveTo(e,t,i,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,i,a){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new rt.Vector4,typeof e=="number"?this._viewport.set(e,t,i,a):this._viewport.copy(e)}getDistanceToFitBox(e,t,i,a=!1){if(wm(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const l=e/t,u=this._camera.getEffectiveFOV()*Cc,d=this._camera.aspect;return((a?l>d:l<d)?t:e/d)*.5/Math.tan(u*.5)+i*.5}getDistanceToFitSphere(e){if(wm(this._camera,"getDistanceToFitSphere"))return this._spherical.radius;const t=this._camera.getEffectiveFOV()*Cc,i=Math.atan(Math.tan(t*.5)*this._camera.aspect)*2,a=1<this._camera.aspect?t:i;return e/Math.sin(a*.5)}getTarget(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).copy(t?this._targetEnd:this._target)}getPosition(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).setFromSpherical(t?this._sphericalEnd:this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(t?this._targetEnd:this._target)}getSpherical(e,t=!0){return(e||new rt.Spherical).copy(t?this._sphericalEnd:this._spherical)}getFocalOffset(e,t=!0){return(e&&e.isVector3?e:new rt.Vector3).copy(t?this._focalOffsetEnd:this._focalOffset)}normalizeRotations(){return this._sphericalEnd.theta=(this._sphericalEnd.theta%xr+xr)%xr,this._sphericalEnd.theta>Math.PI&&(this._sphericalEnd.theta-=xr),this._spherical.theta+=xr*Math.round((this._sphericalEnd.theta-this._spherical.theta)/xr),this}stop(){this._focalOffset.copy(this._focalOffsetEnd),this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd),this._zoom=this._zoomEnd}reset(e=!1){if(!Ot(this._camera.up.x,this._cameraUp0.x)||!Ot(this._camera.up.y,this._cameraUp0.y)||!Ot(this._camera.up.z,this._cameraUp0.z)){this._camera.up.copy(this._cameraUp0);const i=this.getPosition(ut);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}const t=[this.setLookAt(this._position0.x,this._position0.y,this._position0.z,this._target0.x,this._target0.y,this._target0.z,e),this.setFocalOffset(this._focalOffset0.x,this._focalOffset0.y,this._focalOffset0.z,e),this.zoomTo(this._zoom0,e)];return Promise.all(t)}saveState(){this._cameraUp0.copy(this._camera.up),this.getTarget(this._target0),this.getPosition(this._position0),this._zoom0=this._zoom,this._focalOffset0.copy(this._focalOffset)}updateCameraUp(){this._yAxisUpSpace.setFromUnitVectors(this._camera.up,qh),this._yAxisUpSpaceInverse.copy(this._yAxisUpSpace).invert()}applyCameraUp(){const e=ut.subVectors(this._target,this._camera.position).normalize(),t=Rt.crossVectors(e,this._camera.up);this._camera.up.crossVectors(t,e).normalize(),this._camera.updateMatrixWorld();const i=this.getPosition(ut);this.updateCameraUp(),this.setPosition(i.x,i.y,i.z)}update(e){const t=this._sphericalEnd.theta-this._spherical.theta,i=this._sphericalEnd.phi-this._spherical.phi,a=this._sphericalEnd.radius-this._spherical.radius,l=Pv.subVectors(this._targetEnd,this._target),u=Lv.subVectors(this._focalOffsetEnd,this._focalOffset),d=this._zoomEnd-this._zoom;if(Qt(t))this._thetaVelocity.value=0,this._spherical.theta=this._sphericalEnd.theta;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.theta=Vh(this._spherical.theta,this._sphericalEnd.theta,this._thetaVelocity,_,1/0,e),this._needsUpdate=!0}if(Qt(i))this._phiVelocity.value=0,this._spherical.phi=this._sphericalEnd.phi;else{const _=this._isUserControllingRotate?this.draggingSmoothTime:this.smoothTime;this._spherical.phi=Vh(this._spherical.phi,this._sphericalEnd.phi,this._phiVelocity,_,1/0,e),this._needsUpdate=!0}if(Qt(a))this._radiusVelocity.value=0,this._spherical.radius=this._sphericalEnd.radius;else{const _=this._isUserControllingDolly?this.draggingSmoothTime:this.smoothTime;this._spherical.radius=Vh(this._spherical.radius,this._sphericalEnd.radius,this._radiusVelocity,_,this.maxSpeed,e),this._needsUpdate=!0}if(Qt(l.x)&&Qt(l.y)&&Qt(l.z))this._targetVelocity.set(0,0,0),this._target.copy(this._targetEnd);else{const _=this._isUserControllingTruck?this.draggingSmoothTime:this.smoothTime;Rv(this._target,this._targetEnd,this._targetVelocity,_,this.maxSpeed,e,this._target),this._needsUpdate=!0}if(Qt(u.x)&&Qt(u.y)&&Qt(u.z))this._focalOffsetVelocity.set(0,0,0),this._focalOffset.copy(this._focalOffsetEnd);else{const _=this._isUserControllingOffset?this.draggingSmoothTime:this.smoothTime;Rv(this._focalOffset,this._focalOffsetEnd,this._focalOffsetVelocity,_,this.maxSpeed,e,this._focalOffset),this._needsUpdate=!0}if(Qt(d))this._zoomVelocity.value=0,this._zoom=this._zoomEnd;else{const _=this._isUserControllingZoom?this.draggingSmoothTime:this.smoothTime;this._zoom=Vh(this._zoom,this._zoomEnd,this._zoomVelocity,_,1/0,e)}if(this.dollyToCursor){if(fa(this._camera)&&this._changedDolly!==0){const _=this._spherical.radius-this._lastDistance,b=this._camera,w=this._getCameraDirection(Mc),E=ut.copy(w).cross(b.up).normalize();E.lengthSq()===0&&(E.x=1);const C=Rt.crossVectors(E,w),T=this._sphericalEnd.radius*Math.tan(b.getEffectiveFOV()*Cc*.5),P=(this._sphericalEnd.radius-_-this._sphericalEnd.radius)/this._sphericalEnd.radius,M=Mo.copy(this._targetEnd).add(E.multiplyScalar(this._dollyControlCoord.x*T*b.aspect)).add(C.multiplyScalar(this._dollyControlCoord.y*T)),R=ut.copy(this._targetEnd).lerp(M,P),D=this._lastDollyDirection===Io.IN&&this._spherical.radius<=this.minDistance,G=this._lastDollyDirection===Io.OUT&&this.maxDistance<=this._spherical.radius;if(this.infinityDolly&&(D||G)){this._sphericalEnd.radius-=_,this._spherical.radius-=_;const H=Rt.copy(w).multiplyScalar(-_);R.add(H)}this._boundary.clampPoint(R,R);const U=Rt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(U),this._changedDolly-=_,Qt(this._changedDolly)&&(this._changedDolly=0)}else if(Cr(this._camera)&&this._changedZoom!==0){const _=this._zoom-this._lastZoom,b=this._camera,w=ut.set(this._dollyControlCoord.x,this._dollyControlCoord.y,(b.near+b.far)/(b.near-b.far)).unproject(b),E=Rt.set(0,0,-1).applyQuaternion(b.quaternion),C=Mo.copy(w).add(E.multiplyScalar(-w.dot(b.up))),x=-(this._zoom-_-this._zoom)/this._zoom,P=this._getCameraDirection(Mc),M=this._targetEnd.dot(P),R=ut.copy(this._targetEnd).lerp(C,x),D=R.dot(P),G=P.multiplyScalar(D-M);R.sub(G),this._boundary.clampPoint(R,R);const U=Rt.subVectors(R,this._targetEnd);this._targetEnd.copy(R),this._target.add(U),this._changedZoom-=_,Qt(this._changedZoom)&&(this._changedZoom=0)}}this._camera.zoom!==this._zoom&&(this._camera.zoom=this._zoom,this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0),this._dragNeedsUpdate=!0;const p=this._collisionTest();this._spherical.radius=Math.min(this._spherical.radius,p),this._spherical.makeSafe(),this._camera.position.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse).add(this._target),this._camera.lookAt(this._target),(!Qt(this._focalOffset.x)||!Qt(this._focalOffset.y)||!Qt(this._focalOffset.z))&&(As.setFromMatrixColumn(this._camera.matrix,0),_s.setFromMatrixColumn(this._camera.matrix,1),pa.setFromMatrixColumn(this._camera.matrix,2),As.multiplyScalar(this._focalOffset.x),_s.multiplyScalar(-this._focalOffset.y),pa.multiplyScalar(this._focalOffset.z),ut.copy(As).add(_s).add(pa),this._camera.position.add(ut),this._camera.updateMatrixWorld()),this._boundaryEnclosesCamera&&this._encloseToBoundary(this._camera.position.copy(this._target),ut.setFromSpherical(this._spherical).applyQuaternion(this._yAxisUpSpaceInverse),1);const A=this._needsUpdate;return A&&!this._updatedLastTime?(this._hasRested=!1,this.dispatchEvent({type:"wake"}),this.dispatchEvent({type:"update"})):A?(this.dispatchEvent({type:"update"}),Qt(t,this.restThreshold)&&Qt(i,this.restThreshold)&&Qt(a,this.restThreshold)&&Qt(l.x,this.restThreshold)&&Qt(l.y,this.restThreshold)&&Qt(l.z,this.restThreshold)&&Qt(u.x,this.restThreshold)&&Qt(u.y,this.restThreshold)&&Qt(u.z,this.restThreshold)&&Qt(d,this.restThreshold)&&!this._hasRested&&(this._hasRested=!0,this.dispatchEvent({type:"rest"}))):!A&&this._updatedLastTime&&this.dispatchEvent({type:"sleep"}),this._lastDistance=this._spherical.radius,this._lastZoom=this._zoom,this._updatedLastTime=A,this._needsUpdate=!1,A}toJSON(){return JSON.stringify({enabled:this._enabled,minDistance:this.minDistance,maxDistance:Tc(this.maxDistance),minZoom:this.minZoom,maxZoom:Tc(this.maxZoom),minPolarAngle:this.minPolarAngle,maxPolarAngle:Tc(this.maxPolarAngle),minAzimuthAngle:Tc(this.minAzimuthAngle),maxAzimuthAngle:Tc(this.maxAzimuthAngle),smoothTime:this.smoothTime,draggingSmoothTime:this.draggingSmoothTime,dollySpeed:this.dollySpeed,truckSpeed:this.truckSpeed,dollyToCursor:this.dollyToCursor,target:this._targetEnd.toArray(),position:ut.setFromSpherical(this._sphericalEnd).add(this._targetEnd).toArray(),zoom:this._zoomEnd,focalOffset:this._focalOffsetEnd.toArray(),target0:this._target0.toArray(),position0:this._position0.toArray(),zoom0:this._zoom0,focalOffset0:this._focalOffset0.toArray()})}fromJSON(e,t=!1){const i=JSON.parse(e);this.enabled=i.enabled,this.minDistance=i.minDistance,this.maxDistance=Ic(i.maxDistance),this.minZoom=i.minZoom,this.maxZoom=Ic(i.maxZoom),this.minPolarAngle=i.minPolarAngle,this.maxPolarAngle=Ic(i.maxPolarAngle),this.minAzimuthAngle=Ic(i.minAzimuthAngle),this.maxAzimuthAngle=Ic(i.maxAzimuthAngle),this.smoothTime=i.smoothTime,this.draggingSmoothTime=i.draggingSmoothTime,this.dollySpeed=i.dollySpeed,this.truckSpeed=i.truckSpeed,this.dollyToCursor=i.dollyToCursor,this._target0.fromArray(i.target0),this._position0.fromArray(i.position0),this._zoom0=i.zoom0,this._focalOffset0.fromArray(i.focalOffset0),this.moveTo(i.target[0],i.target[1],i.target[2],t),Cn.setFromVector3(ut.fromArray(i.position).sub(this._targetEnd).applyQuaternion(this._yAxisUpSpace)),this.rotateTo(Cn.theta,Cn.phi,t),this.dollyTo(Cn.radius,t),this.zoomTo(i.zoom,t),this.setFocalOffset(i.focalOffset[0],i.focalOffset[1],i.focalOffset[2],t),this._needsUpdate=!0}connect(e){if(this._domElement){console.warn("camera-controls is already connected.");return}e.setAttribute("data-camera-controls-version",nF),this._addAllEventListeners(e),this._getClientRect(this._elementRect)}disconnect(){this.cancel(),this._removeAllEventListeners(),this._domElement&&(this._domElement.removeAttribute("data-camera-controls-version"),this._domElement=void 0)}dispose(){this.removeAllEventListeners(),this.disconnect()}_getTargetDirection(e){return e.setFromSpherical(this._spherical).divideScalar(this._spherical.radius).applyQuaternion(this._yAxisUpSpaceInverse)}_getCameraDirection(e){return this._getTargetDirection(e).negate()}_findPointerById(e){return this._activePointers.find(t=>t.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,i){const a=t.lengthSq();if(a===0)return e;const l=Rt.copy(t).add(e),d=this._boundary.clampPoint(l,Mo).sub(l),p=d.lengthSq();if(p===0)return e.add(t);if(p===a)return e;if(i===0)return e.add(t).add(d);{const m=1+i*p/t.dot(d);return e.add(Rt.copy(t).multiplyScalar(m)).add(d.multiplyScalar(1-i))}}_updateNearPlaneCorners(){if(fa(this._camera)){const e=this._camera,t=e.near,i=e.getEffectiveFOV()*Cc,a=Math.tan(i*.5)*t,l=a*e.aspect;this._nearPlaneCorners[0].set(-l,-a,0),this._nearPlaneCorners[1].set(l,-a,0),this._nearPlaneCorners[2].set(l,a,0),this._nearPlaneCorners[3].set(-l,a,0)}else if(Cr(this._camera)){const e=this._camera,t=1/e.zoom,i=e.left*t,a=e.right*t,l=e.top*t,u=e.bottom*t;this._nearPlaneCorners[0].set(i,l,0),this._nearPlaneCorners[1].set(a,l,0),this._nearPlaneCorners[2].set(a,u,0),this._nearPlaneCorners[3].set(i,u,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||wm(this._camera,"_collisionTest"))return e;const i=this._getTargetDirection(Mc);Tm.lookAt(Bv,i,this._camera.up);for(let a=0;a<4;a++){const l=Rt.copy(this._nearPlaneCorners[a]);l.applyMatrix4(Tm);const u=Mo.addVectors(this._target,l);jh.set(u,i),jh.far=this._spherical.radius+1;const d=jh.intersectObjects(this.colliderMeshes);d.length!==0&&d[0].distance<e&&(e=d[0].distance)}return e}_getClientRect(e){if(!this._domElement)return;const t=this._domElement.getBoundingClientRect();return e.x=t.left,e.y=t.top,this._viewport?(e.x+=this._viewport.x,e.y+=t.height-this._viewport.w-this._viewport.y,e.width=this._viewport.z,e.height=this._viewport.w):(e.width=t.width,e.height=t.height),e}_createOnRestPromise(e){return e?Promise.resolve():(this._hasRested=!1,this.dispatchEvent({type:"transitionstart"}),new Promise(t=>{const i=()=>{this.removeEventListener("rest",i),t()};this.addEventListener("rest",i)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new rt.Sphere){const i=t,a=i.center;Bo.makeEmpty(),e.traverseVisible(u=>{u.isMesh&&Bo.expandByObject(u)}),Bo.getCenter(a);let l=0;return e.traverseVisible(u=>{if(!u.isMesh)return;const d=u;if(!d.geometry)return;const p=d.geometry.clone();p.applyMatrix4(d.matrixWorld);const A=p.attributes.position;for(let _=0,b=A.count;_<b;_++)ut.fromBufferAttribute(A,_),l=Math.max(l,a.distanceToSquared(ut))}),i.radius=Math.sqrt(l),i}}class ZA{constructor(e){this.__position=new se,this.__target=new se,this.setPosition(e.position.x,e.position.y,e.position.z),this.setTarget(e.target.x,e.target.y,e.target.z)}getPosition(){return this.__position}setPosition(e,t,i){this.__position.setX(e),this.__position.setY(t),this.__position.setZ(i)}getTarget(){return this.__target}setTarget(e,t,i){this.__target.setX(e),this.__target.setY(t),this.__target.setZ(i)}}class rF extends yC{constructor({appWcRef:e}){super({appWcRef:e}),this._loggerContext="CAMERA MANAGER",this.__cameras={},this.__mainCameraControls={},this.__screenshotCameraControls={},this.__cameraDirection=new se,this.__cameraSpherical=new hl,this.__savedCameraState={position:new se,target:new se}}getCameras(){return this.__cameras}get mainCameraControls(){return this.__mainCameraControls}get screenshotCameraControls(){return this.__screenshotCameraControls}loadConfiguration(e){e.fov&&(this.__cameras.main.fov=e.fov)}getCurrentCameraTransforms(){const e=new se;this.__cameras.main.getWorldPosition(e);const t=new se;return this.__mainCameraControls.getTarget(t),{position:e,target:t}}getCurrentCameraRotation(){return{azimuthAngle:this.__mainCameraControls.azimuthAngle,polarAngle:this.__mainCameraControls.polarAngle,distance:this.__mainCameraControls.distance}}getCameraFocalLength(){return this.__cameras.main.getFocalLength()}setCameraFocalLength(e){this.__cameras.main.setFocalLength(e)}async fitCameraToSceneBounds(e=!0){const t=this._appWcRef.getSceneSphericalBoundsForCameraFocus();return await this.fitCameraToObject({objectToFocus:t,enableTransition:e})}__onMainCameraControlsControlStart(e){const t=this.__mainCameraControls,i=t.currentAction===t.mouseButtons?.right||t.currentAction===t.touches?.two;e.canPan&&i?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"pan"}):t.currentAction===t.mouseButtons?.left?this._appWcRef.eventsManager.cameraControlsStart.fire({type:"rotate"}):this._appWcRef.eventsManager.cameraControlsStart.fire({type:null})}__onMainCameraControlsControlEnd(){this._appWcRef.eventsManager.inputEnd.fire()}saveCurrentCameraTransforms(){this.__mainCameraControls.getPosition(this.__savedCameraState.position),this.__mainCameraControls.getTarget(this.__savedCameraState.target)}resetCurrentCameraTransformsToLastSavedState(e=!0){const t=new ZA({position:{x:this.__savedCameraState.position.x,y:this.__savedCameraState.position.y,z:this.__savedCameraState.position.z},target:{x:this.__savedCameraState.target.x,y:this.__savedCameraState.target.y,z:this.__savedCameraState.target.z}});this.moveCameraToLocation({newCameraTransforms:t,transition:e})}setCameraZoomLimits({minDistance:e,maxDistance:t}){const i=this._appWcRef.getSceneSphericalBoundsForCameraFocus().radius,a=i<=0?1:i;e&&(this.__mainCameraControls.minDistance=a*e),t&&(this.__mainCameraControls.maxDistance=a*t),this.fitCameraToSceneBounds()}disableCameraZoomLimits(){this.setCameraZoomLimits({minDistance:-1/0,maxDistance:1/0})}normalizeAngle(e){const t=Math.PI*2;return Is.euclideanModulo(e,t)}absoluteAngle(e,t){const i=Math.PI*2,a=e-t;return Is.euclideanModulo(a+Math.PI,i)-Math.PI}async moveCameraToLocation({newCameraTransforms:e,freezeCamera:t=!1,transition:i=!0,targetCameraControlsRef:a=this.__mainCameraControls}){const l=e.getPosition(),u=e.getTarget();a.enabled=!1,this.__cameraDirection.set(0,0,0),this.__cameraDirection.subVectors(l,u),this.__cameraDirection.normalize();const d=l.distanceTo(u);this.__cameraSpherical.setFromVector3(this.__cameraDirection);const p=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.theta),this.normalizeAngle(a.azimuthAngle)),m=this.absoluteAngle(this.normalizeAngle(this.__cameraSpherical.phi),this.normalizeAngle(a.polarAngle));a.rotate(p,m,i),a.moveTo(u.x,u.y,u.z,i),a.dollyTo(d,i),t||(a.enabled=!0)}async rotateCameraToLocation({azimuthAngle:e,polarAngle:t,distance:i,transition:a=!0,targetCameraControlsRef:l=this.__mainCameraControls}){e&&l.rotateAzimuthTo(e,a),t&&l.rotatePolarTo(t,a),i&&l.dollyTo(i,a)}async resetCameraToDefault(e){const{canZoom:t,canPan:i,minDistance:a,maxDistance:l,minPolarAngle:u,maxPolarAngle:d,minAzimuthAngle:p,maxAzimuthAngle:m}=e,A=Ua.ACTION;this.__mainCameraControls.mouseButtons.left=A.ROTATE,this.__mainCameraControls.touches.one=A.TOUCH_ROTATE,this.__mainCameraControls.mouseButtons.wheel=t?A.DOLLY:A.NONE,this.__mainCameraControls.touches.two=t?A.TOUCH_DOLLY:A.NONE,this.__mainCameraControls.mouseButtons.middle=A.NONE,this.__mainCameraControls.mouseButtons.right=i?A.TRUCK:A.NONE,this.__mainCameraControls.touches.two=i?A.TOUCH_TRUCK:A.NONE,this.__mainCameraControls.enabled=!0,t&&i&&(this.__mainCameraControls.touches.two=i?A.TOUCH_DOLLY_TRUCK:A.NONE),this.setCameraZoomLimits({minDistance:a??.5,maxDistance:l??5}),this.__mainCameraControls.minPolarAngle=u,this.__mainCameraControls.maxPolarAngle=d,this.__mainCameraControls.minAzimuthAngle=p,this.__mainCameraControls.maxAzimuthAngle=m}async fitCameraToObject({objectToFocus:e,enableTransition:t=!0}){return await this.__mainCameraControls.fitToSphere(e,t)}async wiggleCamera(){const e=this.__mainCameraControls.azimuthAngle,t=[0,.4,-.3,0];for(const i of t){if(!this._appWcRef.playInteractionPrompt)break;await this.__mainCameraControls.rotateAzimuthTo(e+i,!0)}}async setup({mainRenderer:e,screenshotRenderer:t,cameraSettings:i}){const{focalLength:a}=i;this.__cameras={main:new bi(75,window.innerWidth/window.innerHeight,.1,1e3),screenshot:new bi(75,window.innerWidth/window.innerHeight,.1,1e3)},this.__cameras.main.name="MainCamera",this.__cameras.screenshot.name="ScreenshotCamera",this.__cameras.main.position.setZ(100);const l={Vector2:He,Vector3:se,Vector4:Bt,Quaternion:zi,Matrix4:tt,Spherical:hl,Box3:vi,Sphere:vn,Raycaster:o_};Ua.install({THREE:l}),this.__mainCameraControls=new Ua(this.__cameras.main,e.domElement),this.__screenshotCameraControls=new Ua(this.__cameras.screenshot,t.domElement),this.__cameras.main.setFocalLength(a),this.__cameras.main.near=.01,this.__cameras.main.far=1e3,await this.resetCameraToDefault(i),this.__mainCameraControls.addEventListener("controlstart",()=>{this.__onMainCameraControlsControlStart(i)}),this.__mainCameraControls.addEventListener("controlend",()=>{this.__onMainCameraControlsControlEnd()}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.appReadyEvent.name,()=>{this.setCameraZoomLimits({minDistance:i.minDistance,maxDistance:i.maxDistance})}),this._appWcRef.addEventListener(this._appWcRef.eventsManager.cameraMoveToTransform.name,(u=>{u.detail.saveFirst&&this.saveCurrentCameraTransforms();const{position:d,target:p}=u.detail.cameraTransforms,m=new ZA({position:d,target:p});this.moveCameraToLocation({newCameraTransforms:m})})),this._appWcRef.addEventListener(this._appWcRef.eventsManager.hotspotsVisibilityChanged.name,(u=>{const d=this.mainCameraControls,p=u.detail.visible?d.maxDistance+.3:d.maxDistance-.3;d.maxDistance=p}))}}const aF='@font-face{font-family:Helvetica Neue;src:url(https://asset.myepigraph.com/design-assets/fonts/HelveticaNeue/HelveticaNeue-Light.otf) format("opentype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:PPMori-Regular;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Regular.woff2) format("woff2");font-display:swap}@font-face{font-family:PPMori-Bold;src:url(https://asset.myepigraph.com/design-assets/fonts/PPMori/PPMori-Bold.woff2) format("woff2");font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Bold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-BoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-ExtraBold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-ExtraBoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Italic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Italic-VariableFont_wght.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Medium.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-MediumItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-Regular.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-SemiBold.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-SemiBoldItalic.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:EB Garamond;src:url(https://asset.myepigraph.com/design-assets/fonts/EBGaramond/EBGaramond-VariableFont_wght.ttf) format("truetype");font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter-VariableFont_slnt_wght.ttf) format("truetype");font-weight:300;font-style:normal;font-display:swap}@font-face{font-family:Inter;src:url(https://asset.myepigraph.com/design-assets/fonts/Inter/Inter_18pt-Bold.ttf) format("truetype");font-weight:700;font-style:normal;font-display:swap}',oF={Color:{Black:{25:{$type:"color",$value:"rgba(0, 0, 0, 0.0000)"},50:{$type:"color",$value:"rgba(0, 0, 0, 0.0500)"},100:{$type:"color",$value:"rgba(0, 0, 0, 0.1000)"},200:{$type:"color",$value:"rgba(0, 0, 0, 0.2000)"},300:{$type:"color",$value:"rgba(0, 0, 0, 0.3000)"},400:{$type:"color",$value:"rgba(0, 0, 0, 0.4000)"},500:{$type:"color",$value:"rgba(0, 0, 0, 0.5000)"},600:{$type:"color",$value:"rgba(0, 0, 0, 0.6000)"},700:{$type:"color",$value:"rgba(0, 0, 0, 0.7000)"},800:{$type:"color",$value:"rgba(0, 0, 0, 0.8000)"},900:{$type:"color",$value:"rgba(0, 0, 0, 0.9000)"},1e3:{$type:"color",$value:"#000000"}},White:{25:{$type:"color",$value:"rgba(255, 255, 255, 0.0250)"},50:{$type:"color",$value:"rgba(255, 255, 255, 0.0500)"},100:{$type:"color",$value:"rgba(255, 255, 255, 0.1000)"},200:{$type:"color",$value:"rgba(255, 255, 255, 0.2000)"},300:{$type:"color",$value:"rgba(255, 255, 255, 0.3000)"},400:{$type:"color",$value:"rgba(255, 255, 255, 0.4000)"},500:{$type:"color",$value:"rgba(255, 255, 255, 0.5000)"},600:{$type:"color",$value:"rgba(255, 255, 255, 0.6000)"},700:{$type:"color",$value:"rgba(255, 255, 255, 0.7000)"},800:{$type:"color",$value:"rgba(255, 255, 255, 0.8000)"},900:{$type:"color",$value:"rgba(255, 255, 255, 0.9000)"},1e3:{$type:"color",$value:"#ffffff"}},Green:{100:{$type:"color",$value:"#ebffee"},200:{$type:"color",$value:"#cff7d3"},300:{$type:"color",$value:"#aff4c6"},400:{$type:"color",$value:"#85e0a3"},500:{$type:"color",$value:"#14ae5c"},600:{$type:"color",$value:"#009951"},700:{$type:"color",$value:"#008043"},800:{$type:"color",$value:"#02542d"},900:{$type:"color",$value:"#024023"},1e3:{$type:"color",$value:"#062d1b"}},Red:{100:{$type:"color",$value:"#fee9e7"},200:{$type:"color",$value:"#fdd3d0"},300:{$type:"color",$value:"#fcb3ad"},400:{$type:"color",$value:"#f4776a"},500:{$type:"color",$value:"#ec221f"},600:{$type:"color",$value:"#c00f0c"},700:{$type:"color",$value:"#900b09"},800:{$type:"color",$value:"#690807"},900:{$type:"color",$value:"#4d0b0a"},1e3:{$type:"color",$value:"#300603"}},Yellow:{100:{$type:"color",$value:"#fffbeb"},200:{$type:"color",$value:"#fff1c2"},300:{$type:"color",$value:"#ffe8a3"},400:{$type:"color",$value:"#e8b931"},500:{$type:"color",$value:"#e5a000"},600:{$type:"color",$value:"#bf6a02"},700:{$type:"color",$value:"#975102"},800:{$type:"color",$value:"#682d03"},900:{$type:"color",$value:"#522504"},1e3:{$type:"color",$value:"#401b01"}},Blue:{100:{$type:"color",$value:"#fbfdff"},200:{$type:"color",$value:"#eaf4ff"},300:{$type:"color",$value:"#d5ebff"},400:{$type:"color",$value:"#c0e1ff"},500:{$type:"color",$value:"#91d0ff"},600:{$type:"color",$value:"#0094d5"},700:{$type:"color",$value:"#00679b"},800:{$type:"color",$value:"#003a5a"},900:{$type:"color",$value:"#003a5a"},1e3:{$type:"color",$value:"#002133"}},Slate:{100:{$type:"color",$value:"#f5f5f5"},200:{$type:"color",$value:"#e3e3e3"},300:{$type:"color",$value:"#cdcdcd"},400:{$type:"color",$value:"#b2b2b2"},500:{$type:"color",$value:"#949494"},600:{$type:"color",$value:"#767676"},700:{$type:"color",$value:"#5a5a5a"},800:{$type:"color",$value:"#434343"},900:{$type:"color",$value:"#303030"},1e3:{$type:"color",$value:"#242424"}},Grey:{25:{$type:"color",$value:"#f5f5f5"},50:{$type:"color",$value:"#f2f2f2"},100:{$type:"color",$value:"#e6e6e6"},200:{$type:"color",$value:"#cccccc"},300:{$type:"color",$value:"#b3b3b3"},400:{$type:"color",$value:"#999999"},500:{$type:"color",$value:"#7b7b7b"},600:{$type:"color",$value:"#666666"},700:{$type:"color",$value:"#4d4d4d"},800:{$type:"color",$value:"#333333"},900:{$type:"color",$value:"#1a1a1a"},1e3:{$type:"color",$value:"#0d0d0d"}},GreyAlpha:{25:{$type:"color",$value:"rgba(248, 248, 248, 0.8000)"},100:{$type:"color",$value:"rgba(242, 242, 242, 0.8000)"},500:{$type:"color",$value:"rgba(204, 204, 204, 0.2000)"},700:{$type:"color",$value:"rgba(204, 204, 204, 0.6000)"},800:{$type:"color",$value:"rgba(186, 186, 186, 0.6000)"},900:{$type:"color",$value:"rgba(50, 50, 50, 0.9000)"},"05":{$type:"color",$value:"rgba(253, 253, 253, 0.8000)"}}},Unit:{Space:{0:{$type:"number",$value:"0px"},100:{$type:"number",$value:"4px"},150:{$type:"number",$value:"6px"},200:{$type:"number",$value:"8px"},300:{$type:"number",$value:"12px"},400:{$type:"number",$value:"16px"},500:{$type:"number",$value:"20px"},600:{$type:"number",$value:"24px"},800:{$type:"number",$value:"32px"},1e3:{$type:"number",$value:"40px"},1200:{$type:"number",$value:"48px"},1600:{$type:"number",$value:"64px"},2e3:{$type:"number",$value:"80px"},2400:{$type:"number",$value:"96px"},2800:{$type:"number",$value:"112px"},3200:{$type:"number",$value:"128px"},3600:{$type:"number",$value:"144px"},4e3:{$type:"number",$value:"160px"},4400:{$type:"number",$value:"176px"},4800:{$type:"number",$value:"192px"},5200:{$type:"number",$value:"208px"},5600:{$type:"number",$value:"224px"},6e3:{$type:"number",$value:"240px"},6400:{$type:"number",$value:"256px"},7200:{$type:"number",$value:"288px"},8e3:{$type:"number",$value:"320px"},9600:{$type:"number",$value:"384px"},"0125":{$type:"number",$value:"0.5px"},"025":{$type:"number",$value:"1px"},"0325":{$type:"number",$value:"1.5px"},"050":{$type:"number",$value:"2px"}},Stack:{100:{$type:"number",$value:"-4px"},200:{$type:"number",$value:"-8px"},300:{$type:"number",$value:"-12px"},400:{$type:"number",$value:"-16px"},800:{$type:"number",$value:"-32px"},1e3:{$type:"number",$value:"-40px"},1600:{$type:"number",$value:"-64px"},2400:{$type:"number",$value:"-96px"},3200:{$type:"number",$value:"-128px"},4e3:{$type:"number",$value:"-160px"},4800:{$type:"number",$value:"-192px"},5600:{$type:"number",$value:"-224px"},7200:{$type:"number",$value:"-288px"},9600:{$type:"number",$value:"-384px"},"0125":{$type:"number",$value:"-0.5px"},"025":{$type:"number",$value:"-1px"},"0325":{$type:"number",$value:"-1.5px"},"050":{$type:"number",$value:"-2px"},"075":{$type:"number",$value:"-3px"}},Size:{4:{$type:"number",$value:"4px"},6:{$type:"number",$value:"6px"},8:{$type:"number",$value:"8px"},10:{$type:"number",$value:"10px"},12:{$type:"number",$value:"12px"},14:{$type:"number",$value:"14px"},16:{$type:"number",$value:"16px"},18:{$type:"number",$value:"18px"},20:{$type:"number",$value:"20px"},22:{$type:"number",$value:"22px"},24:{$type:"number",$value:"24px"},28:{$type:"number",$value:"28px"},30:{$type:"number",$value:"30px"},32:{$type:"number",$value:"32px"},40:{$type:"number",$value:"40px"},48:{$type:"number",$value:"48px"},64:{$type:"number",$value:"64px"},80:{$type:"number",$value:"80px"},96:{$type:"number",$value:"96px"},112:{$type:"number",$value:"112px"},128:{$type:"number",$value:"128px"},144:{$type:"number",$value:"144px"},160:{$type:"number",$value:"160px"},176:{$type:"number",$value:"176px"},224:{$type:"number",$value:"224px"}},Resolution:{XxsmallScreenMin:{$type:"number",$value:"375px"},XsmallScreenMin:{$type:"number",$value:"480px"},SmallScreenMin:{$type:"number",$value:"576px"},MediumScreenMin:{$type:"number",$value:"768px"},LargeScreenMin:{$type:"number",$value:"992px"},XlargeScreenMin:{$type:"number",$value:"1200px"},XxlargeScreenMin:{$type:"number",$value:"1400px"},XxxsmallScreenMax:{$type:"number",$value:"374px"},XxsmallScreenMax:{$type:"number",$value:"479px"},XsmallScreenMax:{$type:"number",$value:"575px"},SmallScreenMax:{$type:"number",$value:"767px"},MediumScreenMax:{$type:"number",$value:"991px"},LargeScreenMax:{$type:"number",$value:"1199px"},XlargeScreenMax:{$type:"number",$value:"1399px"},XxlargeScreenMax:{$type:"number",$value:"1920px"}}},Font:{Family:{Main:{$type:"string",$value:"PP Mori"},Body:{$type:"string",$value:"Helvetica LT Pro"},Epigraph:{$type:"string",$value:"PP Mori"}}}},wC={Color:{Brand:{Base:{$type:"color",$value:"#335166",$web:"var(--color-brand-base)"},BaseSecondary:{$type:"color",$value:"#2b4354",$web:"var(--color-brand-base-secondary)"},BaseTertiary:{$type:"color",$value:"#202f3a",$web:"var(--color-brand-base-tertiary)"},Accent:{$type:"color",$value:"#4276cf",$web:"var(--color-brand-accent)"},AccentSecondary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-secondary)"},AccentTertiary:{$type:"color",$value:"#3761a8",$web:"var(--color-brand-accent-tertiary)"},Light:{$type:"color",$value:"#f8fbf6",$web:"var(--color-brand-light)"},Dark:{$type:"color",$value:"#111b22",$web:"var(--color-brand-dark)"}}},Font:{Brand:{Heading:{$type:"string",$value:"EB Garamond",$web:"var(--font-brand-heading)"},Paragraph:{$type:"string",$value:"Inter",$web:"var(--font-brand-body)"}}},Unit:{Brand:{Radius:{$type:"number",$value:"4px",$web:"var(--unit-brand-radius)"}}}},Se={Color:{Surface:{Plain:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.100}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.50}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.25}"},ShadowSecondary:{$value:"{Primitives.Color.Black.200}"}},Fill:{Accent:{$value:"{BrandPrimitives.Color.Brand.Accent}"},AccentHover:{$value:"{BrandPrimitives.Color.Brand.AccentSecondary}"},AccentPress:{$value:"{BrandPrimitives.Color.Brand.AccentTertiary}"},Base:{$value:"{BrandPrimitives.Color.Brand.Base}"},BaseHover:{$value:"{BrandPrimitives.Color.Brand.BaseSecondary}"},BasePress:{$value:"{BrandPrimitives.Color.Brand.BaseTertiary}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.700}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.300}"},NeutralTertiary:{$value:"{Primitives.Color.Grey.100}"},SubtlePrimary:{$value:"{Primitives.Color.GreyAlpha.100}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.25}"},DangerPrimary:{$value:"{Primitives.Color.Red.600}"},Disabled:{$value:"{Primitives.Color.Grey.200}"},HotspotSecondary:{$value:"{Primitives.Color.GreyAlpha.800}"}},Icon:{NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"}},Text:{Invert:{$value:"{Primitives.Color.White.1000}"},NeutralPrimary:{$value:"{Primitives.Color.Grey.800}"},NeutralSecondary:{$value:"{Primitives.Color.Grey.700}"},Disabled:{$value:"{Primitives.Color.Grey.300}"}},Border:{AltContrast:{$value:"{BrandPrimitives.Color.Brand.Dark}"},SubtlePrimary:{$value:"{Primitives.Color.Grey.300}"},SubtleSecondary:{$value:"{Primitives.Color.GreyAlpha.700}"}}},Size:{Text:{Small:{$value:"{Primitives.Unit.Size.16}"},Medium:{$value:"{Primitives.Unit.Size.18}"},Large:{$value:"{Primitives.Unit.Size.20}"}},Icon:{Small:{$value:"{Primitives.Unit.Size.20}"},Medium:{$value:"{Primitives.Unit.Size.24}"},Large:{$value:"{Primitives.Unit.Size.28}"}},Radius:{Medium:{$value:"{Primitives.Unit.Space.150}"},Full:{$value:"{Primitives.Unit.Space.6000}"}},Stroke:{Regular:{$value:"{Primitives.Unit.Space.025}"},Thick:{$value:"{Primitives.Unit.Space.050}"}},Shadow:{None:{$value:"{Primitives.Unit.Space.0}"},Xsmall:{$value:"{Primitives.Unit.Space.025}"},Small:{$value:"{Primitives.Unit.Space.0325}"}},Blur:{Small:{$value:"{Primitives.Unit.Space.100}"}}},Space:{Padding:{Small:{$value:"{Primitives.Unit.Space.300}"},Medium:{$value:"{Primitives.Unit.Space.400}"},Regular:{$value:"{Primitives.Unit.Space.600}"}},Gap:{Small:{$value:"{Primitives.Unit.Space.200}"},Regular:{$value:"{Primitives.Unit.Space.400}"},Xxlarge:{$value:"{Primitives.Unit.Space.800}"}}},Font:{Family:{CustomH:{$value:"{BrandPrimitives.Font.Brand.Heading}"},CustomP:{$value:"{BrandPrimitives.Font.Brand.Paragraph}"},Main:{$value:"Helvetica Neue"}},Tracking:{Normal:{$value:"{Primitives.Unit.Space.0}"}}}};function be(o){const e=/\{Primitives\.(.*?)}/,t=String(o).match(e),i=/\{BrandPrimitives\.(.*?)}/,a=String(o).match(i);let l=o;if(t){const u=t[1].split(".");l=oF[u[0]][u[1]][u[2]].$value}else if(a){const u=a[1].split("."),d=wC[u[0]][u[1]][u[2]],p=d.$web;l=`${p.substring(0,p.length-1)}, ${d.$value})`}return hn(l)}const T_={poweredByEpigraphFooterText:"https://asset.myepigraph.com/design-assets/icons/powered-by-epigraph.svg",splashScreenLogo:"https://asset.myepigraph.com/design-assets/icons/default-splash-screen-image.svg",sampleQrCode:"https://asset.myepigraph.com/design-assets/icons/sample-qr-code.png"};function lF(){const o={};for(const[e,t]of Object.entries(wC))for(const[i,a]of Object.entries(t))for(const[l,u]of Object.entries(a)){const d=`${e}${i}${l}`;o[d]={name:hn(u.$web),defaultValue:u.$value,argType:{control:u.$type}}}return o}const cF=lF(),Dl={size:{name:"size",defaultValue:"small",argType:{options:["small","medium","large"],control:"select"}},theme:{name:"theme",defaultValue:"light",argType:{options:["light","dark"],control:"select"}},disabled:{name:"disabled",defaultValue:!1,argType:{control:"boolean"}}};var uF=Object.defineProperty,Yf=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&uF(e,t,a),a};const Yu=class EC extends dl{constructor(){super(),this.epgOnClickEventName="epgonclick",this.disabled=!1,this.theme=Dl.theme.defaultValue.toString(),this.size=Dl.size.defaultValue.toString(),EC.ensureFontsAreLoaded()}static{this.styles=[ct`
|
|
4205
4205
|
:host {
|
|
4206
4206
|
font-family: ${be(Se.Font.Family.Main.$value)};
|
|
4207
4207
|
letter-spacing: 0.5px;
|
|
@@ -6807,7 +6807,7 @@ Arguments: [`+B+"]"}},s.fz.prototype={k(n){return"Unsupported operation: "+this.
|
|
|
6807
6807
|
></epg-tool-control>
|
|
6808
6808
|
</slot>
|
|
6809
6809
|
</div>
|
|
6810
|
-
`}}U_([ue({attribute:Dr.expandOrientation.name})],sp.prototype,"expandOrientation");U_([ue({type:Boolean,attribute:Dr.collapsible.name})],sp.prototype,"collapsible");U_([ue({type:Boolean,attribute:Dr.collapsed.name})],sp.prototype,"collapsed");window.customElements.get(Ow)||window.customElements.define(Ow,sp);var Wi=(o=>(o.expanded="expanded",o.collapsed="collapsed",o))(Wi||{});class kw{constructor({config:e,appWcRef:t,hotspotManagerRef:i}){this.__cameraDirection=new se,this.header={preheadText:"",headerText:"",subheadText:"",media:{uri:"",type:Ol.IMAGE,mediaCaption:"",altText:""}},this.carousel={mediaItems:[],indicator:qC.DOTS},this.details="",this.__localPosition=new se,this.__worldPosition=new se,this.normals=new se,this.screenPosition=new He,this.camera={position:new se,target:new se,focalLength:35},this.entity=new Lt,this.animation=[],this.desktopPlacement=nl.LEFT,this.visited=!1,this.__config=e,this.appWcRef=t,this.hotspotsManager=i,this.assetId=e.assetId,this.hotspotId=e.hotspotId,this.updateHotspotConfig(e)}static{this.styles=ct`
|
|
6810
|
+
`}}U_([ue({attribute:Dr.expandOrientation.name})],sp.prototype,"expandOrientation");U_([ue({type:Boolean,attribute:Dr.collapsible.name})],sp.prototype,"collapsible");U_([ue({type:Boolean,attribute:Dr.collapsed.name})],sp.prototype,"collapsed");window.customElements.get(Ow)||window.customElements.define(Ow,sp);var Wi=(o=>(o.expanded="expanded",o.collapsed="collapsed",o))(Wi||{});class kw{constructor({config:e,appWcRef:t,hotspotManagerRef:i}){this.__cameraDirection=new se,this.header={preheadText:"",headerText:"",subheadText:"",media:{uri:"",type:Ol.IMAGE,mediaCaption:"",altText:""}},this.carousel={mediaItems:[],indicator:qC.DOTS},this.details="",this.__localPosition=new se,this.__worldPosition=new se,this.normals=new se,this.screenPosition=new He,this.camera={position:new se,target:new se,focalLength:35},this.entity=new Lt,this.animation=[],this.desktopPlacement=nl.LEFT,this.visited=!1,this.__config=e,this.appWcRef=t,this.hotspotsManager=i,this.assetId=e.assetId,this.hotspotId=e.hotspotId,this.name=e.name,this.updateHotspotConfig(e)}static{this.styles=ct`
|
|
6811
6811
|
.hotspot-indicator {
|
|
6812
6812
|
position: absolute;
|
|
6813
6813
|
transform: translate(-50%, -50%);
|
|
@@ -6832,7 +6832,7 @@ Arguments: [`+B+"]"}},s.fz.prototype={k(n){return"Unsupported operation: "+this.
|
|
|
6832
6832
|
class="hotspot-indicator ${i?"inactive":""} ${this.__isFacingCamera()?"":"occluded"}"
|
|
6833
6833
|
style="left: ${this.screenPosition.x}px; top: ${this.screenPosition.y}px"
|
|
6834
6834
|
hotspot-id=${this.hotspotId}
|
|
6835
|
-
tooltip-label=${this.
|
|
6835
|
+
tooltip-label=${this.name}
|
|
6836
6836
|
tooltip-placement=${a}
|
|
6837
6837
|
?active=${t}
|
|
6838
6838
|
?visited=${this.visited}
|
|
@@ -8363,7 +8363,7 @@ void main() {
|
|
|
8363
8363
|
opacity: 0.2;
|
|
8364
8364
|
filter: drop-shadow(2px 6px 4px white);
|
|
8365
8365
|
}
|
|
8366
|
-
`}static{this.gridHelper=new s2(10,20)}static{this.boundsSize=new vi}static{this.boundsVisualizer=new r2(as.boundsSize,16711680)}firstUpdated(){this.__setupEventListeners()}updateBox3HelperSize(e){as.boundsSize.copy(e)}showSceneDebuggers(){const e=this.appWcRef.renderEngine;e&&(this.appWcRef.sceneManager&&this.updateBox3HelperSize(this.appWcRef.sceneManager.currentSceneBounds),e.sceneHierarchy.miscGrp.add(as.boundsVisualizer),e.sceneHierarchy.miscGrp.add(as.gridHelper),e.sceneHierarchy.sceneStructure.traverse(t=>{(t instanceof Jr||t instanceof hr)&&t.showDebug()}),e.showTextRenderer())}hideSceneDebuggers(){const e=this.appWcRef.renderEngine;e&&(as.boundsVisualizer?.removeFromParent(),as.gridHelper.removeFromParent(),e.sceneHierarchy.sceneStructure.traverse(t=>{(t instanceof Jr||t instanceof hr)&&t.hideDebug()}),e.hideTextRenderer())}__setupEventListeners(){this.appWcRef.addEventListener(this.appWcRef.eventsManager.appReadyEvent.name,()=>{this.enabled?this.showSceneDebuggers():this.hideSceneDebuggers()}),this.appWcRef.addEventListener(this.appWcRef.eventsManager.sceneBoundsChanged.name,()=>{this.updateBox3HelperSize(this.appWcRef.sceneManager.currentSceneBounds)})}connectedCallback(){super.connectedCallback(),this.showSceneDebuggers()}disconnectedCallback(){this.hideSceneDebuggers(),super.disconnectedCallback()}render(){return Ee`<div class="debug-label">DEBUG MODE</div>`}}var RH=Object.defineProperty,mt=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&RH(e,t,a),a},Ta=(o=>(o.NONE="",o.SKU="sku",o.SHOPIFY_VARIANT_ID="shopify_variant_id",o.ASIN="asin",o.UPC="upc",o.EXPERIENCE_ID="experience_id",o.PRODUCT_VARIANT_UUID="product_variant_uuid",o))(Ta||{});const ht=class ou extends gI{constructor(){super(window.__APP_VERSION__,cu.DEVELOPMENT),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this.
|
|
8366
|
+
`}static{this.gridHelper=new s2(10,20)}static{this.boundsSize=new vi}static{this.boundsVisualizer=new r2(as.boundsSize,16711680)}firstUpdated(){this.__setupEventListeners()}updateBox3HelperSize(e){as.boundsSize.copy(e)}showSceneDebuggers(){const e=this.appWcRef.renderEngine;e&&(this.appWcRef.sceneManager&&this.updateBox3HelperSize(this.appWcRef.sceneManager.currentSceneBounds),e.sceneHierarchy.miscGrp.add(as.boundsVisualizer),e.sceneHierarchy.miscGrp.add(as.gridHelper),e.sceneHierarchy.sceneStructure.traverse(t=>{(t instanceof Jr||t instanceof hr)&&t.showDebug()}),e.showTextRenderer())}hideSceneDebuggers(){const e=this.appWcRef.renderEngine;e&&(as.boundsVisualizer?.removeFromParent(),as.gridHelper.removeFromParent(),e.sceneHierarchy.sceneStructure.traverse(t=>{(t instanceof Jr||t instanceof hr)&&t.hideDebug()}),e.hideTextRenderer())}__setupEventListeners(){this.appWcRef.addEventListener(this.appWcRef.eventsManager.appReadyEvent.name,()=>{this.enabled?this.showSceneDebuggers():this.hideSceneDebuggers()}),this.appWcRef.addEventListener(this.appWcRef.eventsManager.sceneBoundsChanged.name,()=>{this.updateBox3HelperSize(this.appWcRef.sceneManager.currentSceneBounds)})}connectedCallback(){super.connectedCallback(),this.showSceneDebuggers()}disconnectedCallback(){this.hideSceneDebuggers(),super.disconnectedCallback()}render(){return Ee`<div class="debug-label">DEBUG MODE</div>`}}var RH=Object.defineProperty,mt=(o,e,t,i)=>{for(var a=void 0,l=o.length-1,u;l>=0;l--)(u=o[l])&&(a=u(e,t,a)||a);return a&&RH(e,t,a),a},Ta=(o=>(o.NONE="",o.SKU="sku",o.SHOPIFY_VARIANT_ID="shopify_variant_id",o.ASIN="asin",o.UPC="upc",o.EXPERIENCE_ID="experience_id",o.PRODUCT_VARIANT_UUID="product_variant_uuid",o))(Ta||{});const ht=class ou extends gI{constructor(){super(window.__APP_VERSION__,cu.DEVELOPMENT),this.epigraphWebsiteRedirectUrls={icon:"https://www.epigraph.us",modal:"https://www.epigraph.us"},this.sessionState="default",this.isAppReady=!1,this.sku=oi.sku.defaultValue.toString(),this.shopify_variant_id=oi.shopifyVariantId.defaultValue.toString(),this.upc=oi.upc.defaultValue.toString(),this.asin=oi.asin.defaultValue.toString(),this.experience_id=oi.experienceId.defaultValue.toString(),this.product_variant_uuid=oi.productVariantUuid.defaultValue.toString(),this.customVersionId="",this.gaMeasurementId="",this.isLoading=!0,this.apiMode="production",this.debug=!1,this.dimensionsUnit=oi.dimensionsUnit.defaultValue.toString(),this.dimensionsUnitSymbol=oi.dimensionsUnitSymbol.defaultValue.toString(),this.areDimensionsActive=!1,this.areHotspotsActive=!1,this.isHelpVisible=!1,this.baseUrlOverride=oi.baseUrlOverride.defaultValue.toString(),this.isPortraitOrientation=!1,this.didARAutoLaunch=!1,this.transparentBackground=!1,this.shadowIntensity=1,this.shadowSoftness=4,this.playInteractionPrompt=!1,this.featuresToEnable={viewer:!0,hotspots:!0,dimensions:!0,viewInYourSpace:!0,help:!0,sceneManager:!0},this._hasActiveHotspot=!1,this._isToolsetLargerThanTheLeftBottomQuadrant=!1,this._loadingProgress=0,this._loadTimeBegin=performance.now(),this._loggerContext="EPIGRAPH THREED CODE",this._epigraphAnalytics=new SI(null,null),this._identifier="",this._identifierType="",this._isDevEnv=!1,this._boundingSphereCenter=new se,this._loaders=new Cf,this._activeAnimations=new Map,this._animationFadeDurationInMiliseconds=1e3,this._isSceneInteractedWith=!1,this.__glbBlobUrl="",this.__usdzBlobUrl="",this.__hasSceneChanged=!1,this.__canvasSize={width:0,height:0}}static{this.webComponentName="epigraph-threed-core"}static setupWebComponent(){window.customElements.get(ou.webComponentName)||window.customElements.define(ou.webComponentName,ou)}static{this.styles=[ct`
|
|
8367
8367
|
:host {
|
|
8368
8368
|
all: initial;
|
|
8369
8369
|
display: flex;
|
|
@@ -8530,7 +8530,7 @@ void main() {
|
|
|
8530
8530
|
opacity: 0;
|
|
8531
8531
|
pointer-events: none;
|
|
8532
8532
|
}
|
|
8533
|
-
`]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}enterPickerState(){this.
|
|
8533
|
+
`]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}enterPickerState(){this.sessionState="hotspotPlacer",this.style.cursor="crosshair",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHotspots(),this.requestUpdate()}enterViewState(){this.sessionState="cameraUpdate",this.style.cursor="grab",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hotspotsManager.style.opacity="0.25",this.hideHotspots(),this.requestUpdate()}enterDefaultState(){this.sessionState="default",this.style.cursor="grab",this.hotspotsManager.style.opacity="1",this.showHotspots()}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().screenshot)}onLoadFailed(e,t){this._eventsManager.appFailedEvent.fire(t);const i=this.timeElapsedSinceLoadBegin,a=new ey(!0,i,e);this._epigraphAnalytics.sendEvent(a),this.showSplashScreen()}getFirstNonProxyFromIntersections(e){let t=null;for(const i of e)if(!(!i?.object||i.object.userData.isProxyMesh===!0)){t=i;break}return t}__getIntersectionsWithScene(e,t){const i=new o_,a=new He;return a.x=e/this.canvasSize.width*2-1,a.y=-(t/this.canvasSize.height)*2+1,i.setFromCamera(a,this.cameraManager.getCameras().main),i.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.rootEntity.children,!0)}getPositionOnMeshFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);if(i.length>0){const a=this.getFirstNonProxyFromIntersections(i);return a===null?null:a.point}else return null}getIntersectionOnProductFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);let a=null;if(i.length>0){const l=this.getFirstNonProxyFromIntersections(i);if(!l?.object)return null;l.object.traverseAncestors(u=>{if(u instanceof Va&&u.isRoot===!1){a={asset:{id:u.asset.id,name:u.asset.name},intersection:{point:l.point}};return}})}return a}getSceneSphericalBoundsForCameraFocus(){const e=this.sceneManager.currentSceneBounds;e.getCenter(this._boundingSphereCenter);const t=e.getBoundingSphere(new vn(this._boundingSphereCenter));if(this.dimensionsManager?.enabled){const i=this.canvasSize.height/this.canvasSize.width;t.radius+=i}return t}async getUsdzUrlForAr(){return this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl(),this.eventsManager.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl(),this.eventsManager.arModelReadyEvent.fire(this.__glbBlobUrl),this.__glbBlobUrl}async launchAR(){if(!this.isLoading)return await this.viewInYourSpaceManager.launchAR()}highlightEntityByAssetId(e){const t=this.sceneManager.sceneStructure.getEntityForAssetId(e);if(!t){window.epigraph.logger.error({title:`No asset found for ID: ${e}`});return}t.highlight()}unhighlightAllEntities(){for(const e of this.sceneManager.sceneStructure.getSceneEntities())e.unhighlight()}async spawnAssetInScene(e){const t=this.sceneManager.sceneStructure.getPossibleConnectionsForAssetInScene(e);if(t.length<=0)return Promise.resolve(void 0);const i=t[0];i.connect();const a=new Va(e);await a.initialize();const l=i.receiver,u=i.plug.clone();this.sceneManager.sceneStructure.add(u);const d=new se;l.getWorldPosition(d),u.position.set(d.x,d.y,d.z),u.attach(a);const p=new zi;return l.getWorldQuaternion(p),u.setRotationFromQuaternion(p),l.attach(a),u.removeFromParent(),wt.dispose3(u),this.eventsManager.structureChangedEvent.fire(),Promise.resolve(a)}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),this.cameraManager.fitCameraToSceneBounds()}hideDimensions(e=!1){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),e||this.cameraManager.fitCameraToSceneBounds()}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots"}),this.areHotspotsActive=!0,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots"}),this.areHotspotsActive=!1,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i=!1}){this.hotspotsManager.openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}async __onPlayInteractionPrompt(e=2){this.showCameraInteractionPromptIndicator(),await wt.wait(800);for(let t=0;t<e;t++)this.cameraInteractionPromptIndicatorElemRef.classList.add("play-wiggle-animation"),await this.cameraManager.wiggleCamera();this.cameraInteractionPromptIndicatorElemRef.classList.remove("play-wiggle-animation"),this.hideCameraInteractionPromptIndicator(),this._isSceneInteractedWith||setTimeout(()=>{this.__onPlayInteractionPrompt()},3e3)}getAllAnimations(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimations():[]}getAllAnimationNames(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimationNames():[]}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){if(!e)return;const u=this.getAllAnimationNames();if(!u.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:u});return}const d=u.indexOf(e),p=this.getAllAnimations()[d];return l?(p.timeScale=-1,p.fadeOut(this._animationFadeDurationInMiliseconds*.001)):(p.timeScale=1,p.fadeIn(this._animationFadeDurationInMiliseconds*.001)),p.setLoop(i?$a:xl,a),p.clampWhenFinished=t,p.enabled=!0,p.play(),this._activeAnimations.set(e,p),{animationName:e,targetAnimationAction:p}}stopAnimationByName(e){if(!e)return;const t=this.getAllAnimationNames();if(!t.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:t});return}const i=t.indexOf(e),a=this.getAllAnimations()[i];a.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{a.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e),this.renderEngine.accumulativeShadows?.isEnabled()&&this.renderEngine.accumulativeShadows.temporalUpdate(),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main),this.renderEngine.textRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new He,i=this.cameraManager.getCameras().main,a=this.renderEngine.canvas.clientWidth*.5,l=this.renderEngine.canvas.clientHeight*.5,d=e.clone().project(i);return t.x=(d.x+1)*a,t.y=-(d.y-1)*l,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?Ee`
|
|
8534
8534
|
<div id="appCanvasContainer" class="app-canvas-container">
|
|
8535
8535
|
<span id="cameraAimIndicator" class="camera-aim-indicator hide"></span>
|
|
8536
8536
|
</div>
|
|
@@ -8594,10 +8594,10 @@ void main() {
|
|
|
8594
8594
|
tooltip-placement=${this._isToolsetLargerThanTheLeftBottomQuadrant?"none":"top-center"}
|
|
8595
8595
|
@epgonclick=${this.__onHelpToolControlClick}
|
|
8596
8596
|
></epg-tool-control>
|
|
8597
|
-
`}_renderToolset(){return Ee`
|
|
8597
|
+
`}_renderToolset(){const e=this._hasActiveHotspot||this.sessionState!=="default";return Ee`
|
|
8598
8598
|
<epg-toolset
|
|
8599
8599
|
id="toolset"
|
|
8600
|
-
class="toolset ${
|
|
8600
|
+
class="toolset ${e?"hide":""}"
|
|
8601
8601
|
expand-orientation=${this._isToolsetLargerThanTheLeftBottomQuadrant?"vertical-reverse":"horizontal"}
|
|
8602
8602
|
?collapsible=${this._isToolsetLargerThanTheLeftBottomQuadrant}
|
|
8603
8603
|
?collapsed=${this._isToolsetLargerThanTheLeftBottomQuadrant}
|
|
@@ -8655,7 +8655,7 @@ void main() {
|
|
|
8655
8655
|
class="splash-screen"
|
|
8656
8656
|
current-progress=${this._loadingProgress}
|
|
8657
8657
|
></epg-loader-scene>
|
|
8658
|
-
`}async _resetSession(){this._autoGeneratedProxyMesh?.scale.set(1,1,1),this._autoGeneratedProxyMesh?.position.set(0,0,0),this._autoGeneratedProxyMesh?.updateMatrixWorld(),await this.renderEngine.emptyScene()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.eventsManager.sceneBoundsChanged.name,()=>{this.cameraManager.fitCameraToSceneBounds()}),this.addEventListener(this.eventsManager.structureNodeAddedEvent.name,()=>{this._onSceneHierarchyUpdate()}),this.addEventListener(this.eventsManager.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.eventsManager.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":this.
|
|
8658
|
+
`}async _resetSession(){this._autoGeneratedProxyMesh?.scale.set(1,1,1),this._autoGeneratedProxyMesh?.position.set(0,0,0),this._autoGeneratedProxyMesh?.updateMatrixWorld(),await this.renderEngine.emptyScene()}_setupEventListeners(){window.epigraph.logger.info({title:"Setting up event listeners for this app."}),this.addEventListener(this.eventsManager.sceneBoundsChanged.name,()=>{this.cameraManager.fitCameraToSceneBounds()}),this.addEventListener(this.eventsManager.structureNodeAddedEvent.name,()=>{this._onSceneHierarchyUpdate()}),this.addEventListener(this.eventsManager.dimensionsPositionChanged.name,this.__onDimensionsPositionChanged),this.addEventListener(this.eventsManager.cameraControlsStart.name,(e=>{switch(e.detail.type){case"rotate":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grabbing");break;case"pan":(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="move"),this.showCameraAim();break}this.hotspotsManager&&this.hotspotsManager.activeHotspot&&this.sessionState==="default"&&this.hotspotsManager.closeActiveHotspot()})),this.addEventListener(this.eventsManager.inputEnd.name,()=>{(this.sessionState==="default"||this.sessionState==="cameraUpdate")&&(this.style.cursor="grab"),this.hideCameraAim()}),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,()=>{this.hideDimensions(!0)}),this.addEventListener(this.eventsManager.assetLoadProgress.name,(e=>{this._loadingProgress=e.detail.progress})),this.addEventListener(this.eventsManager.hotspotOpenEvent.name,(e=>{this._hasActiveHotspot=!0,this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.eventsManager.hotspotNextEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.eventsManager.hotspotPreviousEvent.name,(e=>{this._resolveAnimationsOnHotspotEntry(e.detail.hotspot.animation)})),this.addEventListener(this.eventsManager.hotspotClosedEvent.name,(e=>{this._hasActiveHotspot=!1;const i=this.hotspotsManager.hotspots.get(e.detail.hotspotId)?.animation;if(i)for(const a of i){const l=a.loop,u=a.exit;l&&this.stopAnimationByName(l);let d;u?d=this.playAnimationByName({animationName:u}):d=this.playAnimationByName({animationName:a.entry,reverse:!0}),setTimeout(()=>{d?.targetAnimationAction.reset(),this._activeAnimations.delete(d?.animationName??"")},this._animationFadeDurationInMiliseconds)}})),this.appCanvasContainerElemRef.onpointerdown=e=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp(),this.eventsManager.inputStart.fire({event:e})},this.appCanvasContainerElemRef.onpointermove=e=>{this.eventsManager.inputMove.fire({event:e})},this.appCanvasContainerElemRef.onpointerup=e=>{this.eventsManager.inputEnd.fire({event:e})},this.appCanvasContainerElemRef.onpointerout=e=>{this.eventsManager.inputEnd.fire({event:e})},this.cameraManager.mainCameraControls.addEventListener("update",this._onCameraPositionUpdate.bind(this)),this.hotspotsManager?.addEventListener("pointerdown",()=>{this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hideHelp()})}_onCameraPositionUpdate(){this.dimensionsManager?.enabled&&this.dimensionsManager.repopulateDimensionIndicators(),this.hotspotsManager?.enabled&&this.hotspotsManager.recalculateHotspotPositions()}_setupAutoGeneratedProxyContainers(){const e=new Wn,t=new wi({color:65280,opacity:.5,transparent:!0});this._autoGeneratedProxyMesh=new ot(e,t)}setShadowIntensity(e){this.renderEngine?.contactShadows?.updateShadowIntensity(e)}setShadowSoftness(e){this.renderEngine?.contactShadows?.updateShadowSoftness(e)}async _setup(){window.epigraph.logger.table({title:"Setting up..."}),this._eventsManager=new xH(this),this._sceneManager=new FU(this),this._sceneManager.initialize(),await this._sceneManager.sceneStructure.setupRootEntity().catch(e=>{this.onLoadFailed(C0.SCENE_LOAD_ERROR,e)}),this._cameraManager=new rF({appWcRef:this}),this._cameraManager.initialize(),await this.setupRenderEngine(),await this._cameraManager.setup({mainRenderer:this.renderEngine.mainRenderer,screenshotRenderer:this.renderEngine.screenshotRenderer,cameraSettings:this.renderEngine.renderEngineSettings.camera}),this.renderEngine.accumulativeShadows&&(this.renderEngine.accumulativeShadows.camera=this.cameraManager.getCameras().main),this._setupAutoGeneratedProxyContainers(),this._setupEventListeners(),this.setShadowIntensity(this.shadowIntensity),this.setShadowSoftness(this.shadowSoftness)}_resolveAnimationsOnHotspotEntry(e){this.stopAllAnimations();for(const t of e)this._activeAnimations.get(t.entry)||this.playAnimationByName({animationName:t.entry,clampWhenFinished:!0}),setTimeout(()=>{this._activeAnimations.delete(t.entry),this._activeAnimations.get(t.loop)?.loop||this.playAnimationByName({animationName:t.loop,loop:!0})},this._animationFadeDurationInMiliseconds)}_renderDimensionsManager(){let e=$e;return this.featuresToEnable.dimensions&&(fF.setupWebComponent(),e=Ee`
|
|
8659
8659
|
<dimensions-manager
|
|
8660
8660
|
id="dimensionsManager"
|
|
8661
8661
|
.appWcRef=${this}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epigraph/solutions",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/epigraph-solutions.js",
|
|
6
6
|
"files": [
|
|
@@ -9,14 +9,13 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"component:create": "node ./npm-scripts/createNewUiComponent.js",
|
|
11
11
|
"dev": "vite --force",
|
|
12
|
-
"build": "cross-env NODE_ENV=production && tsc && vite build",
|
|
13
12
|
"build:ui-components": "cross-env NODE_ENV=production && tsc && vite build --config ui-components-vite.config.ts",
|
|
13
|
+
"build:epigraph-solutions": "cross-env NODE_ENV=production && tsc && vite build",
|
|
14
14
|
"build:epigraph-previewer": "cross-env NODE_ENV=production && tsc && vite build --config epigraph-previewer-vite.config.ts",
|
|
15
|
-
"build
|
|
15
|
+
"build": "npm run build:ui-components && npm run build:epigraph-solutions && npm run build:epigraph-previewer",
|
|
16
16
|
"chromatic": "cross-env NODE_ENV=production && npx chromatic --project-token=chpt_cb7e103f37516af",
|
|
17
17
|
"preview": "vite preview",
|
|
18
|
-
"prepublishOnly": "npm run build",
|
|
19
|
-
"test": "npm run build && vitest",
|
|
18
|
+
"prepublishOnly": "npm run build:epigraph-solutions",
|
|
20
19
|
"storybook": "storybook dev -p 6007",
|
|
21
20
|
"build-storybook": "storybook build",
|
|
22
21
|
"format": "tsc --noEmit && prettier . --write && eslint . --fix"
|