three-render-objects 1.29.4 → 1.29.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/three-render-objects.js +1834 -1577
- package/dist/three-render-objects.js.map +1 -1
- package/dist/three-render-objects.min.js +2 -2
- package/dist/three-render-objects.mjs +56 -56
- package/package.json +12 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
// Version 1.29.
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("three")):"function"==typeof define&&define.amd?define(["three"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).ThreeRenderObjects=t(e.THREE)}(this,(function(e){"use strict";function t(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||o(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){if(e){if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}!function(e,t){if({},"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");const a={type:"change"},s={type:"start"},c={type:"end"};class l extends e.EventDispatcher{constructor(t,n){super();const r=this,o=-1,i=0,l=1,u=2,h=3,p=4;this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:e.MOUSE.ROTATE,MIDDLE:e.MOUSE.DOLLY,RIGHT:e.MOUSE.PAN},this.target=new e.Vector3;const d=1e-6,f=new e.Vector3;let m=1,g=o,b=o,v=0,y=0,w=0;const E=new e.Vector3,S=new e.Vector2,_=new e.Vector2,k=new e.Vector3,j=new e.Vector2,x=new e.Vector2,P=new e.Vector2,C=new e.Vector2,T=[],O={};this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.up0=this.object.up.clone(),this.zoom0=this.object.zoom,this.handleResize=function(){const e=r.domElement.getBoundingClientRect(),t=r.domElement.ownerDocument.documentElement;r.screen.left=e.left+window.pageXOffset-t.clientLeft,r.screen.top=e.top+window.pageYOffset-t.clientTop,r.screen.width=e.width,r.screen.height=e.height};const M=function(){const t=new e.Vector2;return function(e,n){return t.set((e-r.screen.left)/r.screen.width,(n-r.screen.top)/r.screen.height),t}}(),R=function(){const t=new e.Vector2;return function(e,n){return t.set((e-.5*r.screen.width-r.screen.left)/(.5*r.screen.width),(r.screen.height+2*(r.screen.top-n))/r.screen.width),t}}();function L(e){!1!==r.enabled&&(0===T.length&&(r.domElement.setPointerCapture(e.pointerId),r.domElement.addEventListener("pointermove",I),r.domElement.addEventListener("pointerup",A)),function(e){T.push(e)}(e),"touch"===e.pointerType?function(e){if(1===(Y(e),T.length))g=h,_.copy(R(T[0].pageX,T[0].pageY)),S.copy(_);else{g=p;const e=T[0].pageX-T[1].pageX,t=T[0].pageY-T[1].pageY;y=v=Math.sqrt(e*e+t*t);const n=(T[0].pageX+T[1].pageX)/2,r=(T[0].pageY+T[1].pageY)/2;P.copy(M(n,r)),C.copy(P)}r.dispatchEvent(s)}(e):function(e){if(g===o)switch(e.button){case r.mouseButtons.LEFT:g=i;break;case r.mouseButtons.MIDDLE:g=l;break;case r.mouseButtons.RIGHT:g=u}const t=b!==o?b:g;t!==i||r.noRotate?t!==l||r.noZoom?t!==u||r.noPan||(P.copy(M(e.pageX,e.pageY)),C.copy(P)):(j.copy(M(e.pageX,e.pageY)),x.copy(j)):(_.copy(R(e.pageX,e.pageY)),S.copy(_));r.dispatchEvent(s)}(e))}function I(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){if(1===(Y(e),T.length))S.copy(_),_.copy(R(e.pageX,e.pageY));else{const t=function(e){const t=e.pointerId===T[0].pointerId?T[1]:T[0];return O[t.pointerId]}(e),n=e.pageX-t.x,r=e.pageY-t.y;y=Math.sqrt(n*n+r*r);const o=(e.pageX+t.x)/2,i=(e.pageY+t.y)/2;C.copy(M(o,i))}}(e):function(e){const t=b!==o?b:g;t!==i||r.noRotate?t!==l||r.noZoom?t!==u||r.noPan||C.copy(M(e.pageX,e.pageY)):x.copy(M(e.pageX,e.pageY)):(S.copy(_),_.copy(R(e.pageX,e.pageY)))}(e))}function A(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){switch(T.length){case 0:g=o;break;case 1:g=h,_.copy(R(e.pageX,e.pageY)),S.copy(_);break;case 2:g=p;for(let t=0;t<T.length;t++)if(T[t].pointerId!==e.pointerId){const e=O[T[t].pointerId];_.copy(R(e.x,e.y)),S.copy(_);break}}r.dispatchEvent(c)}(e):(g=o,r.dispatchEvent(c)),N(e),0===T.length&&(r.domElement.releasePointerCapture(e.pointerId),r.domElement.removeEventListener("pointermove",I),r.domElement.removeEventListener("pointerup",A)))}function D(e){N(e)}function z(e){!1!==r.enabled&&(window.removeEventListener("keydown",z),b===o&&(e.code!==r.keys[i]||r.noRotate?e.code!==r.keys[l]||r.noZoom?e.code!==r.keys[u]||r.noPan||(b=u):b=l:b=i))}function V(){!1!==r.enabled&&(b=o,window.addEventListener("keydown",z))}function F(e){if(!1!==r.enabled&&!0!==r.noZoom){switch(e.preventDefault(),e.deltaMode){case 2:j.y-=.025*e.deltaY;break;case 1:j.y-=.01*e.deltaY;break;default:j.y-=25e-5*e.deltaY}r.dispatchEvent(s),r.dispatchEvent(c)}}function U(e){!1!==r.enabled&&e.preventDefault()}function N(e){delete O[e.pointerId];for(let t=0;t<T.length;t++)if(T[t].pointerId==e.pointerId)return void T.splice(t,1)}function Y(t){let n=O[t.pointerId];void 0===n&&(n=new e.Vector2,O[t.pointerId]=n),n.set(t.pageX,t.pageY)}this.rotateCamera=function(){const t=new e.Vector3,n=new e.Quaternion,o=new e.Vector3,i=new e.Vector3,a=new e.Vector3,s=new e.Vector3;return function(){s.set(_.x-S.x,_.y-S.y,0);let e=s.length();e?(E.copy(r.object.position).sub(r.target),o.copy(E).normalize(),i.copy(r.object.up).normalize(),a.crossVectors(i,o).normalize(),i.setLength(_.y-S.y),a.setLength(_.x-S.x),s.copy(i.add(a)),t.crossVectors(s,E).normalize(),e*=r.rotateSpeed,n.setFromAxisAngle(t,e),E.applyQuaternion(n),r.object.up.applyQuaternion(n),k.copy(t),w=e):!r.staticMoving&&w&&(w*=Math.sqrt(1-r.dynamicDampingFactor),E.copy(r.object.position).sub(r.target),n.setFromAxisAngle(k,w),E.applyQuaternion(n),r.object.up.applyQuaternion(n)),S.copy(_)}}(),this.zoomCamera=function(){let t;g===p?(t=v/y,v=y,r.object.isPerspectiveCamera?E.multiplyScalar(t):r.object.isOrthographicCamera?(r.object.zoom=e.MathUtils.clamp(r.object.zoom/t,r.minZoom,r.maxZoom),m!==r.object.zoom&&r.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(t=1+(x.y-j.y)*r.zoomSpeed,1!==t&&t>0&&(r.object.isPerspectiveCamera?E.multiplyScalar(t):r.object.isOrthographicCamera?(r.object.zoom=e.MathUtils.clamp(r.object.zoom/t,r.minZoom,r.maxZoom),m!==r.object.zoom&&r.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),r.staticMoving?j.copy(x):j.y+=(x.y-j.y)*this.dynamicDampingFactor)},this.panCamera=function(){const t=new e.Vector2,n=new e.Vector3,o=new e.Vector3;return function(){if(t.copy(C).sub(P),t.lengthSq()){if(r.object.isOrthographicCamera){const e=(r.object.right-r.object.left)/r.object.zoom/r.domElement.clientWidth,n=(r.object.top-r.object.bottom)/r.object.zoom/r.domElement.clientWidth;t.x*=e,t.y*=n}t.multiplyScalar(E.length()*r.panSpeed),o.copy(E).cross(r.object.up).setLength(t.x),o.add(n.copy(r.object.up).setLength(t.y)),r.object.position.add(o),r.target.add(o),r.staticMoving?P.copy(C):P.add(t.subVectors(C,P).multiplyScalar(r.dynamicDampingFactor))}}}(),this.checkDistances=function(){r.noZoom&&r.noPan||(E.lengthSq()>r.maxDistance*r.maxDistance&&(r.object.position.addVectors(r.target,E.setLength(r.maxDistance)),j.copy(x)),E.lengthSq()<r.minDistance*r.minDistance&&(r.object.position.addVectors(r.target,E.setLength(r.minDistance)),j.copy(x)))},this.update=function(){E.subVectors(r.object.position,r.target),r.noRotate||r.rotateCamera(),r.noZoom||r.zoomCamera(),r.noPan||r.panCamera(),r.object.position.addVectors(r.target,E),r.object.isPerspectiveCamera?(r.checkDistances(),r.object.lookAt(r.target),f.distanceToSquared(r.object.position)>d&&(r.dispatchEvent(a),f.copy(r.object.position))):r.object.isOrthographicCamera?(r.object.lookAt(r.target),(f.distanceToSquared(r.object.position)>d||m!==r.object.zoom)&&(r.dispatchEvent(a),f.copy(r.object.position),m=r.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type")},this.reset=function(){g=o,b=o,r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.up.copy(r.up0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),E.subVectors(r.object.position,r.target),r.object.lookAt(r.target),r.dispatchEvent(a),f.copy(r.object.position),m=r.object.zoom},this.dispose=function(){r.domElement.removeEventListener("contextmenu",U),r.domElement.removeEventListener("pointerdown",L),r.domElement.removeEventListener("pointercancel",D),r.domElement.removeEventListener("wheel",F),r.domElement.removeEventListener("pointermove",I),r.domElement.removeEventListener("pointerup",A),window.removeEventListener("keydown",z),window.removeEventListener("keyup",V)},this.domElement.addEventListener("contextmenu",U),this.domElement.addEventListener("pointerdown",L),this.domElement.addEventListener("pointercancel",D),this.domElement.addEventListener("wheel",F,{passive:!1}),window.addEventListener("keydown",z),window.addEventListener("keyup",V),this.handleResize(),this.update()}}const u={type:"change"},h={type:"start"},p={type:"end"},d=new e.Ray,f=new e.Plane,m=Math.cos(70*e.MathUtils.DEG2RAD);class g extends e.EventDispatcher{constructor(t,n){super(),this.object=t,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new e.Vector3,this.cursor=new e.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:e.MOUSE.ROTATE,MIDDLE:e.MOUSE.DOLLY,RIGHT:e.MOUSE.PAN},this.touches={ONE:e.TOUCH.ROTATE,TWO:e.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this.getPolarAngle=function(){return s.phi},this.getAzimuthalAngle=function(){return s.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(e){e.addEventListener("keydown",ne),this._domElementKeyEvents=e},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",ne),this._domElementKeyEvents=null},this.saveState=function(){r.target0.copy(r.target),r.position0.copy(r.object.position),r.zoom0=r.object.zoom},this.reset=function(){r.target.copy(r.target0),r.object.position.copy(r.position0),r.object.zoom=r.zoom0,r.object.updateProjectionMatrix(),r.dispatchEvent(u),r.update(),i=o.NONE},this.update=function(){const n=new e.Vector3,h=(new e.Quaternion).setFromUnitVectors(t.up,new e.Vector3(0,1,0)),p=h.clone().invert(),b=new e.Vector3,v=new e.Quaternion,y=new e.Vector3,w=2*Math.PI;return function(E=null){const S=r.object.position;n.copy(S).sub(r.target),n.applyQuaternion(h),s.setFromVector3(n),r.autoRotate&&i===o.NONE&&L(function(e){return null!==e?2*Math.PI/60*r.autoRotateSpeed*e:2*Math.PI/60/60*r.autoRotateSpeed}(E)),r.enableDamping?(s.theta+=c.theta*r.dampingFactor,s.phi+=c.phi*r.dampingFactor):(s.theta+=c.theta,s.phi+=c.phi);let _=r.minAzimuthAngle,k=r.maxAzimuthAngle;isFinite(_)&&isFinite(k)&&(_<-Math.PI?_+=w:_>Math.PI&&(_-=w),k<-Math.PI?k+=w:k>Math.PI&&(k-=w),s.theta=_<=k?Math.max(_,Math.min(k,s.theta)):s.theta>(_+k)/2?Math.max(_,s.theta):Math.min(k,s.theta)),s.phi=Math.max(r.minPolarAngle,Math.min(r.maxPolarAngle,s.phi)),s.makeSafe(),!0===r.enableDamping?r.target.addScaledVector(g,r.dampingFactor):r.target.add(g),r.target.sub(r.cursor),r.target.clampLength(r.minTargetRadius,r.maxTargetRadius),r.target.add(r.cursor);let j=!1;if(r.zoomToCursor&&C||r.object.isOrthographicCamera)s.radius=N(s.radius);else{const e=s.radius;s.radius=N(s.radius*l),j=e!=s.radius}if(n.setFromSpherical(s),n.applyQuaternion(p),S.copy(r.target).add(n),r.object.lookAt(r.target),!0===r.enableDamping?(c.theta*=1-r.dampingFactor,c.phi*=1-r.dampingFactor,g.multiplyScalar(1-r.dampingFactor)):(c.set(0,0,0),g.set(0,0,0)),r.zoomToCursor&&C){let o=null;if(r.object.isPerspectiveCamera){const e=n.length();o=N(e*l);const t=e-o;r.object.position.addScaledVector(x,t),r.object.updateMatrixWorld(),j=!!t}else if(r.object.isOrthographicCamera){const t=new e.Vector3(P.x,P.y,0);t.unproject(r.object);const i=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/l)),r.object.updateProjectionMatrix(),j=i!==r.object.zoom;const a=new e.Vector3(P.x,P.y,0);a.unproject(r.object),r.object.position.sub(a).add(t),r.object.updateMatrixWorld(),o=n.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),r.zoomToCursor=!1;null!==o&&(this.screenSpacePanning?r.target.set(0,0,-1).transformDirection(r.object.matrix).multiplyScalar(o).add(r.object.position):(d.origin.copy(r.object.position),d.direction.set(0,0,-1).transformDirection(r.object.matrix),Math.abs(r.object.up.dot(d.direction))<m?t.lookAt(r.target):(f.setFromNormalAndCoplanarPoint(r.object.up,r.target),d.intersectPlane(f,r.target))))}else if(r.object.isOrthographicCamera){const e=r.object.zoom;r.object.zoom=Math.max(r.minZoom,Math.min(r.maxZoom,r.object.zoom/l)),e!==r.object.zoom&&(r.object.updateProjectionMatrix(),j=!0)}return l=1,C=!1,!!(j||b.distanceToSquared(r.object.position)>a||8*(1-v.dot(r.object.quaternion))>a||y.distanceToSquared(r.target)>a)&&(r.dispatchEvent(u),b.copy(r.object.position),v.copy(r.object.quaternion),y.copy(r.target),!0)}}(),this.dispose=function(){r.domElement.removeEventListener("contextmenu",oe),r.domElement.removeEventListener("pointerdown",G),r.domElement.removeEventListener("pointercancel",$),r.domElement.removeEventListener("wheel",J),r.domElement.removeEventListener("pointermove",W),r.domElement.removeEventListener("pointerup",$);r.domElement.getRootNode().removeEventListener("keydown",ee,{capture:!0}),null!==r._domElementKeyEvents&&(r._domElementKeyEvents.removeEventListener("keydown",ne),r._domElementKeyEvents=null)};const r=this,o={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let i=o.NONE;const a=1e-6,s=new e.Spherical,c=new e.Spherical;let l=1;const g=new e.Vector3,b=new e.Vector2,v=new e.Vector2,y=new e.Vector2,w=new e.Vector2,E=new e.Vector2,S=new e.Vector2,_=new e.Vector2,k=new e.Vector2,j=new e.Vector2,x=new e.Vector3,P=new e.Vector2;let C=!1;const T=[],O={};let M=!1;function R(e){const t=Math.abs(.01*e);return Math.pow(.95,r.zoomSpeed*t)}function L(e){c.theta-=e}function I(e){c.phi-=e}const A=function(){const t=new e.Vector3;return function(e,n){t.setFromMatrixColumn(n,0),t.multiplyScalar(-e),g.add(t)}}(),D=function(){const t=new e.Vector3;return function(e,n){!0===r.screenSpacePanning?t.setFromMatrixColumn(n,1):(t.setFromMatrixColumn(n,0),t.crossVectors(r.object.up,t)),t.multiplyScalar(e),g.add(t)}}(),z=function(){const t=new e.Vector3;return function(e,n){const o=r.domElement;if(r.object.isPerspectiveCamera){const i=r.object.position;t.copy(i).sub(r.target);let a=t.length();a*=Math.tan(r.object.fov/2*Math.PI/180),A(2*e*a/o.clientHeight,r.object.matrix),D(2*n*a/o.clientHeight,r.object.matrix)}else r.object.isOrthographicCamera?(A(e*(r.object.right-r.object.left)/r.object.zoom/o.clientWidth,r.object.matrix),D(n*(r.object.top-r.object.bottom)/r.object.zoom/o.clientHeight,r.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),r.enablePan=!1)}}();function V(e){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?l/=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function F(e){r.object.isPerspectiveCamera||r.object.isOrthographicCamera?l*=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),r.enableZoom=!1)}function U(e,t){if(!r.zoomToCursor)return;C=!0;const n=r.domElement.getBoundingClientRect(),o=e-n.left,i=t-n.top,a=n.width,s=n.height;P.x=o/a*2-1,P.y=-i/s*2+1,x.set(P.x,P.y,1).unproject(r.object).sub(r.object.position).normalize()}function N(e){return Math.max(r.minDistance,Math.min(r.maxDistance,e))}function Y(e){b.set(e.clientX,e.clientY)}function B(e){w.set(e.clientX,e.clientY)}function H(e){if(1===T.length)b.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);b.set(n,r)}}function K(e){if(1===T.length)w.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);w.set(n,r)}}function X(e){const t=ae(e),n=e.pageX-t.x,r=e.pageY-t.y,o=Math.sqrt(n*n+r*r);_.set(0,o)}function q(e){if(1==T.length)v.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);v.set(n,r)}y.subVectors(v,b).multiplyScalar(r.rotateSpeed);const t=r.domElement;L(2*Math.PI*y.x/t.clientHeight),I(2*Math.PI*y.y/t.clientHeight),b.copy(v)}function Z(e){if(1===T.length)E.set(e.pageX,e.pageY);else{const t=ae(e),n=.5*(e.pageX+t.x),r=.5*(e.pageY+t.y);E.set(n,r)}S.subVectors(E,w).multiplyScalar(r.panSpeed),z(S.x,S.y),w.copy(E)}function Q(e){const t=ae(e),n=e.pageX-t.x,o=e.pageY-t.y,i=Math.sqrt(n*n+o*o);k.set(0,i),j.set(0,Math.pow(k.y/_.y,r.zoomSpeed)),V(j.y),_.copy(k);U(.5*(e.pageX+t.x),.5*(e.pageY+t.y))}function G(t){!1!==r.enabled&&(0===T.length&&(r.domElement.setPointerCapture(t.pointerId),r.domElement.addEventListener("pointermove",W),r.domElement.addEventListener("pointerup",$)),function(e){for(let t=0;t<T.length;t++)if(T[t]==e.pointerId)return!0;return!1}(t)||(function(e){T.push(e.pointerId)}(t),"touch"===t.pointerType?re(t):function(t){let n;switch(t.button){case 0:n=r.mouseButtons.LEFT;break;case 1:n=r.mouseButtons.MIDDLE;break;case 2:n=r.mouseButtons.RIGHT;break;default:n=-1}switch(n){case e.MOUSE.DOLLY:if(!1===r.enableZoom)return;!function(e){U(e.clientX,e.clientX),_.set(e.clientX,e.clientY)}(t),i=o.DOLLY;break;case e.MOUSE.ROTATE:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===r.enablePan)return;B(t),i=o.PAN}else{if(!1===r.enableRotate)return;Y(t),i=o.ROTATE}break;case e.MOUSE.PAN:if(t.ctrlKey||t.metaKey||t.shiftKey){if(!1===r.enableRotate)return;Y(t),i=o.ROTATE}else{if(!1===r.enablePan)return;B(t),i=o.PAN}break;default:i=o.NONE}i!==o.NONE&&r.dispatchEvent(h)}(t)))}function W(e){!1!==r.enabled&&("touch"===e.pointerType?function(e){switch(ie(e),i){case o.TOUCH_ROTATE:if(!1===r.enableRotate)return;q(e),r.update();break;case o.TOUCH_PAN:if(!1===r.enablePan)return;Z(e),r.update();break;case o.TOUCH_DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){r.enableZoom&&Q(e),r.enablePan&&Z(e)}(e),r.update();break;case o.TOUCH_DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;!function(e){r.enableZoom&&Q(e),r.enableRotate&&q(e)}(e),r.update();break;default:i=o.NONE}}(e):function(e){switch(i){case o.ROTATE:if(!1===r.enableRotate)return;!function(e){v.set(e.clientX,e.clientY),y.subVectors(v,b).multiplyScalar(r.rotateSpeed);const t=r.domElement;L(2*Math.PI*y.x/t.clientHeight),I(2*Math.PI*y.y/t.clientHeight),b.copy(v),r.update()}(e);break;case o.DOLLY:if(!1===r.enableZoom)return;!function(e){k.set(e.clientX,e.clientY),j.subVectors(k,_),j.y>0?V(R(j.y)):j.y<0&&F(R(j.y)),_.copy(k),r.update()}(e);break;case o.PAN:if(!1===r.enablePan)return;!function(e){E.set(e.clientX,e.clientY),S.subVectors(E,w).multiplyScalar(r.panSpeed),z(S.x,S.y),w.copy(E),r.update()}(e)}}(e))}function $(e){switch(function(e){delete O[e.pointerId];for(let t=0;t<T.length;t++)if(T[t]==e.pointerId)return void T.splice(t,1)}(e),T.length){case 0:r.domElement.releasePointerCapture(e.pointerId),r.domElement.removeEventListener("pointermove",W),r.domElement.removeEventListener("pointerup",$),r.dispatchEvent(p),i=o.NONE;break;case 1:const t=T[0],n=O[t];re({pointerId:t,pageX:n.x,pageY:n.y})}}function J(e){!1!==r.enabled&&!1!==r.enableZoom&&i===o.NONE&&(e.preventDefault(),r.dispatchEvent(h),function(e){U(e.clientX,e.clientY),e.deltaY<0?F(R(e.deltaY)):e.deltaY>0&&V(R(e.deltaY)),r.update()}(function(e){const t=e.deltaMode,n={clientX:e.clientX,clientY:e.clientY,deltaY:e.deltaY};switch(t){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}e.ctrlKey&&!M&&(n.deltaY*=10);return n}(e)),r.dispatchEvent(p))}function ee(e){if("Control"===e.key){M=!0;r.domElement.getRootNode().addEventListener("keyup",te,{passive:!0,capture:!0})}}function te(e){if("Control"===e.key){M=!1;r.domElement.getRootNode().removeEventListener("keyup",te,{passive:!0,capture:!0})}}function ne(e){!1!==r.enabled&&!1!==r.enablePan&&function(e){let t=!1;switch(e.code){case r.keys.UP:e.ctrlKey||e.metaKey||e.shiftKey?I(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):z(0,r.keyPanSpeed),t=!0;break;case r.keys.BOTTOM:e.ctrlKey||e.metaKey||e.shiftKey?I(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):z(0,-r.keyPanSpeed),t=!0;break;case r.keys.LEFT:e.ctrlKey||e.metaKey||e.shiftKey?L(2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):z(r.keyPanSpeed,0),t=!0;break;case r.keys.RIGHT:e.ctrlKey||e.metaKey||e.shiftKey?L(-2*Math.PI*r.rotateSpeed/r.domElement.clientHeight):z(-r.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),r.update())}(e)}function re(t){switch(ie(t),T.length){case 1:switch(r.touches.ONE){case e.TOUCH.ROTATE:if(!1===r.enableRotate)return;H(t),i=o.TOUCH_ROTATE;break;case e.TOUCH.PAN:if(!1===r.enablePan)return;K(t),i=o.TOUCH_PAN;break;default:i=o.NONE}break;case 2:switch(r.touches.TWO){case e.TOUCH.DOLLY_PAN:if(!1===r.enableZoom&&!1===r.enablePan)return;!function(e){r.enableZoom&&X(e),r.enablePan&&K(e)}(t),i=o.TOUCH_DOLLY_PAN;break;case e.TOUCH.DOLLY_ROTATE:if(!1===r.enableZoom&&!1===r.enableRotate)return;!function(e){r.enableZoom&&X(e),r.enableRotate&&H(e)}(t),i=o.TOUCH_DOLLY_ROTATE;break;default:i=o.NONE}break;default:i=o.NONE}i!==o.NONE&&r.dispatchEvent(h)}function oe(e){!1!==r.enabled&&e.preventDefault()}function ie(t){let n=O[t.pointerId];void 0===n&&(n=new e.Vector2,O[t.pointerId]=n),n.set(t.pageX,t.pageY)}function ae(e){const t=e.pointerId===T[0]?T[1]:T[0];return O[t]}r.domElement.addEventListener("contextmenu",oe),r.domElement.addEventListener("pointerdown",G),r.domElement.addEventListener("pointercancel",$),r.domElement.addEventListener("wheel",J,{passive:!1});r.domElement.getRootNode().addEventListener("keydown",ee,{passive:!0,capture:!0}),this.update()}}const b={type:"change"};class v extends e.EventDispatcher{constructor(t,n){super(),this.object=t,this.domElement=n,this.enabled=!0,this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1;const r=this,o=1e-6,i=new e.Quaternion,a=new e.Vector3;this.tmpQuaternion=new e.Quaternion,this.status=0,this.moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this.moveVector=new e.Vector3(0,0,0),this.rotationVector=new e.Vector3(0,0,0),this.keydown=function(e){if(!e.altKey&&!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this.moveState.forward=1;break;case"KeyS":this.moveState.back=1;break;case"KeyA":this.moveState.left=1;break;case"KeyD":this.moveState.right=1;break;case"KeyR":this.moveState.up=1;break;case"KeyF":this.moveState.down=1;break;case"ArrowUp":this.moveState.pitchUp=1;break;case"ArrowDown":this.moveState.pitchDown=1;break;case"ArrowLeft":this.moveState.yawLeft=1;break;case"ArrowRight":this.moveState.yawRight=1;break;case"KeyQ":this.moveState.rollLeft=1;break;case"KeyE":this.moveState.rollRight=1}this.updateMovementVector(),this.updateRotationVector()}},this.keyup=function(e){if(!1!==this.enabled){switch(e.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this.moveState.forward=0;break;case"KeyS":this.moveState.back=0;break;case"KeyA":this.moveState.left=0;break;case"KeyD":this.moveState.right=0;break;case"KeyR":this.moveState.up=0;break;case"KeyF":this.moveState.down=0;break;case"ArrowUp":this.moveState.pitchUp=0;break;case"ArrowDown":this.moveState.pitchDown=0;break;case"ArrowLeft":this.moveState.yawLeft=0;break;case"ArrowRight":this.moveState.yawRight=0;break;case"KeyQ":this.moveState.rollLeft=0;break;case"KeyE":this.moveState.rollRight=0}this.updateMovementVector(),this.updateRotationVector()}},this.pointerdown=function(e){if(!1!==this.enabled)if(this.dragToLook)this.status++;else{switch(e.button){case 0:this.moveState.forward=1;break;case 2:this.moveState.back=1}this.updateMovementVector()}},this.pointermove=function(e){if(!1!==this.enabled&&(!this.dragToLook||this.status>0)){const t=this.getContainerDimensions(),n=t.size[0]/2,r=t.size[1]/2;this.moveState.yawLeft=-(e.pageX-t.offset[0]-n)/n,this.moveState.pitchDown=(e.pageY-t.offset[1]-r)/r,this.updateRotationVector()}},this.pointerup=function(e){if(!1!==this.enabled){if(this.dragToLook)this.status--,this.moveState.yawLeft=this.moveState.pitchDown=0;else{switch(e.button){case 0:this.moveState.forward=0;break;case 2:this.moveState.back=0}this.updateMovementVector()}this.updateRotationVector()}},this.pointercancel=function(){!1!==this.enabled&&(this.dragToLook?(this.status=0,this.moveState.yawLeft=this.moveState.pitchDown=0):(this.moveState.forward=0,this.moveState.back=0,this.updateMovementVector()),this.updateRotationVector())},this.contextMenu=function(e){!1!==this.enabled&&e.preventDefault()},this.update=function(e){if(!1===this.enabled)return;const t=e*r.movementSpeed,n=e*r.rollSpeed;r.object.translateX(r.moveVector.x*t),r.object.translateY(r.moveVector.y*t),r.object.translateZ(r.moveVector.z*t),r.tmpQuaternion.set(r.rotationVector.x*n,r.rotationVector.y*n,r.rotationVector.z*n,1).normalize(),r.object.quaternion.multiply(r.tmpQuaternion),(a.distanceToSquared(r.object.position)>o||8*(1-i.dot(r.object.quaternion))>o)&&(r.dispatchEvent(b),i.copy(r.object.quaternion),a.copy(r.object.position))},this.updateMovementVector=function(){const e=this.moveState.forward||this.autoForward&&!this.moveState.back?1:0;this.moveVector.x=-this.moveState.left+this.moveState.right,this.moveVector.y=-this.moveState.down+this.moveState.up,this.moveVector.z=-e+this.moveState.back},this.updateRotationVector=function(){this.rotationVector.x=-this.moveState.pitchDown+this.moveState.pitchUp,this.rotationVector.y=-this.moveState.yawRight+this.moveState.yawLeft,this.rotationVector.z=-this.moveState.rollRight+this.moveState.rollLeft},this.getContainerDimensions=function(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}},this.dispose=function(){this.domElement.removeEventListener("contextmenu",s),this.domElement.removeEventListener("pointerdown",l),this.domElement.removeEventListener("pointermove",c),this.domElement.removeEventListener("pointerup",u),this.domElement.removeEventListener("pointercancel",h),window.removeEventListener("keydown",p),window.removeEventListener("keyup",d)};const s=this.contextMenu.bind(this),c=this.pointermove.bind(this),l=this.pointerdown.bind(this),u=this.pointerup.bind(this),h=this.pointercancel.bind(this),p=this.keydown.bind(this),d=this.keyup.bind(this);this.domElement.addEventListener("contextmenu",s),this.domElement.addEventListener("pointerdown",l),this.domElement.addEventListener("pointermove",c),this.domElement.addEventListener("pointerup",u),this.domElement.addEventListener("pointercancel",h),window.addEventListener("keydown",p),window.addEventListener("keyup",d),this.updateMovementVector(),this.updateRotationVector()}}const y={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class w{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const E=new e.OrthographicCamera(-1,1,1,-1,0,1);class S extends e.BufferGeometry{constructor(){super(),this.setAttribute("position",new e.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new e.Float32BufferAttribute([0,2,0,0,2,0],2))}}const _=new S;class k{constructor(t){this._mesh=new e.Mesh(_,t)}dispose(){this._mesh.geometry.dispose()}render(e){e.render(this._mesh,E)}get material(){return this._mesh.material}set material(e){this._mesh.material=e}}class j extends w{constructor(t,n){super(),this.textureID=void 0!==n?n:"tDiffuse",t instanceof e.ShaderMaterial?(this.uniforms=t.uniforms,this.material=t):t&&(this.uniforms=e.UniformsUtils.clone(t.uniforms),this.material=new e.ShaderMaterial({name:void 0!==t.name?t.name:"unspecified",defines:Object.assign({},t.defines),uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader})),this.fsQuad=new k(this.material)}render(e,t,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(e.setRenderTarget(null),this.fsQuad.render(e)):(e.setRenderTarget(t),this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),this.fsQuad.render(e))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class x extends w{constructor(e,t){super(),this.scene=e,this.camera=t,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(e,t,n){const r=e.getContext(),o=e.state;let i,a;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(i=0,a=1):(i=1,a=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.buffers.stencil.setFunc(r.ALWAYS,i,4294967295),o.buffers.stencil.setClear(a),o.buffers.stencil.setLocked(!0),e.setRenderTarget(n),this.clear&&e.clear(),e.render(this.scene,this.camera),e.setRenderTarget(t),this.clear&&e.clear(),e.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.color.setMask(!0),o.buffers.depth.setMask(!0),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(r.EQUAL,1,4294967295),o.buffers.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.buffers.stencil.setLocked(!0)}}class P extends w{constructor(){super(),this.needsSwap=!1}render(e){e.state.buffers.stencil.setLocked(!1),e.state.buffers.stencil.setTest(!1)}}class C{constructor(t,n){if(this.renderer=t,this._pixelRatio=t.getPixelRatio(),void 0===n){const r=t.getSize(new e.Vector2);this._width=r.width,this._height=r.height,(n=new e.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:e.HalfFloatType})).texture.name="EffectComposer.rt1"}else this._width=n.width,this._height=n.height;this.renderTarget1=n,this.renderTarget2=n.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new j(y),this.copyPass.material.blending=e.NoBlending,this.clock=new e.Clock}swapBuffers(){const e=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=e}addPass(e){this.passes.push(e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(e,t){this.passes.splice(t,0,e),e.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(e){const t=this.passes.indexOf(e);-1!==t&&this.passes.splice(t,1)}isLastEnabledPass(e){for(let t=e+1;t<this.passes.length;t++)if(this.passes[t].enabled)return!1;return!0}render(e){void 0===e&&(e=this.clock.getDelta());const t=this.renderer.getRenderTarget();let n=!1;for(let t=0,r=this.passes.length;t<r;t++){const r=this.passes[t];if(!1!==r.enabled){if(r.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(t),r.render(this.renderer,this.writeBuffer,this.readBuffer,e,n),r.needsSwap){if(n){const t=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(t.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,e),n.setFunc(t.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==x&&(r instanceof x?n=!0:r instanceof P&&(n=!1))}}this.renderer.setRenderTarget(t)}reset(t){if(void 0===t){const n=this.renderer.getSize(new e.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=n.width,this._height=n.height,(t=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(e,t){this._width=e,this._height=t;const n=this._width*this._pixelRatio,r=this._height*this._pixelRatio;this.renderTarget1.setSize(n,r),this.renderTarget2.setSize(n,r);for(let e=0;e<this.passes.length;e++)this.passes[e].setSize(n,r)}setPixelRatio(e){this._pixelRatio=e,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class T extends w{constructor(t,n,r=null,o=null,i=null){super(),this.scene=t,this.camera=n,this.overrideMaterial=r,this.clearColor=o,this.clearAlpha=i,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new e.Color}render(e,t,n){const r=e.autoClear;let o,i;e.autoClear=!1,null!==this.overrideMaterial&&(i=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(e.getClearColor(this._oldClearColor),e.setClearColor(this.clearColor)),null!==this.clearAlpha&&(o=e.getClearAlpha(),e.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&e.clearDepth(),e.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&e.clear(e.autoClearColor,e.autoClearDepth,e.autoClearStencil),e.render(this.scene,this.camera),null!==this.clearColor&&e.setClearColor(this._oldClearColor),null!==this.clearAlpha&&e.setClearAlpha(o),null!==this.overrideMaterial&&(this.scene.overrideMaterial=i),e.autoClear=r}}function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(this,arguments)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function R(e){return R=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},R(e)}function L(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(L=function(){return!!e})()}function I(e){var t="function"==typeof Map?new Map:void 0;return I=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(L())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&M(o,n.prototype),o}(e,arguments,R(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),M(n,e)},I(e)}var A={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r,o=t[0],i=[];for(r=1;r<t.length;r+=1)i.push(t[r]);return i.forEach((function(e){o=o.replace(/%[a-z]/,e)})),o}var z=function(e){var t,n;function r(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];n=e.call(this,D.apply(void 0,[A[t]].concat(o)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,M(t,n),r}(I(Error));function V(e){return Math.round(255*e)}function F(e,t,n){return V(e)+","+V(t)+","+V(n)}function U(e,t,n,r){if(void 0===r&&(r=F),0===t)return r(n,n,n);var o=(e%360+360)%360/60,i=(1-Math.abs(2*n-1))*t,a=i*(1-Math.abs(o%2-1)),s=0,c=0,l=0;o>=0&&o<1?(s=i,c=a):o>=1&&o<2?(s=a,c=i):o>=2&&o<3?(c=i,l=a):o>=3&&o<4?(c=a,l=i):o>=4&&o<5?(s=a,l=i):o>=5&&o<6&&(s=i,l=a);var u=n-i/2;return r(s+u,c+u,l+u)}var N={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Y=/^#[a-fA-F0-9]{6}$/,B=/^#[a-fA-F0-9]{8}$/,H=/^#[a-fA-F0-9]{3}$/,K=/^#[a-fA-F0-9]{4}$/,X=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,q=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,Z=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,Q=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function G(e){if("string"!=typeof e)throw new z(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return N[t]?"#"+N[t]:e}(e);if(t.match(Y))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(B)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(H))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(K)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var o=X.exec(t);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var i=q.exec(t.substring(0,50));if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])>1?parseFloat(""+i[4])/100:parseFloat(""+i[4])};var a=Z.exec(t);if(a){var s="rgb("+U(parseInt(""+a[1],10),parseInt(""+a[2],10)/100,parseInt(""+a[3],10)/100)+")",c=X.exec(s);if(!c)throw new z(4,t,s);return{red:parseInt(""+c[1],10),green:parseInt(""+c[2],10),blue:parseInt(""+c[3],10)}}var l=Q.exec(t.substring(0,50));if(l){var u="rgb("+U(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",h=X.exec(u);if(!h)throw new z(4,t,u);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new z(5)}function W(e){return function(e){var t,n=e.red/255,r=e.green/255,o=e.blue/255,i=Math.max(n,r,o),a=Math.min(n,r,o),s=(i+a)/2;if(i===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=i-a,l=s>.5?c/(2-i-a):c/(i+a);switch(i){case n:t=(r-o)/c+(r<o?6:0);break;case r:t=(o-n)/c+2;break;default:t=(n-r)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}}(G(e))}var $=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e};function J(e){var t=e.toString(16);return 1===t.length?"0"+t:t}function ee(e){return J(Math.round(255*e))}function te(e,t,n){return $("#"+ee(e)+ee(t)+ee(n))}function ne(e,t,n){return U(e,t,n,te)}function re(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return $("#"+J(e)+J(t)+J(n));if("object"==typeof e&&void 0===t&&void 0===n)return $("#"+J(e.red)+J(e.green)+J(e.blue));throw new z(6)}function oe(e,t,n,r){if("string"==typeof e&&"number"==typeof t){var o=G(e);return"rgba("+o.red+","+o.green+","+o.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return"rgba("+e+","+t+","+n+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?re(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new z(7)}var ie=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},ae=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},se=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},ce=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};function le(e){if("object"!=typeof e)throw new z(8);if(ae(e))return oe(e);if(ie(e))return re(e);if(ce(e))return function(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return"rgba("+U(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?ne(e.hue,e.saturation,e.lightness):"rgba("+U(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new z(2)}(e);if(se(e))return function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return ne(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return ne(e.hue,e.saturation,e.lightness);throw new z(1)}(e);throw new z(8)}function ue(e,t,n){return function(){var r=n.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):ue(e,t,r)}}function he(e){return ue(e,e.length,[])}function pe(e,t,n){return Math.max(e,Math.min(t,n))}he((function(e,t){if("transparent"===t)return t;var n=W(t);return le(O({},n,{hue:n.hue+parseFloat(e)}))})),he((function(e,t){if("transparent"===t)return t;var n=W(t);return le(O({},n,{lightness:pe(0,1,n.lightness-parseFloat(e))}))})),he((function(e,t){if("transparent"===t)return t;var n=W(t);return le(O({},n,{saturation:pe(0,1,n.saturation-parseFloat(e))}))})),he((function(e,t){if("transparent"===t)return t;var n=W(t);return le(O({},n,{lightness:pe(0,1,n.lightness+parseFloat(e))}))}));var de=he((function(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;if(0===e)return n;var r=G(t),o=O({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),i=G(n),a=O({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=o.alpha-a.alpha,c=2*parseFloat(e)-1,l=((c*s==-1?c:c+s)/(1+c*s)+1)/2,u=1-l;return oe({red:Math.floor(o.red*l+a.red*u),green:Math.floor(o.green*l+a.green*u),blue:Math.floor(o.blue*l+a.blue*u),alpha:o.alpha*parseFloat(e)+a.alpha*(1-parseFloat(e))})}));var fe=he((function(e,t){if("transparent"===t)return t;var n=G(t);return oe(O({},n,{alpha:pe(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(e))/100)}))}));he((function(e,t){if("transparent"===t)return t;var n=W(t);return le(O({},n,{saturation:pe(0,1,n.saturation+parseFloat(e))}))})),he((function(e,t){return"transparent"===t?t:le(O({},W(t),{hue:parseFloat(e)}))})),he((function(e,t){return"transparent"===t?t:le(O({},W(t),{lightness:parseFloat(e)}))})),he((function(e,t){return"transparent"===t?t:le(O({},W(t),{saturation:parseFloat(e)}))})),he((function(e,t){return"transparent"===t?t:de(parseFloat(e),"rgb(0, 0, 0)",t)})),he((function(e,t){return"transparent"===t?t:de(parseFloat(e),"rgb(255, 255, 255)",t)})),he((function(e,t){if("transparent"===t)return t;var n=G(t);return oe(O({},n,{alpha:pe(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e)).toFixed(2)/100)}))}));var me,ge=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return this.None(e)},Out:function(e){return this.None(e)},InOut:function(e){return this.None(e)}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return 0===e?0:1===e?1:-Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)},Out:function(e){return 0===e?0:1===e?1:Math.pow(2,-10*e)*Math.sin(5*(e-.1)*Math.PI)+1},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?-.5*Math.pow(2,10*(e-1))*Math.sin(5*(e-1.1)*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin(5*(e-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(e){var t=1.70158;return 1===e?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return 0===e?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-ge.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*ge.Bounce.In(2*e):.5*ge.Bounce.Out(2*e-1)+.5}}),generatePow:function(e){return void 0===e&&(e=4),e=(e=e<Number.EPSILON?Number.EPSILON:e)>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(2*t,e)/2:(1-Math.pow(2-2*t,e))/2+.5}}}}),be=function(){return performance.now()},ve=function(){function e(){this._tweens={},this._tweensAddedDuringUpdate={}}return e.prototype.getAll=function(){var e=this;return Object.keys(this._tweens).map((function(t){return e._tweens[t]}))},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(e){this._tweens[e.getId()]=e,this._tweensAddedDuringUpdate[e.getId()]=e},e.prototype.remove=function(e){delete this._tweens[e.getId()],delete this._tweensAddedDuringUpdate[e.getId()]},e.prototype.update=function(e,t){void 0===e&&(e=be()),void 0===t&&(t=!1);var n=Object.keys(this._tweens);if(0===n.length)return!1;for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<n.length;r++){var o=this._tweens[n[r]],i=!t;o&&!1===o.update(e,i)&&!t&&delete this._tweens[n[r]]}n=Object.keys(this._tweensAddedDuringUpdate)}return!0},e}(),ye={Linear:function(e,t){var n=e.length-1,r=n*t,o=Math.floor(r),i=ye.Utils.Linear;return t<0?i(e[0],e[1],r):t>1?i(e[n],e[n-1],n-r):i(e[o],e[o+1>n?n:o+1],r-o)},Bezier:function(e,t){for(var n=0,r=e.length-1,o=Math.pow,i=ye.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-t,r-a)*o(t,a)*e[a]*i(r,a);return n},CatmullRom:function(e,t){var n=e.length-1,r=n*t,o=Math.floor(r),i=ye.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(r=n*(1+t))),i(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],r-o)):t<0?e[0]-(i(e[0],e[0],e[1],e[1],-r)-e[0]):t>1?e[n]-(i(e[n],e[n],e[n-1],e[n-1],r-n)-e[n]):i(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],r-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=ye.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(me=[1],function(e){var t=1;if(me[e])return me[e];for(var n=e;n>1;n--)t*=n;return me[e]=t,t}),CatmullRom:function(e,t,n,r,o){var i=.5*(n-e),a=.5*(r-t),s=o*o;return(2*t-2*n+i+a)*(o*s)+(-3*t+3*n-2*i-a)*s+i*o+t}}},we=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),Ee=new ve,Se=function(){function e(e,t){void 0===t&&(t=Ee),this._object=e,this._group=t,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ge.Linear.None,this._interpolationFunction=ye.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=we.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(e,t){if(void 0===t&&(t=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=e,this._propertiesAreSetUp=!1,this._duration=t<0?0:t,this},e.prototype.duration=function(e){return void 0===e&&(e=1e3),this._duration=e<0?0:e,this},e.prototype.dynamic=function(e){return void 0===e&&(e=!1),this._isDynamic=e,this},e.prototype.start=function(e,t){if(void 0===e&&(e=be()),void 0===t&&(t=!1),this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=e,this._startTime+=this._delayTime,!this._propertiesAreSetUp||t){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,t)}return this},e.prototype.startFromCurrentValues=function(e){return this.start(e,!0)},e.prototype._setupProperties=function(e,t,n,r,o){for(var i in n){var a=e[i],s=Array.isArray(a),c=s?"array":typeof a,l=!s&&Array.isArray(n[i]);if("undefined"!==c&&"function"!==c){if(l){if(0===(g=n[i]).length)continue;for(var u=[a],h=0,p=g.length;h<p;h+=1){var d=this._handleRelativeValue(a,g[h]);if(isNaN(d)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}u.push(d)}l&&(n[i]=u)}if("object"!==c&&!s||!a||l)(void 0===t[i]||o)&&(t[i]=a),s||(t[i]*=1),r[i]=l?n[i].slice().reverse():t[i]||0;else{t[i]=s?[]:{};var f=a;for(var m in f)t[i][m]=f[m];r[i]=s?[]:{};var g=n[i];if(!this._isDynamic){var b={};for(var m in g)b[m]=g[m];n[i]=g=b}this._setupProperties(f,t[i],g,r[i],o)}}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},e.prototype.pause=function(e){return void 0===e&&(e=be()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=e,this._group&&this._group.remove(this)),this},e.prototype.resume=function(e){return void 0===e&&(e=be()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=e-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this):this},e.prototype.stopChainedTweens=function(){for(var e=0,t=this._chainedTweens.length;e<t;e++)this._chainedTweens[e].stop();return this},e.prototype.group=function(e){return void 0===e&&(e=Ee),this._group=e,this},e.prototype.delay=function(e){return void 0===e&&(e=0),this._delayTime=e,this},e.prototype.repeat=function(e){return void 0===e&&(e=0),this._initialRepeat=e,this._repeat=e,this},e.prototype.repeatDelay=function(e){return this._repeatDelayTime=e,this},e.prototype.yoyo=function(e){return void 0===e&&(e=!1),this._yoyo=e,this},e.prototype.easing=function(e){return void 0===e&&(e=ge.Linear.None),this._easingFunction=e,this},e.prototype.interpolation=function(e){return void 0===e&&(e=ye.Linear),this._interpolationFunction=e,this},e.prototype.chain=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._chainedTweens=e,this},e.prototype.onStart=function(e){return this._onStartCallback=e,this},e.prototype.onEveryStart=function(e){return this._onEveryStartCallback=e,this},e.prototype.onUpdate=function(e){return this._onUpdateCallback=e,this},e.prototype.onRepeat=function(e){return this._onRepeatCallback=e,this},e.prototype.onComplete=function(e){return this._onCompleteCallback=e,this},e.prototype.onStop=function(e){return this._onStopCallback=e,this},e.prototype.update=function(e,t){var n,r,o=this;if(void 0===e&&(e=be()),void 0===t&&(t=!0),this._isPaused)return!0;var i=this._startTime+this._duration;if(!this._goToEnd&&!this._isPlaying){if(e>i)return!1;t&&this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var a=e-this._startTime,s=this._duration+(null!==(n=this._repeatDelayTime)&&void 0!==n?n:this._delayTime),c=this._duration+this._repeat*s,l=function(){if(0===o._duration)return 1;if(a>c)return 1;var e=Math.trunc(a/s),t=a-e*s,n=Math.min(t/o._duration,1);return 0===n&&a===o._duration?1:n}(),u=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,u),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||a>=this._duration){if(this._repeat>0){var h=Math.min(Math.trunc((a-this._duration)/s)+1,this._repeat);for(r in isFinite(this._repeat)&&(this._repeat-=h),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[r]||(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=s*h,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,d=this._chainedTweens.length;p<d;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(e,t,n,r){for(var o in n)if(void 0!==t[o]){var i=t[o]||0,a=n[o],s=Array.isArray(e[o]),c=Array.isArray(a);!s&&c?e[o]=this._interpolationFunction(a,r):"object"==typeof a&&a?this._updateProperties(e[o],i,a,r):"number"==typeof(a=this._handleRelativeValue(i,a))&&(e[o]=i+(a-i)*r)}},e.prototype._handleRelativeValue=function(e,t){return"string"!=typeof t?t:"+"===t.charAt(0)||"-"===t.charAt(0)?e+parseFloat(t):parseFloat(t)},e.prototype._swapEndStartRepeatValues=function(e){var t=this._valuesStartRepeat[e],n=this._valuesEnd[e];this._valuesStartRepeat[e]="string"==typeof n?this._valuesStartRepeat[e]+parseFloat(n):this._valuesEnd[e],this._valuesEnd[e]=t},e}(),_e=Ee;_e.getAll.bind(_e),_e.removeAll.bind(_e),_e.add.bind(_e),_e.remove.bind(_e);var ke=_e.update.bind(_e);function je(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var xe="object"==typeof global&&global&&global.Object===Object&&global,Pe="object"==typeof self&&self&&self.Object===Object&&self,Ce=xe||Pe||Function("return this")(),Te=function(){return Ce.Date.now()},Oe=/\s/;var Me=/^\s+/;function Re(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Oe.test(e.charAt(t)););return t}(e)+1).replace(Me,""):e}var Le=Ce.Symbol,Ie=Object.prototype,Ae=Ie.hasOwnProperty,De=Ie.toString,ze=Le?Le.toStringTag:void 0;var Ve=Object.prototype.toString;var Fe="[object Null]",Ue="[object Undefined]",Ne=Le?Le.toStringTag:void 0;function Ye(e){return null==e?void 0===e?Ue:Fe:Ne&&Ne in Object(e)?function(e){var t=Ae.call(e,ze),n=e[ze];try{e[ze]=void 0;var r=!0}catch(e){}var o=De.call(e);return r&&(t?e[ze]=n:delete e[ze]),o}(e):function(e){return Ve.call(e)}(e)}var Be="[object Symbol]";var He=NaN,Ke=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,qe=/^0o[0-7]+$/i,Ze=parseInt;function Qe(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&Ye(e)==Be}(e))return He;if(je(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=je(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Re(e);var n=Xe.test(e);return n||qe.test(e)?Ze(e.slice(2),n?2:8):Ke.test(e)?He:+e}var Ge="Expected a function",We=Math.max,$e=Math.min;function Je(e,t,n){var r,o,i,a,s,c,l=0,u=!1,h=!1,p=!0;if("function"!=typeof e)throw new TypeError(Ge);function d(t){var n=r,i=o;return r=o=void 0,l=t,a=e.apply(i,n)}function f(e){var n=e-c;return void 0===c||n>=t||n<0||h&&e-l>=i}function m(){var e=Te();if(f(e))return g(e);s=setTimeout(m,function(e){var n=t-(e-c);return h?$e(n,i-(e-l)):n}(e))}function g(e){return s=void 0,p&&r?d(e):(r=o=void 0,a)}function b(){var e=Te(),n=f(e);if(r=arguments,o=this,c=e,n){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),u?d(e):a}(c);if(h)return clearTimeout(s),s=setTimeout(m,t),d(c)}return void 0===s&&(s=setTimeout(m,t)),a}return t=Qe(t)||0,je(n)&&(u=!!n.leading,i=(h="maxWait"in n)?We(Qe(n.maxWait)||0,t):i,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==s&&clearTimeout(s),l=0,r=c=o=s=void 0},b.flush=function(){return void 0===s?a:g(Te())},b}function et(e,t,n){return Object.defineProperty(e,"prototype",{writable:!1}),e}function tt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t);else for(;!(c=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return nt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nt(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nt(e,t){t>e.length&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var rt=et((function e(t,n){var r=n.default,o=void 0===r?null:r,i=n.triggerUpdate,a=void 0===i||i,s=n.onChange,c=void 0===s?function(e,t){}:s;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name=t,this.defaultVal=o,this.triggerUpdate=a,this.onChange=c}));var ot,it,at,st,ct,lt,ut,ht,pt,dt,ft,mt,gt,bt,vt=window.THREE?window.THREE:{WebGLRenderer:e.WebGLRenderer,Scene:e.Scene,PerspectiveCamera:e.PerspectiveCamera,Raycaster:e.Raycaster,SRGBColorSpace:e.SRGBColorSpace,TextureLoader:e.TextureLoader,Vector2:e.Vector2,Vector3:e.Vector3,Box3:e.Box3,Color:e.Color,Mesh:e.Mesh,SphereGeometry:e.SphereGeometry,MeshBasicMaterial:e.MeshBasicMaterial,BackSide:e.BackSide,EventDispatcher:e.EventDispatcher,MOUSE:e.MOUSE,Quaternion:e.Quaternion,Spherical:e.Spherical,Clock:e.Clock},yt=(ot={props:{width:{default:window.innerWidth,onChange:function(e,t,n){isNaN(e)&&(t.width=n)}},height:{default:window.innerHeight,onChange:function(e,t,n){isNaN(e)&&(t.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(e,t){t.hoverObj=null,t.toolTipElem&&(t.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(e){if(e.initialised){if(e.controls.update&&e.controls.update(Math.min(1,e.clock.getDelta())),e.postProcessingComposer?e.postProcessingComposer.render():e.renderer.render(e.scene,e.camera),e.extraRenderers.forEach((function(t){return t.render(e.scene,e.camera)})),e.enablePointerInteraction){var t=null;if(e.hoverDuringDrag||!e.isPointerDragging){var n=this.intersectingObjects(e.pointerPos.x,e.pointerPos.y).filter((function(t){return e.hoverFilter(t.object)})).sort((function(t,n){return e.hoverOrderComparator(t.object,n.object)})),r=n.length?n[0]:null;t=r?r.object:null,e.intersectionPoint=r?r.point:null}t!==e.hoverObj&&(e.onHover(t,e.hoverObj),e.toolTipElem.innerHTML=t&&("function"==typeof(o=e.tooltipContent)?o:"string"==typeof o?function(e){return e[o]}:function(e){return o})(t)||"",e.hoverObj=t)}ke()}var o;return this},getPointerPos:function(e){var t=e.pointerPos;return{x:t.x,y:t.y}},cameraPosition:function(e,t,n,r){var o=e.camera;if(t&&e.initialised){var i=t,a=n||{x:0,y:0,z:0};if(r){var s=Object.assign({},o.position),c=h();new Se(s).to(i,r).easing(ge.Quadratic.Out).onUpdate(l).start(),new Se(c).to(a,r/3).easing(ge.Quadratic.Out).onUpdate(u).start()}else l(i),u(a);return this}return Object.assign({},o.position,{lookAt:h()});function l(e){var t=e.x,n=e.y,r=e.z;void 0!==t&&(o.position.x=t),void 0!==n&&(o.position.y=n),void 0!==r&&(o.position.z=r)}function u(t){var n=new vt.Vector3(t.x,t.y,t.z);e.controls.target?e.controls.target=n:o.lookAt(n)}function h(){return Object.assign(new vt.Vector3(0,0,-1e3).applyQuaternion(o.quaternion).add(o.position))}},zoomToFit:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length,o=new Array(r>3?r-3:0),i=3;i<r;i++)o[i-3]=arguments[i];return this.fitToBbox(this.getBbox.apply(this,o),t,n)},fitToBbox:function(e,t){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,a=e.camera;if(t){var s=new vt.Vector3(0,0,0),c=2*Math.max.apply(Math,r(Object.entries(t).map((function(e){var t=n(e,2),o=t[0],i=t[1];return Math.max.apply(Math,r(i.map((function(e){return Math.abs(s[o]-e)}))))})))),l=(1-2*i/e.height)*a.fov,u=c/Math.atan(l*Math.PI/180),h=u/a.aspect,p=Math.max(u,h);if(p>0){var d=s.clone().sub(a.position).normalize().multiplyScalar(-p);this.cameraPosition(d,s,o)}}return this},getBbox:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},o=new vt.Box3(new vt.Vector3(0,0,0),new vt.Vector3(0,0,0)),i=e.objects.filter(n);return i.length?(i.forEach((function(e){return o.expandByObject(e)})),Object.assign.apply(Object,r(["x","y","z"].map((function(e){return n={},r=e,i=[o.min[e],o.max[e]],(r=t(r))in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,n;var n,r,i}))))):null},getScreenCoords:function(e,t,n,r){var o=new vt.Vector3(t,n,r);return o.project(this.camera()),{x:(o.x+1)*e.width/2,y:-(o.y-1)*e.height/2}},getSceneCoords:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=new vt.Vector2(t/e.width*2-1,-n/e.height*2+1),i=new vt.Raycaster;return i.setFromCamera(o,e.camera),Object.assign({},i.ray.at(r,new vt.Vector3))},intersectingObjects:function(e,t,n){var r=new vt.Vector2(t/e.width*2-1,-n/e.height*2+1),o=new vt.Raycaster;return o.params.Line.threshold=e.lineHoverPrecision,o.setFromCamera(r,e.camera),o.intersectObjects(e.objects,!0)},renderer:function(e){return e.renderer},scene:function(e){return e.scene},camera:function(e){return e.camera},postProcessingComposer:function(e){return e.postProcessingComposer},controls:function(e){return e.controls},tbControls:function(e){return e.controls}},stateInit:function(){return{scene:new vt.Scene,camera:new vt.PerspectiveCamera,clock:new vt.Clock}},init:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=n.controlType,i=void 0===o?"trackball":o,a=n.rendererConfig,s=void 0===a?{}:a,c=n.extraRenderers,u=void 0===c?[]:c,h=n.waitForLoadComplete,p=void 0===h||h;e.innerHTML="",e.appendChild(t.container=document.createElement("div")),t.container.className="scene-container",t.container.style.position="relative",t.container.appendChild(t.navInfo=document.createElement("div")),t.navInfo.className="scene-nav-info",t.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[i]||"",t.navInfo.style.display=t.showNavInfo?null:"none",t.toolTipElem=document.createElement("div"),t.toolTipElem.classList.add("scene-tooltip"),t.container.appendChild(t.toolTipElem),t.pointerPos=new vt.Vector2,t.pointerPos.x=-2,t.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(e){return t.container.addEventListener(e,(function(n){if("pointerdown"===e&&(t.isPointerPressed=!0),!t.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||t.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(e){return Math.abs(e)>1})))&&(t.isPointerDragging=!0),t.enablePointerInteraction){var r=(o=t.container,i=o.getBoundingClientRect(),a=window.pageXOffset||document.documentElement.scrollLeft,s=window.pageYOffset||document.documentElement.scrollTop,{top:i.top+s,left:i.left+a});t.pointerPos.x=n.pageX-r.left,t.pointerPos.y=n.pageY-r.top,t.toolTipElem.style.top="".concat(t.pointerPos.y,"px"),t.toolTipElem.style.left="".concat(t.pointerPos.x,"px"),t.toolTipElem.style.transform="translate(-".concat(t.pointerPos.x/t.width*100,"%, ").concat(t.height-t.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var o,i,a,s}),{passive:!0})})),t.container.addEventListener("pointerup",(function(e){t.isPointerPressed=!1,t.isPointerDragging&&(t.isPointerDragging=!1,!t.clickAfterDrag)||requestAnimationFrame((function(){0===e.button&&t.onClick(t.hoverObj||null,e,t.intersectionPoint),2===e.button&&t.onRightClick&&t.onRightClick(t.hoverObj||null,e,t.intersectionPoint)}))}),{passive:!0,capture:!0}),t.container.addEventListener("contextmenu",(function(e){t.onRightClick&&e.preventDefault()})),t.renderer=new vt.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},s)),t.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),t.container.appendChild(t.renderer.domElement),t.extraRenderers=u,t.extraRenderers.forEach((function(e){e.domElement.style.position="absolute",e.domElement.style.top="0px",e.domElement.style.pointerEvents="none",t.container.appendChild(e.domElement)})),t.postProcessingComposer=new C(t.renderer),t.postProcessingComposer.addPass(new T(t.scene,t.camera)),t.controls=new{trackball:l,orbit:g,fly:v}[i](t.camera,t.renderer.domElement),"fly"===i&&(t.controls.movementSpeed=300,t.controls.rollSpeed=Math.PI/6,t.controls.dragToLook=!0),"trackball"!==i&&"orbit"!==i||(t.controls.minDistance=.1,t.controls.maxDistance=t.skyRadius,t.controls.addEventListener("start",(function(){t.controlsEngaged=!0})),t.controls.addEventListener("change",(function(){t.controlsEngaged&&(t.controlsDragging=!0)})),t.controls.addEventListener("end",(function(){t.controlsEngaged=!1,t.controlsDragging=!1}))),[t.renderer,t.postProcessingComposer].concat(r(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix(),t.camera.position.z=1e3,t.scene.add(t.skysphere=new vt.Mesh),t.skysphere.visible=!1,t.loadComplete=t.scene.visible=!p,window.scene=t.scene},update:function(e,t){if(e.width&&e.height&&(t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(e.container.style.width="".concat(e.width,"px"),e.container.style.height="".concat(e.height,"px"),[e.renderer,e.postProcessingComposer].concat(r(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix()),t.hasOwnProperty("skyRadius")&&e.skyRadius&&(e.controls.hasOwnProperty("maxDistance")&&t.skyRadius&&(e.controls.maxDistance=Math.min(e.controls.maxDistance,e.skyRadius)),e.camera.far=2.5*e.skyRadius,e.camera.updateProjectionMatrix(),e.skysphere.geometry=new vt.SphereGeometry(e.skyRadius)),t.hasOwnProperty("backgroundColor")){var n=G(e.backgroundColor).alpha;void 0===n&&(n=1),e.renderer.setClearColor(new vt.Color(fe(1,e.backgroundColor)),n)}function o(){e.loadComplete=e.scene.visible=!0}t.hasOwnProperty("backgroundImageUrl")&&(e.backgroundImageUrl?(new vt.TextureLoader).load(e.backgroundImageUrl,(function(t){t.colorSpace=vt.SRGBColorSpace,e.skysphere.material=new vt.MeshBasicMaterial({map:t,side:vt.BackSide}),e.skysphere.visible=!0,e.onBackgroundImageLoaded&&setTimeout(e.onBackgroundImageLoaded),!e.loadComplete&&o()})):(e.skysphere.visible=!1,e.skysphere.material.map=null,!e.loadComplete&&o())),t.hasOwnProperty("showNavInfo")&&(e.navInfo.style.display=e.showNavInfo?null:"none"),t.hasOwnProperty("lights")&&((t.lights||[]).forEach((function(t){return e.scene.remove(t)})),e.lights.forEach((function(t){return e.scene.add(t)}))),t.hasOwnProperty("objects")&&((t.objects||[]).forEach((function(t){return e.scene.remove(t)})),e.objects.forEach((function(t){return e.scene.add(t)})))}},it=ot.stateInit,at=void 0===it?function(){return{}}:it,st=ot.props,ct=void 0===st?{}:st,lt=ot.methods,ut=void 0===lt?{}:lt,ht=ot.aliases,pt=void 0===ht?{}:ht,dt=ot.init,ft=void 0===dt?function(){}:dt,mt=ot.update,gt=void 0===mt?function(){}:mt,bt=Object.keys(ct).map((function(e){return new rt(e,ct[e])})),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Object.assign({},at instanceof Function?at(e):at,{initialised:!1}),n={};function r(t){return o(t,e),i(),r}var o=function(e,n){ft.call(r,e,t,n),t.initialised=!0},i=Je((function(){t.initialised&&(gt.call(r,t,n),n={})}),1);return bt.forEach((function(e){r[e.name]=function(e){var o=e.name,a=e.triggerUpdate,s=void 0!==a&&a,c=e.onChange,l=void 0===c?function(e,t){}:c,u=e.defaultVal,h=void 0===u?null:u;return function(e){var a=t[o];if(!arguments.length)return a;var c=void 0===e?h:e;return t[o]=c,l.call(r,c,t,a),!n.hasOwnProperty(o)&&(n[o]=a),s&&i(),r}}(e)})),Object.keys(ut).forEach((function(e){r[e]=function(){for(var n,o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return(n=ut[e]).call.apply(n,[r,t].concat(i))}})),Object.entries(pt).forEach((function(e){var t=tt(e,2),n=t[0],o=t[1];return r[n]=r[o]})),r.resetProps=function(){return bt.forEach((function(e){r[e.name](e.defaultVal)})),r},r.resetProps(),t._rerender=i,r});return yt}));
|
|
1
|
+
// Version 1.29.5 three-render-objects - https://github.com/vasturiano/three-render-objects
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("three")):"function"==typeof define&&define.amd?define(["three"],e):(t="undefined"!=typeof globalThis?globalThis:t||self).ThreeRenderObjects=e(t.THREE)}(this,(function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function n(t,e,n){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,s,r,a=[],h=!0,l=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(h=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);h=!0);}catch(t){l=!0,o=t}finally{try{if(!h&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(l)throw o}}return a}}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||s(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t,n){if(t){if("string"==typeof t)return e(t,n);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?e(t,n):void 0}}!function(t,e){void 0===e&&(e={});var n=e.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&i.firstChild?i.insertBefore(o,i.firstChild):i.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}(".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n user-select: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}");const r={type:"change"},a={type:"start"},h={type:"end"},l=1e-6,c=-1,u=0,p=1,d=2,f=3,m=4,_=new t.Vector2,g=new t.Vector2,v=new t.Vector3,b=new t.Vector3,y=new t.Vector3,w=new t.Quaternion,S=new t.Vector3,E=new t.Vector3,P=new t.Vector3,k=new t.Vector3;class C extends t.Controls{constructor(e,n=null){super(e,n),this.enabled=!0,this.screen={left:0,top:0,width:0,height:0},this.rotateSpeed=1,this.zoomSpeed=1.2,this.panSpeed=.3,this.noRotate=!1,this.noZoom=!1,this.noPan=!1,this.staticMoving=!1,this.dynamicDampingFactor=.2,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.keys=["KeyA","KeyS","KeyD"],this.mouseButtons={LEFT:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.state=c,this.keyState=c,this.target=new t.Vector3,this._lastPosition=new t.Vector3,this._lastZoom=1,this._touchZoomDistanceStart=0,this._touchZoomDistanceEnd=0,this._lastAngle=0,this._eye=new t.Vector3,this._movePrev=new t.Vector2,this._moveCurr=new t.Vector2,this._lastAxis=new t.Vector3,this._zoomStart=new t.Vector2,this._zoomEnd=new t.Vector2,this._panStart=new t.Vector2,this._panEnd=new t.Vector2,this._pointers=[],this._pointerPositions={},this._onPointerMove=x.bind(this),this._onPointerDown=M.bind(this),this._onPointerUp=j.bind(this),this._onPointerCancel=T.bind(this),this._onContextMenu=z.bind(this),this._onMouseWheel=A.bind(this),this._onKeyDown=O.bind(this),this._onKeyUp=D.bind(this),this._onTouchStart=F.bind(this),this._onTouchMove=U.bind(this),this._onTouchEnd=V.bind(this),this._onMouseDown=R.bind(this),this._onMouseMove=L.bind(this),this._onMouseUp=I.bind(this),this._target0=this.target.clone(),this._position0=this.object.position.clone(),this._up0=this.object.up.clone(),this._zoom0=this.object.zoom,null!==n&&(this.connect(),this.handleResize()),this.update()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="none"}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}handleResize(){const t=this.domElement.getBoundingClientRect(),e=this.domElement.ownerDocument.documentElement;this.screen.left=t.left+window.pageXOffset-e.clientLeft,this.screen.top=t.top+window.pageYOffset-e.clientTop,this.screen.width=t.width,this.screen.height=t.height}update(){this._eye.subVectors(this.object.position,this.target),this.noRotate||this._rotateCamera(),this.noZoom||this._zoomCamera(),this.noPan||this._panCamera(),this.object.position.addVectors(this.target,this._eye),this.object.isPerspectiveCamera?(this._checkDistances(),this.object.lookAt(this.target),this._lastPosition.distanceToSquared(this.object.position)>l&&(this.dispatchEvent(r),this._lastPosition.copy(this.object.position))):this.object.isOrthographicCamera?(this.object.lookAt(this.target),(this._lastPosition.distanceToSquared(this.object.position)>l||this._lastZoom!==this.object.zoom)&&(this.dispatchEvent(r),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom)):console.warn("THREE.TrackballControls: Unsupported camera type.")}reset(){this.state=c,this.keyState=c,this.target.copy(this._target0),this.object.position.copy(this._position0),this.object.up.copy(this._up0),this.object.zoom=this._zoom0,this.object.updateProjectionMatrix(),this._eye.subVectors(this.object.position,this.target),this.object.lookAt(this.target),this.dispatchEvent(r),this._lastPosition.copy(this.object.position),this._lastZoom=this.object.zoom}_panCamera(){if(g.copy(this._panEnd).sub(this._panStart),g.lengthSq()){if(this.object.isOrthographicCamera){const t=(this.object.right-this.object.left)/this.object.zoom/this.domElement.clientWidth,e=(this.object.top-this.object.bottom)/this.object.zoom/this.domElement.clientWidth;g.x*=t,g.y*=e}g.multiplyScalar(this._eye.length()*this.panSpeed),b.copy(this._eye).cross(this.object.up).setLength(g.x),b.add(v.copy(this.object.up).setLength(g.y)),this.object.position.add(b),this.target.add(b),this.staticMoving?this._panStart.copy(this._panEnd):this._panStart.add(g.subVectors(this._panEnd,this._panStart).multiplyScalar(this.dynamicDampingFactor))}}_rotateCamera(){k.set(this._moveCurr.x-this._movePrev.x,this._moveCurr.y-this._movePrev.y,0);let t=k.length();t?(this._eye.copy(this.object.position).sub(this.target),S.copy(this._eye).normalize(),E.copy(this.object.up).normalize(),P.crossVectors(E,S).normalize(),E.setLength(this._moveCurr.y-this._movePrev.y),P.setLength(this._moveCurr.x-this._movePrev.x),k.copy(E.add(P)),y.crossVectors(k,this._eye).normalize(),t*=this.rotateSpeed,w.setFromAxisAngle(y,t),this._eye.applyQuaternion(w),this.object.up.applyQuaternion(w),this._lastAxis.copy(y),this._lastAngle=t):!this.staticMoving&&this._lastAngle&&(this._lastAngle*=Math.sqrt(1-this.dynamicDampingFactor),this._eye.copy(this.object.position).sub(this.target),w.setFromAxisAngle(this._lastAxis,this._lastAngle),this._eye.applyQuaternion(w),this.object.up.applyQuaternion(w)),this._movePrev.copy(this._moveCurr)}_zoomCamera(){let e;this.state===m?(e=this._touchZoomDistanceStart/this._touchZoomDistanceEnd,this._touchZoomDistanceStart=this._touchZoomDistanceEnd,this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=t.MathUtils.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")):(e=1+(this._zoomEnd.y-this._zoomStart.y)*this.zoomSpeed,1!==e&&e>0&&(this.object.isPerspectiveCamera?this._eye.multiplyScalar(e):this.object.isOrthographicCamera?(this.object.zoom=t.MathUtils.clamp(this.object.zoom/e,this.minZoom,this.maxZoom),this._lastZoom!==this.object.zoom&&this.object.updateProjectionMatrix()):console.warn("THREE.TrackballControls: Unsupported camera type")),this.staticMoving?this._zoomStart.copy(this._zoomEnd):this._zoomStart.y+=(this._zoomEnd.y-this._zoomStart.y)*this.dynamicDampingFactor)}_getMouseOnScreen(t,e){return _.set((t-this.screen.left)/this.screen.width,(e-this.screen.top)/this.screen.height),_}_getMouseOnCircle(t,e){return _.set((t-.5*this.screen.width-this.screen.left)/(.5*this.screen.width),(this.screen.height+2*(this.screen.top-e))/this.screen.width),_}_addPointer(t){this._pointers.push(t)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId==t.pointerId)return void this._pointers.splice(e,1)}_trackPointer(e){let n=this._pointerPositions[e.pointerId];void 0===n&&(n=new t.Vector2,this._pointerPositions[e.pointerId]=n),n.set(e.pageX,e.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0].pointerId?this._pointers[1]:this._pointers[0];return this._pointerPositions[e.pointerId]}_checkDistances(){this.noZoom&&this.noPan||(this._eye.lengthSq()>this.maxDistance*this.maxDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.maxDistance)),this._zoomStart.copy(this._zoomEnd)),this._eye.lengthSq()<this.minDistance*this.minDistance&&(this.object.position.addVectors(this.target,this._eye.setLength(this.minDistance)),this._zoomStart.copy(this._zoomEnd)))}}function M(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t))}function x(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function j(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchEnd(t):this._onMouseUp(),this._removePointer(t),0===this._pointers.length&&(this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp)))}function T(t){this._removePointer(t)}function D(){!1!==this.enabled&&(this.keyState=c,window.addEventListener("keydown",this._onKeyDown))}function O(t){!1!==this.enabled&&(window.removeEventListener("keydown",this._onKeyDown),this.keyState===c&&(t.code!==this.keys[u]||this.noRotate?t.code!==this.keys[p]||this.noZoom?t.code!==this.keys[d]||this.noPan||(this.keyState=d):this.keyState=p:this.keyState=u))}function R(t){if(this.state===c)switch(t.button){case this.mouseButtons.LEFT:this.state=u;break;case this.mouseButtons.MIDDLE:this.state=p;break;case this.mouseButtons.RIGHT:this.state=d}const e=this.keyState!==c?this.keyState:this.state;e!==u||this.noRotate?e!==p||this.noZoom?e!==d||this.noPan||(this._panStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._panEnd.copy(this._panStart)):(this._zoomStart.copy(this._getMouseOnScreen(t.pageX,t.pageY)),this._zoomEnd.copy(this._zoomStart)):(this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr)),this.dispatchEvent(a)}function L(t){const e=this.keyState!==c?this.keyState:this.state;e!==u||this.noRotate?e!==p||this.noZoom?e!==d||this.noPan||this._panEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):this._zoomEnd.copy(this._getMouseOnScreen(t.pageX,t.pageY)):(this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)))}function I(){this.state=c,this.dispatchEvent(h)}function A(t){if(!1!==this.enabled&&!0!==this.noZoom){switch(t.preventDefault(),t.deltaMode){case 2:this._zoomStart.y-=.025*t.deltaY;break;case 1:this._zoomStart.y-=.01*t.deltaY;break;default:this._zoomStart.y-=25e-5*t.deltaY}this.dispatchEvent(a),this.dispatchEvent(h)}}function z(t){!1!==this.enabled&&t.preventDefault()}function F(t){if(this._trackPointer(t),1===this._pointers.length)this.state=f,this._moveCurr.copy(this._getMouseOnCircle(this._pointers[0].pageX,this._pointers[0].pageY)),this._movePrev.copy(this._moveCurr);else{this.state=m;const t=this._pointers[0].pageX-this._pointers[1].pageX,e=this._pointers[0].pageY-this._pointers[1].pageY;this._touchZoomDistanceEnd=this._touchZoomDistanceStart=Math.sqrt(t*t+e*e);const n=(this._pointers[0].pageX+this._pointers[1].pageX)/2,i=(this._pointers[0].pageY+this._pointers[1].pageY)/2;this._panStart.copy(this._getMouseOnScreen(n,i)),this._panEnd.copy(this._panStart)}this.dispatchEvent(a)}function U(t){if(this._trackPointer(t),1===this._pointers.length)this._movePrev.copy(this._moveCurr),this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY));else{const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y;this._touchZoomDistanceEnd=Math.sqrt(n*n+i*i);const o=(t.pageX+e.x)/2,s=(t.pageY+e.y)/2;this._panEnd.copy(this._getMouseOnScreen(o,s))}}function V(t){switch(this._pointers.length){case 0:this.state=c;break;case 1:this.state=f,this._moveCurr.copy(this._getMouseOnCircle(t.pageX,t.pageY)),this._movePrev.copy(this._moveCurr);break;case 2:this.state=m;for(let e=0;e<this._pointers.length;e++)if(this._pointers[e].pointerId!==t.pointerId){const t=this._pointerPositions[this._pointers[e].pointerId];this._moveCurr.copy(this._getMouseOnCircle(t.x,t.y)),this._movePrev.copy(this._moveCurr);break}}this.dispatchEvent(h)}const K={type:"change"},Y={type:"start"},B={type:"end"},Z=new t.Ray,N=new t.Plane,X=Math.cos(70*t.MathUtils.DEG2RAD),H=new t.Vector3,q=2*Math.PI,Q=-1,W=0,G=1,$=2,J=3,tt=4,et=5,nt=6,it=1e-6;class ot extends t.Controls{constructor(e,n=null){super(e,n),this.state=Q,this.enabled=!0,this.target=new t.Vector3,this.cursor=new t.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:t.MOUSE.ROTATE,MIDDLE:t.MOUSE.DOLLY,RIGHT:t.MOUSE.PAN},this.touches={ONE:t.TOUCH.ROTATE,TWO:t.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new t.Vector3,this._lastQuaternion=new t.Quaternion,this._lastTargetPosition=new t.Vector3,this._quat=(new t.Quaternion).setFromUnitVectors(e.up,new t.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new t.Spherical,this._sphericalDelta=new t.Spherical,this._scale=1,this._panOffset=new t.Vector3,this._rotateStart=new t.Vector2,this._rotateEnd=new t.Vector2,this._rotateDelta=new t.Vector2,this._panStart=new t.Vector2,this._panEnd=new t.Vector2,this._panDelta=new t.Vector2,this._dollyStart=new t.Vector2,this._dollyEnd=new t.Vector2,this._dollyDelta=new t.Vector2,this._dollyDirection=new t.Vector3,this._mouse=new t.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=rt.bind(this),this._onPointerDown=st.bind(this),this._onPointerUp=at.bind(this),this._onContextMenu=ft.bind(this),this._onMouseWheel=ct.bind(this),this._onKeyDown=ut.bind(this),this._onTouchStart=pt.bind(this),this._onTouchMove=dt.bind(this),this._onMouseDown=ht.bind(this),this._onMouseMove=lt.bind(this),this._interceptControlDown=mt.bind(this),this._interceptControlUp=_t.bind(this),null!==this.domElement&&this.connect(),this.update()}connect(){this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1});this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents();this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){null!==this._domElementKeyEvents&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(K),this.update(),this.state=Q}update(e=null){const n=this.object.position;H.copy(n).sub(this.target),H.applyQuaternion(this._quat),this._spherical.setFromVector3(H),this.autoRotate&&this.state===Q&&this._rotateLeft(this._getAutoRotationAngle(e)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let i=this.minAzimuthAngle,o=this.maxAzimuthAngle;isFinite(i)&&isFinite(o)&&(i<-Math.PI?i+=q:i>Math.PI&&(i-=q),o<-Math.PI?o+=q:o>Math.PI&&(o-=q),this._spherical.theta=i<=o?Math.max(i,Math.min(o,this._spherical.theta)):this._spherical.theta>(i+o)/2?Math.max(i,this._spherical.theta):Math.min(o,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),!0===this.enableDamping?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let s=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const t=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),s=t!=this._spherical.radius}if(H.setFromSpherical(this._spherical),H.applyQuaternion(this._quatInverse),n.copy(this.target).add(H),this.object.lookAt(this.target),!0===this.enableDamping?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let e=null;if(this.object.isPerspectiveCamera){const t=H.length();e=this._clampDistance(t*this._scale);const n=t-e;this.object.position.addScaledVector(this._dollyDirection,n),this.object.updateMatrixWorld(),s=!!n}else if(this.object.isOrthographicCamera){const n=new t.Vector3(this._mouse.x,this._mouse.y,0);n.unproject(this.object);const i=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),s=i!==this.object.zoom;const o=new t.Vector3(this._mouse.x,this._mouse.y,0);o.unproject(this.object),this.object.position.sub(o).add(n),this.object.updateMatrixWorld(),e=H.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;null!==e&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(e).add(this.object.position):(Z.origin.copy(this.object.position),Z.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Z.direction))<X?this.object.lookAt(this.target):(N.setFromNormalAndCoplanarPoint(this.object.up,this.target),Z.intersectPlane(N,this.target))))}else if(this.object.isOrthographicCamera){const t=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),t!==this.object.zoom&&(this.object.updateProjectionMatrix(),s=!0)}return this._scale=1,this._performCursorZoom=!1,!!(s||this._lastPosition.distanceToSquared(this.object.position)>it||8*(1-this._lastQuaternion.dot(this.object.quaternion))>it||this._lastTargetPosition.distanceToSquared(this.target)>it)&&(this.dispatchEvent(K),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0)}_getAutoRotationAngle(t){return null!==t?q/60*this.autoRotateSpeed*t:q/60/60*this.autoRotateSpeed}_getZoomScale(t){const e=Math.abs(.01*t);return Math.pow(.95,this.zoomSpeed*e)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,e){H.setFromMatrixColumn(e,0),H.multiplyScalar(-t),this._panOffset.add(H)}_panUp(t,e){!0===this.screenSpacePanning?H.setFromMatrixColumn(e,1):(H.setFromMatrixColumn(e,0),H.crossVectors(this.object.up,H)),H.multiplyScalar(t),this._panOffset.add(H)}_pan(t,e){const n=this.domElement;if(this.object.isPerspectiveCamera){const i=this.object.position;H.copy(i).sub(this.target);let o=H.length();o*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*o/n.clientHeight,this.object.matrix),this._panUp(2*e*o/n.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/n.clientWidth,this.object.matrix),this._panUp(e*(this.object.top-this.object.bottom)/this.object.zoom/n.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,e){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const n=this.domElement.getBoundingClientRect(),i=t-n.left,o=e-n.top,s=n.width,r=n.height;this._mouse.x=i/s*2-1,this._mouse.y=-o/r*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(q*this._rotateDelta.x/e.clientHeight),this._rotateUp(q*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let e=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(q*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,this.keyPanSpeed),e=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateUp(-q*this.rotateSpeed/this.domElement.clientHeight):this._pan(0,-this.keyPanSpeed),e=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(q*this.rotateSpeed/this.domElement.clientHeight):this._pan(this.keyPanSpeed,0),e=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this._rotateLeft(-q*this.rotateSpeed/this.domElement.clientHeight):this._pan(-this.keyPanSpeed,0),e=!0}e&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(1===this._pointers.length)this._rotateStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateStart.set(n,i)}}_handleTouchStartPan(t){if(1===this._pointers.length)this._panStart.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panStart.set(n,i)}}_handleTouchStartDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,o=Math.sqrt(n*n+i*i);this._dollyStart.set(0,o)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(1==this._pointers.length)this._rotateEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const e=this.domElement;this._rotateLeft(q*this._rotateDelta.x/e.clientHeight),this._rotateUp(q*this._rotateDelta.y/e.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(1===this._pointers.length)this._panEnd.set(t.pageX,t.pageY);else{const e=this._getSecondPointerPosition(t),n=.5*(t.pageX+e.x),i=.5*(t.pageY+e.y);this._panEnd.set(n,i)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const e=this._getSecondPointerPosition(t),n=t.pageX-e.x,i=t.pageY-e.y,o=Math.sqrt(n*n+i*i);this._dollyEnd.set(0,o),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const s=.5*(t.pageX+e.x),r=.5*(t.pageY+e.y);this._updateZoomParameters(s,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return void this._pointers.splice(e,1)}_isTrackingPointer(t){for(let e=0;e<this._pointers.length;e++)if(this._pointers[e]==t.pointerId)return!0;return!1}_trackPointer(e){let n=this._pointerPositions[e.pointerId];void 0===n&&(n=new t.Vector2,this._pointerPositions[e.pointerId]=n),n.set(e.pageX,e.pageY)}_getSecondPointerPosition(t){const e=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[e]}_customWheelEvent(t){const e=t.deltaMode,n={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(e){case 1:n.deltaY*=16;break;case 2:n.deltaY*=100}return t.ctrlKey&&!this._controlActive&&(n.deltaY*=10),n}}function st(t){!1!==this.enabled&&(0===this._pointers.length&&(this.domElement.setPointerCapture(t.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),this._isTrackingPointer(t)||(this._addPointer(t),"touch"===t.pointerType?this._onTouchStart(t):this._onMouseDown(t)))}function rt(t){!1!==this.enabled&&("touch"===t.pointerType?this._onTouchMove(t):this._onMouseMove(t))}function at(t){switch(this._removePointer(t),this._pointers.length){case 0:this.domElement.releasePointerCapture(t.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(B),this.state=Q;break;case 1:const e=this._pointers[0],n=this._pointerPositions[e];this._onTouchStart({pointerId:e,pageX:n.x,pageY:n.y})}}function ht(e){let n;switch(e.button){case 0:n=this.mouseButtons.LEFT;break;case 1:n=this.mouseButtons.MIDDLE;break;case 2:n=this.mouseButtons.RIGHT;break;default:n=-1}switch(n){case t.MOUSE.DOLLY:if(!1===this.enableZoom)return;this._handleMouseDownDolly(e),this.state=G;break;case t.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=$}else{if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=W}break;case t.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===this.enableRotate)return;this._handleMouseDownRotate(e),this.state=W}else{if(!1===this.enablePan)return;this._handleMouseDownPan(e),this.state=$}break;default:this.state=Q}this.state!==Q&&this.dispatchEvent(Y)}function lt(t){switch(this.state){case W:if(!1===this.enableRotate)return;this._handleMouseMoveRotate(t);break;case G:if(!1===this.enableZoom)return;this._handleMouseMoveDolly(t);break;case $:if(!1===this.enablePan)return;this._handleMouseMovePan(t)}}function ct(t){!1!==this.enabled&&!1!==this.enableZoom&&this.state===Q&&(t.preventDefault(),this.dispatchEvent(Y),this._handleMouseWheel(this._customWheelEvent(t)),this.dispatchEvent(B))}function ut(t){!1!==this.enabled&&!1!==this.enablePan&&this._handleKeyDown(t)}function pt(e){switch(this._trackPointer(e),this._pointers.length){case 1:switch(this.touches.ONE){case t.TOUCH.ROTATE:if(!1===this.enableRotate)return;this._handleTouchStartRotate(e),this.state=J;break;case t.TOUCH.PAN:if(!1===this.enablePan)return;this._handleTouchStartPan(e),this.state=tt;break;default:this.state=Q}break;case 2:switch(this.touches.TWO){case t.TOUCH.DOLLY_PAN:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchStartDollyPan(e),this.state=et;break;case t.TOUCH.DOLLY_ROTATE:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchStartDollyRotate(e),this.state=nt;break;default:this.state=Q}break;default:this.state=Q}this.state!==Q&&this.dispatchEvent(Y)}function dt(t){switch(this._trackPointer(t),this.state){case J:if(!1===this.enableRotate)return;this._handleTouchMoveRotate(t),this.update();break;case tt:if(!1===this.enablePan)return;this._handleTouchMovePan(t),this.update();break;case et:if(!1===this.enableZoom&&!1===this.enablePan)return;this._handleTouchMoveDollyPan(t),this.update();break;case nt:if(!1===this.enableZoom&&!1===this.enableRotate)return;this._handleTouchMoveDollyRotate(t),this.update();break;default:this.state=Q}}function ft(t){!1!==this.enabled&&t.preventDefault()}function mt(t){if("Control"===t.key){this._controlActive=!0;this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}function _t(t){if("Control"===t.key){this._controlActive=!1;this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0})}}const gt={type:"change"},vt=1e-6,bt=new t.Quaternion;class yt extends t.Controls{constructor(e,n=null){super(e,n),this.movementSpeed=1,this.rollSpeed=.005,this.dragToLook=!1,this.autoForward=!1,this._moveState={up:0,down:0,left:0,right:0,forward:0,back:0,pitchUp:0,pitchDown:0,yawLeft:0,yawRight:0,rollLeft:0,rollRight:0},this._moveVector=new t.Vector3(0,0,0),this._rotationVector=new t.Vector3(0,0,0),this._lastQuaternion=new t.Quaternion,this._lastPosition=new t.Vector3,this._status=0,this._onKeyDown=wt.bind(this),this._onKeyUp=St.bind(this),this._onPointerMove=Pt.bind(this),this._onPointerDown=Et.bind(this),this._onPointerUp=kt.bind(this),this._onPointerCancel=Ct.bind(this),this._onContextMenu=Mt.bind(this),null!==n&&this.connect()}connect(){window.addEventListener("keydown",this._onKeyDown),window.addEventListener("keyup",this._onKeyUp),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointerup",this._onPointerUp),this.domElement.addEventListener("pointercancel",this._onPointerCancel),this.domElement.addEventListener("contextmenu",this._onContextMenu)}disconnect(){window.removeEventListener("keydown",this._onKeyDown),window.removeEventListener("keyup",this._onKeyUp),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerCancel),this.domElement.removeEventListener("contextmenu",this._onContextMenu)}dispose(){this.disconnect()}update(t){if(!1===this.enabled)return;const e=this.object,n=t*this.movementSpeed,i=t*this.rollSpeed;e.translateX(this._moveVector.x*n),e.translateY(this._moveVector.y*n),e.translateZ(this._moveVector.z*n),bt.set(this._rotationVector.x*i,this._rotationVector.y*i,this._rotationVector.z*i,1).normalize(),e.quaternion.multiply(bt),(this._lastPosition.distanceToSquared(e.position)>vt||8*(1-this._lastQuaternion.dot(e.quaternion))>vt)&&(this.dispatchEvent(gt),this._lastQuaternion.copy(e.quaternion),this._lastPosition.copy(e.position))}_updateMovementVector(){const t=this._moveState.forward||this.autoForward&&!this._moveState.back?1:0;this._moveVector.x=-this._moveState.left+this._moveState.right,this._moveVector.y=-this._moveState.down+this._moveState.up,this._moveVector.z=-t+this._moveState.back}_updateRotationVector(){this._rotationVector.x=-this._moveState.pitchDown+this._moveState.pitchUp,this._rotationVector.y=-this._moveState.yawRight+this._moveState.yawLeft,this._rotationVector.z=-this._moveState.rollRight+this._moveState.rollLeft}_getContainerDimensions(){return this.domElement!=document?{size:[this.domElement.offsetWidth,this.domElement.offsetHeight],offset:[this.domElement.offsetLeft,this.domElement.offsetTop]}:{size:[window.innerWidth,window.innerHeight],offset:[0,0]}}}function wt(t){if(!t.altKey&&!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=.1;break;case"KeyW":this._moveState.forward=1;break;case"KeyS":this._moveState.back=1;break;case"KeyA":this._moveState.left=1;break;case"KeyD":this._moveState.right=1;break;case"KeyR":this._moveState.up=1;break;case"KeyF":this._moveState.down=1;break;case"ArrowUp":this._moveState.pitchUp=1;break;case"ArrowDown":this._moveState.pitchDown=1;break;case"ArrowLeft":this._moveState.yawLeft=1;break;case"ArrowRight":this._moveState.yawRight=1;break;case"KeyQ":this._moveState.rollLeft=1;break;case"KeyE":this._moveState.rollRight=1}this._updateMovementVector(),this._updateRotationVector()}}function St(t){if(!1!==this.enabled){switch(t.code){case"ShiftLeft":case"ShiftRight":this.movementSpeedMultiplier=1;break;case"KeyW":this._moveState.forward=0;break;case"KeyS":this._moveState.back=0;break;case"KeyA":this._moveState.left=0;break;case"KeyD":this._moveState.right=0;break;case"KeyR":this._moveState.up=0;break;case"KeyF":this._moveState.down=0;break;case"ArrowUp":this._moveState.pitchUp=0;break;case"ArrowDown":this._moveState.pitchDown=0;break;case"ArrowLeft":this._moveState.yawLeft=0;break;case"ArrowRight":this._moveState.yawRight=0;break;case"KeyQ":this._moveState.rollLeft=0;break;case"KeyE":this._moveState.rollRight=0}this._updateMovementVector(),this._updateRotationVector()}}function Et(t){if(!1!==this.enabled)if(this.dragToLook)this._status++;else{switch(t.button){case 0:this._moveState.forward=1;break;case 2:this._moveState.back=1}this._updateMovementVector()}}function Pt(t){if(!1!==this.enabled&&(!this.dragToLook||this._status>0)){const e=this._getContainerDimensions(),n=e.size[0]/2,i=e.size[1]/2;this._moveState.yawLeft=-(t.pageX-e.offset[0]-n)/n,this._moveState.pitchDown=(t.pageY-e.offset[1]-i)/i,this._updateRotationVector()}}function kt(t){if(!1!==this.enabled){if(this.dragToLook)this._status--,this._moveState.yawLeft=this._moveState.pitchDown=0;else{switch(t.button){case 0:this._moveState.forward=0;break;case 2:this._moveState.back=0}this._updateMovementVector()}this._updateRotationVector()}}function Ct(){!1!==this.enabled&&(this.dragToLook?(this._status=0,this._moveState.yawLeft=this._moveState.pitchDown=0):(this._moveState.forward=0,this._moveState.back=0,this._updateMovementVector()),this._updateRotationVector())}function Mt(t){!1!==this.enabled&&t.preventDefault()}const xt={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"};class jt{constructor(){this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}setSize(){}render(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}dispose(){}}const Tt=new t.OrthographicCamera(-1,1,1,-1,0,1);class Dt extends t.BufferGeometry{constructor(){super(),this.setAttribute("position",new t.Float32BufferAttribute([-1,3,0,-1,-1,0,3,-1,0],3)),this.setAttribute("uv",new t.Float32BufferAttribute([0,2,0,0,2,0],2))}}const Ot=new Dt;class Rt{constructor(e){this._mesh=new t.Mesh(Ot,e)}dispose(){this._mesh.geometry.dispose()}render(t){t.render(this._mesh,Tt)}get material(){return this._mesh.material}set material(t){this._mesh.material=t}}class Lt extends jt{constructor(e,n){super(),this.textureID=void 0!==n?n:"tDiffuse",e instanceof t.ShaderMaterial?(this.uniforms=e.uniforms,this.material=e):e&&(this.uniforms=t.UniformsUtils.clone(e.uniforms),this.material=new t.ShaderMaterial({name:void 0!==e.name?e.name:"unspecified",defines:Object.assign({},e.defines),uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader})),this.fsQuad=new Rt(this.material)}render(t,e,n){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=n.texture),this.fsQuad.material=this.material,this.renderToScreen?(t.setRenderTarget(null),this.fsQuad.render(t)):(t.setRenderTarget(e),this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),this.fsQuad.render(t))}dispose(){this.material.dispose(),this.fsQuad.dispose()}}class It extends jt{constructor(t,e){super(),this.scene=t,this.camera=e,this.clear=!0,this.needsSwap=!1,this.inverse=!1}render(t,e,n){const i=t.getContext(),o=t.state;let s,r;o.buffers.color.setMask(!1),o.buffers.depth.setMask(!1),o.buffers.color.setLocked(!0),o.buffers.depth.setLocked(!0),this.inverse?(s=0,r=1):(s=1,r=0),o.buffers.stencil.setTest(!0),o.buffers.stencil.setOp(i.REPLACE,i.REPLACE,i.REPLACE),o.buffers.stencil.setFunc(i.ALWAYS,s,4294967295),o.buffers.stencil.setClear(r),o.buffers.stencil.setLocked(!0),t.setRenderTarget(n),this.clear&&t.clear(),t.render(this.scene,this.camera),t.setRenderTarget(e),this.clear&&t.clear(),t.render(this.scene,this.camera),o.buffers.color.setLocked(!1),o.buffers.depth.setLocked(!1),o.buffers.color.setMask(!0),o.buffers.depth.setMask(!0),o.buffers.stencil.setLocked(!1),o.buffers.stencil.setFunc(i.EQUAL,1,4294967295),o.buffers.stencil.setOp(i.KEEP,i.KEEP,i.KEEP),o.buffers.stencil.setLocked(!0)}}class At extends jt{constructor(){super(),this.needsSwap=!1}render(t){t.state.buffers.stencil.setLocked(!1),t.state.buffers.stencil.setTest(!1)}}class zt{constructor(e,n){if(this.renderer=e,this._pixelRatio=e.getPixelRatio(),void 0===n){const i=e.getSize(new t.Vector2);this._width=i.width,this._height=i.height,(n=new t.WebGLRenderTarget(this._width*this._pixelRatio,this._height*this._pixelRatio,{type:t.HalfFloatType})).texture.name="EffectComposer.rt1"}else this._width=n.width,this._height=n.height;this.renderTarget1=n,this.renderTarget2=n.clone(),this.renderTarget2.texture.name="EffectComposer.rt2",this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.renderToScreen=!0,this.passes=[],this.copyPass=new Lt(xt),this.copyPass.material.blending=t.NoBlending,this.clock=new t.Clock}swapBuffers(){const t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t}addPass(t){this.passes.push(t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}insertPass(t,e){this.passes.splice(e,0,t),t.setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}removePass(t){const e=this.passes.indexOf(t);-1!==e&&this.passes.splice(e,1)}isLastEnabledPass(t){for(let e=t+1;e<this.passes.length;e++)if(this.passes[e].enabled)return!1;return!0}render(t){void 0===t&&(t=this.clock.getDelta());const e=this.renderer.getRenderTarget();let n=!1;for(let e=0,i=this.passes.length;e<i;e++){const i=this.passes[e];if(!1!==i.enabled){if(i.renderToScreen=this.renderToScreen&&this.isLastEnabledPass(e),i.render(this.renderer,this.writeBuffer,this.readBuffer,t,n),i.needsSwap){if(n){const e=this.renderer.getContext(),n=this.renderer.state.buffers.stencil;n.setFunc(e.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),n.setFunc(e.EQUAL,1,4294967295)}this.swapBuffers()}void 0!==It&&(i instanceof It?n=!0:i instanceof At&&(n=!1))}}this.renderer.setRenderTarget(e)}reset(e){if(void 0===e){const n=this.renderer.getSize(new t.Vector2);this._pixelRatio=this.renderer.getPixelRatio(),this._width=n.width,this._height=n.height,(e=this.renderTarget1.clone()).setSize(this._width*this._pixelRatio,this._height*this._pixelRatio)}this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2}setSize(t,e){this._width=t,this._height=e;const n=this._width*this._pixelRatio,i=this._height*this._pixelRatio;this.renderTarget1.setSize(n,i),this.renderTarget2.setSize(n,i);for(let t=0;t<this.passes.length;t++)this.passes[t].setSize(n,i)}setPixelRatio(t){this._pixelRatio=t,this.setSize(this._width,this._height)}dispose(){this.renderTarget1.dispose(),this.renderTarget2.dispose(),this.copyPass.dispose()}}class Ft extends jt{constructor(e,n,i=null,o=null,s=null){super(),this.scene=e,this.camera=n,this.overrideMaterial=i,this.clearColor=o,this.clearAlpha=s,this.clear=!0,this.clearDepth=!1,this.needsSwap=!1,this._oldClearColor=new t.Color}render(t,e,n){const i=t.autoClear;let o,s;t.autoClear=!1,null!==this.overrideMaterial&&(s=this.scene.overrideMaterial,this.scene.overrideMaterial=this.overrideMaterial),null!==this.clearColor&&(t.getClearColor(this._oldClearColor),t.setClearColor(this.clearColor,t.getClearAlpha())),null!==this.clearAlpha&&(o=t.getClearAlpha(),t.setClearAlpha(this.clearAlpha)),1==this.clearDepth&&t.clearDepth(),t.setRenderTarget(this.renderToScreen?null:n),!0===this.clear&&t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil),t.render(this.scene,this.camera),null!==this.clearColor&&t.setClearColor(this._oldClearColor),null!==this.clearAlpha&&t.setClearAlpha(o),null!==this.overrideMaterial&&(this.scene.overrideMaterial=s),t.autoClear=i}}function Ut(){return Ut=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ut.apply(null,arguments)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function Kt(t){return Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Kt(t)}function Yt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Yt=function(){return!!t})()}function Bt(t){var e="function"==typeof Map?new Map:void 0;return Bt=function(t){if(null===t||!function(t){try{return-1!==Function.toString.call(t).indexOf("[native code]")}catch(e){return"function"==typeof t}}(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(t,e,n){if(Yt())return Reflect.construct.apply(null,arguments);var i=[null];i.push.apply(i,e);var o=new(t.bind.apply(t,i));return n&&Vt(o,n.prototype),o}(t,arguments,Kt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Vt(n,t)},Bt(t)}var Zt={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function Nt(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,o=e[0],s=[];for(i=1;i<e.length;i+=1)s.push(e[i]);return s.forEach((function(t){o=o.replace(/%[a-z]/,t)})),o}var Xt=function(t){var e,n;function i(e){var n;if("production"===process.env.NODE_ENV)n=t.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+e+" for more information.")||this;else{for(var i=arguments.length,o=new Array(i>1?i-1:0),s=1;s<i;s++)o[s-1]=arguments[s];n=t.call(this,Nt.apply(void 0,[Zt[e]].concat(o)))||this}return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(n)}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,Vt(e,n),i}(Bt(Error));function Ht(t){return Math.round(255*t)}function qt(t,e,n){return Ht(t)+","+Ht(e)+","+Ht(n)}function Qt(t,e,n,i){if(void 0===i&&(i=qt),0===e)return i(n,n,n);var o=(t%360+360)%360/60,s=(1-Math.abs(2*n-1))*e,r=s*(1-Math.abs(o%2-1)),a=0,h=0,l=0;o>=0&&o<1?(a=s,h=r):o>=1&&o<2?(a=r,h=s):o>=2&&o<3?(h=s,l=r):o>=3&&o<4?(h=r,l=s):o>=4&&o<5?(a=r,l=s):o>=5&&o<6&&(a=s,l=r);var c=n-s/2;return i(a+c,h+c,l+c)}var Wt={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Gt=/^#[a-fA-F0-9]{6}$/,$t=/^#[a-fA-F0-9]{8}$/,Jt=/^#[a-fA-F0-9]{3}$/,te=/^#[a-fA-F0-9]{4}$/,ee=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,ne=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,ie=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,oe=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;function se(t){if("string"!=typeof t)throw new Xt(3);var e=function(t){if("string"!=typeof t)return t;var e=t.toLowerCase();return Wt[e]?"#"+Wt[e]:t}(t);if(e.match(Gt))return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16)};if(e.match($t)){var n=parseFloat((parseInt(""+e[7]+e[8],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[2],16),green:parseInt(""+e[3]+e[4],16),blue:parseInt(""+e[5]+e[6],16),alpha:n}}if(e.match(Jt))return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16)};if(e.match(te)){var i=parseFloat((parseInt(""+e[4]+e[4],16)/255).toFixed(2));return{red:parseInt(""+e[1]+e[1],16),green:parseInt(""+e[2]+e[2],16),blue:parseInt(""+e[3]+e[3],16),alpha:i}}var o=ee.exec(e);if(o)return{red:parseInt(""+o[1],10),green:parseInt(""+o[2],10),blue:parseInt(""+o[3],10)};var s=ne.exec(e.substring(0,50));if(s)return{red:parseInt(""+s[1],10),green:parseInt(""+s[2],10),blue:parseInt(""+s[3],10),alpha:parseFloat(""+s[4])>1?parseFloat(""+s[4])/100:parseFloat(""+s[4])};var r=ie.exec(e);if(r){var a="rgb("+Qt(parseInt(""+r[1],10),parseInt(""+r[2],10)/100,parseInt(""+r[3],10)/100)+")",h=ee.exec(a);if(!h)throw new Xt(4,e,a);return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)}}var l=oe.exec(e.substring(0,50));if(l){var c="rgb("+Qt(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",u=ee.exec(c);if(!u)throw new Xt(4,e,c);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10),alpha:parseFloat(""+l[4])>1?parseFloat(""+l[4])/100:parseFloat(""+l[4])}}throw new Xt(5)}function re(t){return function(t){var e,n=t.red/255,i=t.green/255,o=t.blue/255,s=Math.max(n,i,o),r=Math.min(n,i,o),a=(s+r)/2;if(s===r)return void 0!==t.alpha?{hue:0,saturation:0,lightness:a,alpha:t.alpha}:{hue:0,saturation:0,lightness:a};var h=s-r,l=a>.5?h/(2-s-r):h/(s+r);switch(s){case n:e=(i-o)/h+(i<o?6:0);break;case i:e=(o-n)/h+2;break;default:e=(n-i)/h+4}return e*=60,void 0!==t.alpha?{hue:e,saturation:l,lightness:a,alpha:t.alpha}:{hue:e,saturation:l,lightness:a}}(se(t))}var ae=function(t){return 7===t.length&&t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?"#"+t[1]+t[3]+t[5]:t};function he(t){var e=t.toString(16);return 1===e.length?"0"+e:e}function le(t){return he(Math.round(255*t))}function ce(t,e,n){return ae("#"+le(t)+le(e)+le(n))}function ue(t,e,n){return Qt(t,e,n,ce)}function pe(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ae("#"+he(t)+he(e)+he(n));if("object"==typeof t&&void 0===e&&void 0===n)return ae("#"+he(t.red)+he(t.green)+he(t.blue));throw new Xt(6)}function de(t,e,n,i){if("string"==typeof t&&"number"==typeof e){var o=se(t);return"rgba("+o.red+","+o.green+","+o.blue+","+e+")"}if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?pe(t,e,n):"rgba("+t+","+e+","+n+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?pe(t.red,t.green,t.blue):"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")";throw new Xt(7)}function fe(t){if("object"!=typeof t)throw new Xt(8);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&"number"==typeof t.alpha}(t))return de(t);if(function(t){return"number"==typeof t.red&&"number"==typeof t.green&&"number"==typeof t.blue&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return pe(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&"number"==typeof t.alpha}(t))return function(t,e,n,i){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n&&"number"==typeof i)return i>=1?ue(t,e,n):"rgba("+Qt(t,e,n)+","+i+")";if("object"==typeof t&&void 0===e&&void 0===n&&void 0===i)return t.alpha>=1?ue(t.hue,t.saturation,t.lightness):"rgba("+Qt(t.hue,t.saturation,t.lightness)+","+t.alpha+")";throw new Xt(2)}(t);if(function(t){return"number"==typeof t.hue&&"number"==typeof t.saturation&&"number"==typeof t.lightness&&("number"!=typeof t.alpha||void 0===t.alpha)}(t))return function(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ue(t,e,n);if("object"==typeof t&&void 0===e&&void 0===n)return ue(t.hue,t.saturation,t.lightness);throw new Xt(1)}(t);throw new Xt(8)}function me(t,e,n){return function(){var i=n.concat(Array.prototype.slice.call(arguments));return i.length>=e?t.apply(this,i):me(t,e,i)}}function _e(t){return me(t,t.length,[])}function ge(t,e,n){return Math.max(t,Math.min(e,n))}_e((function(t,e){if("transparent"===e)return e;var n=re(e);return fe(Ut({},n,{hue:n.hue+parseFloat(t)}))})),_e((function(t,e){if("transparent"===e)return e;var n=re(e);return fe(Ut({},n,{lightness:ge(0,1,n.lightness-parseFloat(t))}))})),_e((function(t,e){if("transparent"===e)return e;var n=re(e);return fe(Ut({},n,{saturation:ge(0,1,n.saturation-parseFloat(t))}))})),_e((function(t,e){if("transparent"===e)return e;var n=re(e);return fe(Ut({},n,{lightness:ge(0,1,n.lightness+parseFloat(t))}))}));var ve=_e((function(t,e,n){if("transparent"===e)return n;if("transparent"===n)return e;if(0===t)return n;var i=se(e),o=Ut({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=se(n),r=Ut({},s,{alpha:"number"==typeof s.alpha?s.alpha:1}),a=o.alpha-r.alpha,h=2*parseFloat(t)-1,l=((h*a==-1?h:h+a)/(1+h*a)+1)/2,c=1-l;return de({red:Math.floor(o.red*l+r.red*c),green:Math.floor(o.green*l+r.green*c),blue:Math.floor(o.blue*l+r.blue*c),alpha:o.alpha*parseFloat(t)+r.alpha*(1-parseFloat(t))})}));var be=_e((function(t,e){if("transparent"===e)return e;var n=se(e);return de(Ut({},n,{alpha:ge(0,1,(100*("number"==typeof n.alpha?n.alpha:1)+100*parseFloat(t))/100)}))}));_e((function(t,e){if("transparent"===e)return e;var n=re(e);return fe(Ut({},n,{saturation:ge(0,1,n.saturation+parseFloat(t))}))})),_e((function(t,e){return"transparent"===e?e:fe(Ut({},re(e),{hue:parseFloat(t)}))})),_e((function(t,e){return"transparent"===e?e:fe(Ut({},re(e),{lightness:parseFloat(t)}))})),_e((function(t,e){return"transparent"===e?e:fe(Ut({},re(e),{saturation:parseFloat(t)}))})),_e((function(t,e){return"transparent"===e?e:ve(parseFloat(t),"rgb(0, 0, 0)",e)})),_e((function(t,e){return"transparent"===e?e:ve(parseFloat(t),"rgb(255, 255, 255)",e)})),_e((function(t,e){if("transparent"===e)return e;var n=se(e);return de(Ut({},n,{alpha:ge(0,1,+(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(t)).toFixed(2)/100)}))}));var ye,we=Object.freeze({Linear:Object.freeze({None:function(t){return t},In:function(t){return t},Out:function(t){return t},InOut:function(t){return t}}),Quadratic:Object.freeze({In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}}),Cubic:Object.freeze({In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}}),Quartic:Object.freeze({In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}}),Quintic:Object.freeze({In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}}),Sinusoidal:Object.freeze({In:function(t){return 1-Math.sin((1-t)*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.sin(Math.PI*(.5-t)))}}),Exponential:Object.freeze({In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}}),Circular:Object.freeze({In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}}),Elastic:Object.freeze({In:function(t){return 0===t?0:1===t?1:-Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}}),Back:Object.freeze({In:function(t){var e=1.70158;return 1===t?1:t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return 0===t?0:--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}}),Bounce:Object.freeze({In:function(t){return 1-we.Bounce.Out(1-t)},Out:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},InOut:function(t){return t<.5?.5*we.Bounce.In(2*t):.5*we.Bounce.Out(2*t-1)+.5}}),generatePow:function(t){return void 0===t&&(t=4),t=(t=t<Number.EPSILON?Number.EPSILON:t)>1e4?1e4:t,{In:function(e){return Math.pow(e,t)},Out:function(e){return 1-Math.pow(1-e,t)},InOut:function(e){return e<.5?Math.pow(2*e,t)/2:(1-Math.pow(2-2*e,t))/2+.5}}}}),Se=function(){return performance.now()},Ee=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return t.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map((function(e){return t._tweens[e]}))},t.prototype.removeAll=function(){this._tweens={}},t.prototype.add=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];for(var i=0,o=e;i<o.length;i++){var s=o[i];null===(t=s._group)||void 0===t||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},t.prototype.remove=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var n=0,i=t;n<i.length;n++){var o=i[n];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},t.prototype.allStopped=function(){return this.getAll().every((function(t){return!t.isPlaying()}))},t.prototype.update=function(t,e){void 0===t&&(t=Se()),void 0===e&&(e=!0);var n=Object.keys(this._tweens);if(0!==n.length)for(;n.length>0;){this._tweensAddedDuringUpdate={};for(var i=0;i<n.length;i++){var o=this._tweens[n[i]],s=!e;o&&!1===o.update(t,s)&&!e&&this.remove(o)}n=Object.keys(this._tweensAddedDuringUpdate)}},t}(),Pe={Linear:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),s=Pe.Utils.Linear;return e<0?s(t[0],t[1],i):e>1?s(t[n],t[n-1],n-i):s(t[o],t[o+1>n?n:o+1],i-o)},Bezier:function(t,e){for(var n=0,i=t.length-1,o=Math.pow,s=Pe.Utils.Bernstein,r=0;r<=i;r++)n+=o(1-e,i-r)*o(e,r)*t[r]*s(i,r);return n},CatmullRom:function(t,e){var n=t.length-1,i=n*e,o=Math.floor(i),s=Pe.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(i=n*(1+e))),s(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],i-o)):e<0?t[0]-(s(t[0],t[0],t[1],t[1],-i)-t[0]):e>1?t[n]-(s(t[n],t[n],t[n-1],t[n-1],i-n)-t[n]):s(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],i-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=Pe.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:(ye=[1],function(t){var e=1;if(ye[t])return ye[t];for(var n=t;n>1;n--)e*=n;return ye[t]=e,e}),CatmullRom:function(t,e,n,i,o){var s=.5*(n-t),r=.5*(i-e),a=o*o;return(2*e-2*n+s+r)*(o*a)+(-3*e+3*n-2*s-r)*a+s*o+e}}},ke=function(){function t(){}return t.nextId=function(){return t._nextId++},t._nextId=0,t}(),Ce=new Ee,Me=function(){function t(t,e){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=we.Linear.None,this._interpolationFunction=Pe.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=ke.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,"object"==typeof e?(this._group=e,e.add(this)):!0===e&&(this._group=Ce,Ce.add(this))}return t.prototype.getId=function(){return this._id},t.prototype.isPlaying=function(){return this._isPlaying},t.prototype.isPaused=function(){return this._isPaused},t.prototype.getDuration=function(){return this._duration},t.prototype.to=function(t,e){if(void 0===e&&(e=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=e<0?0:e,this},t.prototype.duration=function(t){return void 0===t&&(t=1e3),this._duration=t<0?0:t,this},t.prototype.dynamic=function(t){return void 0===t&&(t=!1),this._isDynamic=t,this},t.prototype.start=function(t,e){if(void 0===t&&(t=Se()),void 0===e&&(e=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed)for(var n in this._reversed=!1,this._valuesStartRepeat)this._swapEndStartRepeatValues(n),this._valuesStart[n]=this._valuesStartRepeat[n];if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||e){if(this._propertiesAreSetUp=!0,!this._isDynamic){var i={};for(var o in this._valuesEnd)i[o]=this._valuesEnd[o];this._valuesEnd=i}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,e)}return this},t.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},t.prototype._setupProperties=function(t,e,n,i,o){for(var s in n){var r=t[s],a=Array.isArray(r),h=a?"array":typeof r,l=!a&&Array.isArray(n[s]);if("undefined"!==h&&"function"!==h){if(l){if(0===(_=n[s]).length)continue;for(var c=[r],u=0,p=_.length;u<p;u+=1){var d=this._handleRelativeValue(r,_[u]);if(isNaN(d)){l=!1,console.warn("Found invalid interpolation list. Skipping.");break}c.push(d)}l&&(n[s]=c)}if("object"!==h&&!a||!r||l)(void 0===e[s]||o)&&(e[s]=r),a||(e[s]*=1),i[s]=l?n[s].slice().reverse():e[s]||0;else{e[s]=a?[]:{};var f=r;for(var m in f)e[s][m]=f[m];i[s]=a?[]:{};var _=n[s];if(!this._isDynamic){var g={};for(var m in _)g[m]=_[m];n[s]=_=g}this._setupProperties(f,e[s],_,i[s],o)}}}},t.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},t.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},t.prototype.pause=function(t){return void 0===t&&(t=Se()),this._isPaused||!this._isPlaying||(this._isPaused=!0,this._pauseStart=t),this},t.prototype.resume=function(t){return void 0===t&&(t=Se()),this._isPaused&&this._isPlaying?(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this):this},t.prototype.stopChainedTweens=function(){for(var t=0,e=this._chainedTweens.length;t<e;t++)this._chainedTweens[t].stop();return this},t.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},t.prototype.remove=function(){var t;return null===(t=this._group)||void 0===t||t.remove(this),this},t.prototype.delay=function(t){return void 0===t&&(t=0),this._delayTime=t,this},t.prototype.repeat=function(t){return void 0===t&&(t=0),this._initialRepeat=t,this._repeat=t,this},t.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},t.prototype.yoyo=function(t){return void 0===t&&(t=!1),this._yoyo=t,this},t.prototype.easing=function(t){return void 0===t&&(t=we.Linear.None),this._easingFunction=t,this},t.prototype.interpolation=function(t){return void 0===t&&(t=Pe.Linear),this._interpolationFunction=t,this},t.prototype.chain=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this._chainedTweens=t,this},t.prototype.onStart=function(t){return this._onStartCallback=t,this},t.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},t.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},t.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},t.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},t.prototype.onStop=function(t){return this._onStopCallback=t,this},t.prototype.update=function(e,n){var i,o,s=this;if(void 0===e&&(e=Se()),void 0===n&&(n=t.autoStartOnUpdate),this._isPaused)return!0;if(!this._goToEnd&&!this._isPlaying){if(!n)return!1;this.start(e,!0)}if(this._goToEnd=!1,e<this._startTime)return!0;!1===this._onStartCallbackFired&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),!1===this._onEveryStartCallbackFired&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var r=e-this._startTime,a=this._duration+(null!==(i=this._repeatDelayTime)&&void 0!==i?i:this._delayTime),h=this._duration+this._repeat*a,l=function(){if(0===s._duration)return 1;if(r>h)return 1;var t=Math.trunc(r/a),e=r-t*a,n=Math.min(e/s._duration,1);return 0===n&&r===s._duration?1:n}(),c=this._easingFunction(l);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,c),this._onUpdateCallback&&this._onUpdateCallback(this._object,l),0===this._duration||r>=this._duration){if(this._repeat>0){var u=Math.min(Math.trunc((r-this._duration)/a)+1,this._repeat);for(o in isFinite(this._repeat)&&(this._repeat-=u),this._valuesStartRepeat)this._yoyo||"string"!=typeof this._valuesEnd[o]||(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*u,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var p=0,d=this._chainedTweens.length;p<d;p++)this._chainedTweens[p].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},t.prototype._updateProperties=function(t,e,n,i){for(var o in n)if(void 0!==e[o]){var s=e[o]||0,r=n[o],a=Array.isArray(t[o]),h=Array.isArray(r);!a&&h?t[o]=this._interpolationFunction(r,i):"object"==typeof r&&r?this._updateProperties(t[o],s,r,i):"number"==typeof(r=this._handleRelativeValue(s,r))&&(t[o]=s+(r-s)*i)}},t.prototype._handleRelativeValue=function(t,e){return"string"!=typeof e?e:"+"===e.charAt(0)||"-"===e.charAt(0)?t+parseFloat(e):parseFloat(e)},t.prototype._swapEndStartRepeatValues=function(t){var e=this._valuesStartRepeat[t],n=this._valuesEnd[t];this._valuesStartRepeat[t]="string"==typeof n?this._valuesStartRepeat[t]+parseFloat(n):this._valuesEnd[t],this._valuesEnd[t]=e},t.autoStartOnUpdate=!1,t}(),xe=Ce;xe.getAll.bind(xe),xe.removeAll.bind(xe),xe.add.bind(xe),xe.remove.bind(xe),xe.update.bind(xe);function je(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Te="object"==typeof global&&global&&global.Object===Object&&global,De="object"==typeof self&&self&&self.Object===Object&&self,Oe=Te||De||Function("return this")(),Re=function(){return Oe.Date.now()},Le=/\s/;var Ie=/^\s+/;function Ae(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&Le.test(t.charAt(e)););return e}(t)+1).replace(Ie,""):t}var ze=Oe.Symbol,Fe=Object.prototype,Ue=Fe.hasOwnProperty,Ve=Fe.toString,Ke=ze?ze.toStringTag:void 0;var Ye=Object.prototype.toString;var Be=ze?ze.toStringTag:void 0;function Ze(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Be&&Be in Object(t)?function(t){var e=Ue.call(t,Ke),n=t[Ke];try{t[Ke]=void 0;var i=!0}catch(t){}var o=Ve.call(t);return i&&(e?t[Ke]=n:delete t[Ke]),o}(t):function(t){return Ye.call(t)}(t)}var Ne=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,He=/^0o[0-7]+$/i,qe=parseInt;function Qe(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==Ze(t)}(t))return NaN;if(je(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=je(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Ae(t);var n=Xe.test(t);return n||He.test(t)?qe(t.slice(2),n?2:8):Ne.test(t)?NaN:+t}var We=Math.max,Ge=Math.min;function $e(t,e,n){var i,o,s,r,a,h,l=0,c=!1,u=!1,p=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var n=i,s=o;return i=o=void 0,l=e,r=t.apply(s,n)}function f(t){var n=t-h;return void 0===h||n>=e||n<0||u&&t-l>=s}function m(){var t=Re();if(f(t))return _(t);a=setTimeout(m,function(t){var n=e-(t-h);return u?Ge(n,s-(t-l)):n}(t))}function _(t){return a=void 0,p&&i?d(t):(i=o=void 0,r)}function g(){var t=Re(),n=f(t);if(i=arguments,o=this,h=t,n){if(void 0===a)return function(t){return l=t,a=setTimeout(m,e),c?d(t):r}(h);if(u)return clearTimeout(a),a=setTimeout(m,e),d(h)}return void 0===a&&(a=setTimeout(m,e)),r}return e=Qe(e)||0,je(n)&&(c=!!n.leading,s=(u="maxWait"in n)?We(Qe(n.maxWait)||0,e):s,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==a&&clearTimeout(a),l=0,i=h=o=a=void 0},g.flush=function(){return void 0===a?r:_(Re())},g}function Je(t,e,n){return Object.defineProperty(t,"prototype",{writable:!1}),t}function tn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,o,s,r,a=[],h=!0,l=!1;try{if(s=(n=n.call(t)).next,0===e);else for(;!(h=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);h=!0);}catch(t){l=!0,o=t}finally{try{if(!h&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(l)throw o}}return a}}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return en(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return en(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var nn=Je((function t(e,n){var i=n.default,o=void 0===i?null:i,s=n.triggerUpdate,r=void 0===s||s,a=n.onChange,h=void 0===a?function(t,e){}:a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.name=e,this.defaultVal=o,this.triggerUpdate=r,this.onChange=h}));var on,sn,rn,an,hn,ln,cn,un,pn,dn,fn,mn,_n,gn,vn=window.THREE?window.THREE:{WebGLRenderer:t.WebGLRenderer,Scene:t.Scene,PerspectiveCamera:t.PerspectiveCamera,Raycaster:t.Raycaster,SRGBColorSpace:t.SRGBColorSpace,TextureLoader:t.TextureLoader,Vector2:t.Vector2,Vector3:t.Vector3,Box3:t.Box3,Color:t.Color,Mesh:t.Mesh,SphereGeometry:t.SphereGeometry,MeshBasicMaterial:t.MeshBasicMaterial,BackSide:t.BackSide,EventDispatcher:t.EventDispatcher,MOUSE:t.MOUSE,Quaternion:t.Quaternion,Spherical:t.Spherical,Clock:t.Clock},bn=(on={props:{width:{default:window.innerWidth,onChange:function(t,e,n){isNaN(t)&&(e.width=n)}},height:{default:window.innerHeight,onChange:function(t,e,n){isNaN(t)&&(e.height=n)}},backgroundColor:{default:"#000011"},backgroundImageUrl:{},onBackgroundImageLoaded:{},showNavInfo:{default:!0},skyRadius:{default:5e4},objects:{default:[]},lights:{default:[]},enablePointerInteraction:{default:!0,onChange:function(t,e){e.hoverObj=null,e.toolTipElem&&(e.toolTipElem.innerHTML="")},triggerUpdate:!1},lineHoverPrecision:{default:1,triggerUpdate:!1},hoverOrderComparator:{default:function(){return-1},triggerUpdate:!1},hoverFilter:{default:function(){return!0},triggerUpdate:!1},tooltipContent:{triggerUpdate:!1},hoverDuringDrag:{default:!1,triggerUpdate:!1},clickAfterDrag:{default:!1,triggerUpdate:!1},onHover:{default:function(){},triggerUpdate:!1},onClick:{default:function(){},triggerUpdate:!1},onRightClick:{triggerUpdate:!1}},methods:{tick:function(t){if(t.initialised){if(t.controls.update&&t.controls.update(Math.min(1,t.clock.getDelta())),t.postProcessingComposer?t.postProcessingComposer.render():t.renderer.render(t.scene,t.camera),t.extraRenderers.forEach((function(e){return e.render(t.scene,t.camera)})),t.enablePointerInteraction){var e=null;if(t.hoverDuringDrag||!t.isPointerDragging){var n=this.intersectingObjects(t.pointerPos.x,t.pointerPos.y).filter((function(e){return t.hoverFilter(e.object)})).sort((function(e,n){return t.hoverOrderComparator(e.object,n.object)})),i=n.length?n[0]:null;e=i?i.object:null,t.intersectionPoint=i?i.point:null}e!==t.hoverObj&&(t.onHover(e,t.hoverObj),t.toolTipElem.innerHTML=e&&("function"==typeof(o=t.tooltipContent)?o:"string"==typeof o?function(t){return t[o]}:function(t){return o})(e)||"",t.hoverObj=e)}t.tweenGroup.update()}var o;return this},getPointerPos:function(t){var e=t.pointerPos;return{x:e.x,y:e.y}},cameraPosition:function(t,e,n,i){var o=t.camera;if(e&&t.initialised){var s=e,r=n||{x:0,y:0,z:0};if(i){var a=Object.assign({},o.position),h=u();t.tweenGroup.add(new Me(a).to(s,i).easing(we.Quadratic.Out).onUpdate(l).start()),t.tweenGroup.add(new Me(h).to(r,i/3).easing(we.Quadratic.Out).onUpdate(c).start())}else l(s),c(r);return this}return Object.assign({},o.position,{lookAt:u()});function l(t){var e=t.x,n=t.y,i=t.z;void 0!==e&&(o.position.x=e),void 0!==n&&(o.position.y=n),void 0!==i&&(o.position.z=i)}function c(e){var n=new vn.Vector3(e.x,e.y,e.z);t.controls.target?t.controls.target=n:o.lookAt(n)}function u(){return Object.assign(new vn.Vector3(0,0,-1e3).applyQuaternion(o.quaternion).add(o.position))}},zoomToFit:function(t){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,i=arguments.length,o=new Array(i>3?i-3:0),s=3;s<i;s++)o[s-3]=arguments[s];return this.fitToBbox(this.getBbox.apply(this,o),e,n)},fitToBbox:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,r=t.camera;if(e){var a=new vn.Vector3(0,0,0),h=2*Math.max.apply(Math,o(Object.entries(e).map((function(t){var e=i(t,2),n=e[0],s=e[1];return Math.max.apply(Math,o(s.map((function(t){return Math.abs(a[n]-t)}))))})))),l=(1-2*s/t.height)*r.fov,c=h/Math.atan(l*Math.PI/180),u=c/r.aspect,p=Math.max(c,u);if(p>0){var d=a.clone().sub(r.position).normalize().multiplyScalar(-p);this.cameraPosition(d,a,n)}}return this},getBbox:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return!0},i=new vn.Box3(new vn.Vector3(0,0,0),new vn.Vector3(0,0,0)),s=t.objects.filter(e);return s.length?(s.forEach((function(t){return i.expandByObject(t)})),Object.assign.apply(Object,o(["x","y","z"].map((function(t){return n({},t,[i.min[t],i.max[t]])}))))):null},getScreenCoords:function(t,e,n,i){var o=new vn.Vector3(e,n,i);return o.project(this.camera()),{x:(o.x+1)*t.width/2,y:-(o.y-1)*t.height/2}},getSceneCoords:function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=new vn.Vector2(e/t.width*2-1,-n/t.height*2+1),s=new vn.Raycaster;return s.setFromCamera(o,t.camera),Object.assign({},s.ray.at(i,new vn.Vector3))},intersectingObjects:function(t,e,n){var i=new vn.Vector2(e/t.width*2-1,-n/t.height*2+1),o=new vn.Raycaster;return o.params.Line.threshold=t.lineHoverPrecision,o.setFromCamera(i,t.camera),o.intersectObjects(t.objects,!0)},renderer:function(t){return t.renderer},scene:function(t){return t.scene},camera:function(t){return t.camera},postProcessingComposer:function(t){return t.postProcessingComposer},controls:function(t){return t.controls},tbControls:function(t){return t.controls}},stateInit:function(){return{scene:new vn.Scene,camera:new vn.PerspectiveCamera,clock:new vn.Clock,tweenGroup:new Ee}},init:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.controlType,s=void 0===i?"trackball":i,r=n.rendererConfig,a=void 0===r?{}:r,h=n.extraRenderers,l=void 0===h?[]:h,c=n.waitForLoadComplete,u=void 0===c||c;t.innerHTML="",t.appendChild(e.container=document.createElement("div")),e.container.className="scene-container",e.container.style.position="relative",e.container.appendChild(e.navInfo=document.createElement("div")),e.navInfo.className="scene-nav-info",e.navInfo.textContent={orbit:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",trackball:"Left-click: rotate, Mouse-wheel/middle-click: zoom, Right-click: pan",fly:"WASD: move, R|F: up | down, Q|E: roll, up|down: pitch, left|right: yaw"}[s]||"",e.navInfo.style.display=e.showNavInfo?null:"none",e.toolTipElem=document.createElement("div"),e.toolTipElem.classList.add("scene-tooltip"),e.container.appendChild(e.toolTipElem),e.pointerPos=new vn.Vector2,e.pointerPos.x=-2,e.pointerPos.y=-2,["pointermove","pointerdown"].forEach((function(t){return e.container.addEventListener(t,(function(n){if("pointerdown"===t&&(e.isPointerPressed=!0),!e.isPointerDragging&&"pointermove"===n.type&&(n.pressure>0||e.isPointerPressed)&&("touch"!==n.pointerType||void 0===n.movementX||[n.movementX,n.movementY].some((function(t){return Math.abs(t)>1})))&&(e.isPointerDragging=!0),e.enablePointerInteraction){var i=(o=e.container,s=o.getBoundingClientRect(),r=window.pageXOffset||document.documentElement.scrollLeft,a=window.pageYOffset||document.documentElement.scrollTop,{top:s.top+a,left:s.left+r});e.pointerPos.x=n.pageX-i.left,e.pointerPos.y=n.pageY-i.top,e.toolTipElem.style.top="".concat(e.pointerPos.y,"px"),e.toolTipElem.style.left="".concat(e.pointerPos.x,"px"),e.toolTipElem.style.transform="translate(-".concat(e.pointerPos.x/e.width*100,"%, ").concat(e.height-e.pointerPos.y<100?"calc(-100% - 8px)":"21px",")")}var o,s,r,a}),{passive:!0})})),e.container.addEventListener("pointerup",(function(t){e.isPointerPressed=!1,e.isPointerDragging&&(e.isPointerDragging=!1,!e.clickAfterDrag)||requestAnimationFrame((function(){0===t.button&&e.onClick(e.hoverObj||null,t,e.intersectionPoint),2===t.button&&e.onRightClick&&e.onRightClick(e.hoverObj||null,t,e.intersectionPoint)}))}),{passive:!0,capture:!0}),e.container.addEventListener("contextmenu",(function(t){e.onRightClick&&t.preventDefault()})),e.renderer=new vn.WebGLRenderer(Object.assign({antialias:!0,alpha:!0},a)),e.renderer.setPixelRatio(Math.min(2,window.devicePixelRatio)),e.container.appendChild(e.renderer.domElement),e.extraRenderers=l,e.extraRenderers.forEach((function(t){t.domElement.style.position="absolute",t.domElement.style.top="0px",t.domElement.style.pointerEvents="none",e.container.appendChild(t.domElement)})),e.postProcessingComposer=new zt(e.renderer),e.postProcessingComposer.addPass(new Ft(e.scene,e.camera)),e.controls=new{trackball:C,orbit:ot,fly:yt}[s](e.camera,e.renderer.domElement),"fly"===s&&(e.controls.movementSpeed=300,e.controls.rollSpeed=Math.PI/6,e.controls.dragToLook=!0),"trackball"!==s&&"orbit"!==s||(e.controls.minDistance=.1,e.controls.maxDistance=e.skyRadius,e.controls.addEventListener("start",(function(){e.controlsEngaged=!0})),e.controls.addEventListener("change",(function(){e.controlsEngaged&&(e.controlsDragging=!0)})),e.controls.addEventListener("end",(function(){e.controlsEngaged=!1,e.controlsDragging=!1}))),[e.renderer,e.postProcessingComposer].concat(o(e.extraRenderers)).forEach((function(t){return t.setSize(e.width,e.height)})),e.camera.aspect=e.width/e.height,e.camera.updateProjectionMatrix(),e.camera.position.z=1e3,e.scene.add(e.skysphere=new vn.Mesh),e.skysphere.visible=!1,e.loadComplete=e.scene.visible=!u,window.scene=e.scene},update:function(t,e){if(t.width&&t.height&&(e.hasOwnProperty("width")||e.hasOwnProperty("height"))&&(t.container.style.width="".concat(t.width,"px"),t.container.style.height="".concat(t.height,"px"),[t.renderer,t.postProcessingComposer].concat(o(t.extraRenderers)).forEach((function(e){return e.setSize(t.width,t.height)})),t.camera.aspect=t.width/t.height,t.camera.updateProjectionMatrix()),e.hasOwnProperty("skyRadius")&&t.skyRadius&&(t.controls.hasOwnProperty("maxDistance")&&e.skyRadius&&(t.controls.maxDistance=Math.min(t.controls.maxDistance,t.skyRadius)),t.camera.far=2.5*t.skyRadius,t.camera.updateProjectionMatrix(),t.skysphere.geometry=new vn.SphereGeometry(t.skyRadius)),e.hasOwnProperty("backgroundColor")){var n=se(t.backgroundColor).alpha;void 0===n&&(n=1),t.renderer.setClearColor(new vn.Color(be(1,t.backgroundColor)),n)}function i(){t.loadComplete=t.scene.visible=!0}e.hasOwnProperty("backgroundImageUrl")&&(t.backgroundImageUrl?(new vn.TextureLoader).load(t.backgroundImageUrl,(function(e){e.colorSpace=vn.SRGBColorSpace,t.skysphere.material=new vn.MeshBasicMaterial({map:e,side:vn.BackSide}),t.skysphere.visible=!0,t.onBackgroundImageLoaded&&setTimeout(t.onBackgroundImageLoaded),!t.loadComplete&&i()})):(t.skysphere.visible=!1,t.skysphere.material.map=null,!t.loadComplete&&i())),e.hasOwnProperty("showNavInfo")&&(t.navInfo.style.display=t.showNavInfo?null:"none"),e.hasOwnProperty("lights")&&((e.lights||[]).forEach((function(e){return t.scene.remove(e)})),t.lights.forEach((function(e){return t.scene.add(e)}))),e.hasOwnProperty("objects")&&((e.objects||[]).forEach((function(e){return t.scene.remove(e)})),t.objects.forEach((function(e){return t.scene.add(e)})))}},sn=on.stateInit,rn=void 0===sn?function(){return{}}:sn,an=on.props,hn=void 0===an?{}:an,ln=on.methods,cn=void 0===ln?{}:ln,un=on.aliases,pn=void 0===un?{}:un,dn=on.init,fn=void 0===dn?function(){}:dn,mn=on.update,_n=void 0===mn?function(){}:mn,gn=Object.keys(hn).map((function(t){return new nn(t,hn[t])})),function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},rn instanceof Function?rn(t):rn,{initialised:!1}),n={};function i(e){return o(e,t),s(),i}var o=function(t,n){fn.call(i,t,e,n),e.initialised=!0},s=$e((function(){e.initialised&&(_n.call(i,e,n),n={})}),1);return gn.forEach((function(t){i[t.name]=function(t){var o=t.name,r=t.triggerUpdate,a=void 0!==r&&r,h=t.onChange,l=void 0===h?function(t,e){}:h,c=t.defaultVal,u=void 0===c?null:c;return function(t){var r=e[o];if(!arguments.length)return r;var h=void 0===t?u:t;return e[o]=h,l.call(i,h,e,r),!n.hasOwnProperty(o)&&(n[o]=r),a&&s(),i}}(t)})),Object.keys(cn).forEach((function(t){i[t]=function(){for(var n,o=arguments.length,s=new Array(o),r=0;r<o;r++)s[r]=arguments[r];return(n=cn[t]).call.apply(n,[i,e].concat(s))}})),Object.entries(pn).forEach((function(t){var e=tn(t,2),n=e[0],o=e[1];return i[n]=i[o]})),i.resetProps=function(){return gn.forEach((function(t){i[t.name](t.defaultVal)})),i},i.resetProps(),e._rerender=s,i});return bn}));
|