@yhsoft/model-viewer
Version:
基于 ThreeJS 开发的三维模型查看器,支持多种 3D 格式的模型浏览,支持对模型的旋转、平移、缩放等操作
2 lines • 201 kB
JavaScript
(function(){"use strict";try{if(typeof document<"u"){var A=document.createElement("style");A.appendChild(document.createTextNode('@font-face{font-family:icon-font;src:url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAj4AAsAAAAADOgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAARAAAAGA8FU5qY21hcAAAAYgAAACDAAAB5IsNOc1nbHlmAAACDAAABMgAAAYIKuKLzGhlYWQAAAbUAAAALgAAADYlaETCaGhlYQAABwQAAAAcAAAAJAfeA4lobXR4AAAHIAAAAA4AAAAgIAAAAGxvY2EAAAcwAAAAEgAAABIHvAWibWF4cAAAB0QAAAAfAAAAIAEjAJtuYW1lAAAHZAAAAUAAAAJnEKM8sHBvc3QAAAikAAAAVAAAAHEct+ajeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGFhYJzAwMrAwNTJdIaBgaEfQjO+ZjBi5ACKMrAyM2AFAWmuKQwHnjG8nsXc8L+BgYH5DgOQZGBEUcQEAHRJDP94nO2RzQnDMAyFP9luUkoOPWWKzlLIDp2ip44RMqAuHiLVTygdIjKfsR4ygveAC1CNh9FAPgheb1Ml9Mot9MbT+okrhaZFZ1362rd9B+W/+5XY9P04MNouYbDfNTYNnDXF/Tq60Z1M4i2JZ6Ql8Ux0TsxLdEnMVfqaeJ59S2hfoSsjggB4nHVUTWwTVxB+s+vdt7u2117vn50oa8cbeyEGO/F6vQFqAyEppNBAEYRWaZpiKCDlkAYqcaAHF3Go1CQX2qoCESRXlar40ktphSpQe6naO/TEqT+q2kM40FYVaNtZo0j00PfeaN7Mm/lm93s/JELIP1fZP9kzRCPj5G2ySghQX+Uc6jsFo+pzqGmBdR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rkmZc7jeoh891oaNY5NKVd55moiYYAb1asWTg==) format("woff")}.icon-font[data-v-83a05677]{font-family:icon-font!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-axis[data-v-83a05677]:before{content:""}.icon-model[data-v-83a05677]:before{content:""}.icon-revert-screen[data-v-83a05677]:before{content:""}.icon-full-screen[data-v-83a05677]:before{content:""}.icon-rotate[data-v-83a05677]:before{content:""}.icon-translate[data-v-83a05677]:before{content:""}.icon-scale[data-v-83a05677]:before{content:""}.wrapper{height:100%;width:100%;left:0;top:0;bottom:0;right:0;z-index:999;transition:all .6s}.model-container{height:inherit;width:inherit;position:relative}.model-container .loading{display:flex;justify-content:center;align-items:center;position:absolute;width:inherit;height:inherit;background-color:#ffffff90;color:#0009}.model-container .toolbar{position:absolute;right:16px;top:50%;transform:translateY(-50%)}.model-container .toolbar-item{border-radius:6px;padding:6px 8px;margin:8px auto;cursor:pointer;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;background-color:#fff}.model-container .toolbar-item:hover{transition:all .3s}.model-container .toolbar-item:hover .icon-font{color:#4096ff}.model-container .toolbar-item .icon-font{font-size:20px;color:#000c}.model-container .toolbar-item.active{background-color:#4096ff;border-color:#004ba6}.model-container .toolbar-item.active .icon-font{color:#fff}.model-container .copyright{position:absolute;left:16px;bottom:16px;cursor:pointer}.model-container .copyright img{width:100px;opacity:.85}')),document.head.appendChild(A)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
(function(Ce,q){typeof exports=="object"&&typeof module<"u"?q(exports,require("vue"),require("three"),require("lodash.merge")):typeof define=="function"&&define.amd?define(["exports","vue","three","lodash.merge"],q):(Ce=typeof globalThis<"u"?globalThis:Ce||self,q(Ce.ModelViewer={},Ce.Vue,Ce.THREE,Ce.merge))})(this,function(Ce,q,i,Ln){"use strict";function Pn(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const n in p)if(n!=="default"){const t=Object.getOwnPropertyDescriptor(p,n);Object.defineProperty(e,n,t.get?t:{enumerable:!0,get:()=>p[n]})}}return e.default=p,Object.freeze(e)}const he=Pn(i),jt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAAAfCAYAAAAFvjTyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAPh0lEQVR4nO2ce7BeVXnGf886uR5yASEIBASBEBpuAdqKIo7AcB0Yb5QMKFiw4oAapVUEOlwUx0LL1CJWQGkNKtpgHEbCHUEESooGwSgYCAkEJCDXBAKcJOesp3+svb99/c75DsXptJNn5kuy1+Vd71r7Xe9trR3ZZiM24q1G+N9mYCP+f2IMwOrvvB0MsrB4l6zjQW/vof+QFecCL8oAOhj0yWYzPwPMB/7LIY5IVFGAit4yyCjm+8CkPRFxMLLAo90jBR8FDYGc/u4wY0xWX+WywmPB6xAEQwxZn4LX7ijTcamPamX1tqnOIdUV65PPK2bleZ8mv6nYibyozj2j0X19y3wVmPqpZ5NglbC3HC4HZrdz0MaTzgG/mD1+FvhASyuA94M/CjzcK+3/u9joXpQFawaEe4EJvXf3U+Cns4etQS1C1cFs0G1YOwLrsv7dNtF5wPbAG0A/cA/wbyMwM7VnthPW9NBmK+D9oEFgQVGsALoY2KbWfhB0BQ53986G3g18nCSN40C3gue3tAM4BPirNA4mrc1DwMW9j9dBH2mNDwANtI/ZGfsk4LCWijuBy9t6jAFQDB8GPsaohArAnwbWZZM+oIcO28hhL+CXGcNATOajImE6GrRv58n6axzvAiYBM0HbA7MgTMfxK8A7gUtGxbr0I+NTO8KdlMws0GzgvaC/AHbDmigweBzpheam42jQzg2yDn3YIwhW2dSyAetTRYEng+Y3dpwMaDpuuBpPYi5umupWHAXsC9oT2JskWCGb+w1WXFunk1nJ3QVzWuZxDGnDb+hwn5nfXGMdCnpXL5yVRvyq5YXJNwPQzB57ji/+mfwZVfwVAz4DdHu1W3iE5moja1lWPjqNZeZIPtX5kOgi0BldrNjTnX8lnysi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HfQ9tGCTWN3ewHlQ9Wu5rXxShOodPbwgyCRnOXaT3EhcCPm7IyKqyne1Y8x0g3PHu9Pj0cXnkLaAyH/Giq7SbrcHX0UJfjzc5hzchNErTxPwXZiD8FNv6nIBvxJ8F/A9m45OBuNYqwAAAAAElFTkSuQmCC";class In extends i.Scene{constructor(e=null){super();const n=new i.BoxGeometry;n.deleteAttribute("uv");const t=new i.MeshStandardMaterial({side:i.BackSide}),s=new i.MeshStandardMaterial;let r=5;e!==null&&e._useLegacyLights===!1&&(r=900);const o=new i.PointLight(16777215,r,28,2);o.position.set(.418,16.199,.3),this.add(o);const a=new i.Mesh(n,t);a.position.set(-.757,13.219,.717),a.scale.set(31.713,28.305,28.591),this.add(a);const c=new i.Mesh(n,s);c.position.set(-10.906,2.009,1.846),c.rotation.set(0,-.195,0),c.scale.set(2.328,7.905,4.651),this.add(c);const l=new i.Mesh(n,s);l.position.set(-5.607,-.754,-.758),l.rotation.set(0,.994,0),l.scale.set(1.97,1.534,3.955),this.add(l);const h=new i.Mesh(n,s);h.position.set(6.167,.857,7.803),h.rotation.set(0,.561,0),h.scale.set(3.927,6.285,3.687),this.add(h);const u=new i.Mesh(n,s);u.position.set(-2.017,.018,6.124),u.rotation.set(0,.333,0),u.scale.set(2.002,4.566,2.064),this.add(u);const d=new i.Mesh(n,s);d.position.set(2.291,-.756,-2.621),d.rotation.set(0,-.286,0),d.scale.set(1.546,1.552,1.496),this.add(d);const f=new i.Mesh(n,s);f.position.set(-2.193,-.369,-5.547),f.rotation.set(0,.516,0),f.scale.set(3.875,3.487,2.986),this.add(f);const g=new i.Mesh(n,qe(50));g.position.set(-16.116,14.37,8.208),g.scale.set(.1,2.428,2.739),this.add(g);const b=new i.Mesh(n,qe(50));b.position.set(-16.109,18.021,-8.207),b.scale.set(.1,2.425,2.751),this.add(b);const w=new i.Mesh(n,qe(17));w.position.set(14.904,12.198,-1.832),w.scale.set(.15,4.265,6.331),this.add(w);const v=new i.Mesh(n,qe(43));v.position.set(-.462,8.89,14.52),v.scale.set(4.38,5.441,.088),this.add(v);const L=new i.Mesh(n,qe(20));L.position.set(3.235,11.486,-12.541),L.scale.set(2.5,2,.1),this.add(L);const F=new i.Mesh(n,qe(100));F.position.set(0,20,0),F.scale.set(1,.1,1),this.add(F)}dispose(){const e=new Set;this.traverse(n=>{n.isMesh&&(e.add(n.geometry),e.add(n.material))});for(const n of e)n.dispose()}}function qe(p){const e=new i.MeshBasicMaterial;return e.color.setScalar(p),e}const Ut={type:"change"},mt={type:"start"},Vt={type:"end"},at=new i.Ray,zt=new i.Plane,_n=Math.cos(70*i.MathUtils.DEG2RAD);class Cn extends i.EventDispatcher{constructor(e,n){super(),this.object=e,this.domElement=n,this.domElement.style.touchAction="none",this.enabled=!0,this.target=new i.Vector3,this.cursor=new i.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:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN},this.touches={ONE:i.TOUCH.ROTATE,TWO:i.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 a.phi},this.getAzimuthalAngle=function(){return a.theta},this.getDistance=function(){return this.object.position.distanceTo(this.target)},this.listenToKeyEvents=function(m){m.addEventListener("keydown",Re),this._domElementKeyEvents=m},this.stopListenToKeyEvents=function(){this._domElementKeyEvents.removeEventListener("keydown",Re),this._domElementKeyEvents=null},this.saveState=function(){t.target0.copy(t.target),t.position0.copy(t.object.position),t.zoom0=t.object.zoom},this.reset=function(){t.target.copy(t.target0),t.object.position.copy(t.position0),t.object.zoom=t.zoom0,t.object.updateProjectionMatrix(),t.dispatchEvent(Ut),t.update(),r=s.NONE},this.update=function(){const m=new i.Vector3,j=new i.Quaternion().setFromUnitVectors(e.up,new i.Vector3(0,1,0)),ne=j.clone().invert(),le=new i.Vector3,xe=new i.Quaternion,ze=new i.Vector3,Pe=2*Math.PI;return function(Ao=null){const Sn=t.object.position;m.copy(Sn).sub(t.target),m.applyQuaternion(j),a.setFromVector3(m),t.autoRotate&&r===s.NONE&&H(z(Ao)),t.enableDamping?(a.theta+=c.theta*t.dampingFactor,a.phi+=c.phi*t.dampingFactor):(a.theta+=c.theta,a.phi+=c.phi);let Be=t.minAzimuthAngle,Ne=t.maxAzimuthAngle;isFinite(Be)&&isFinite(Ne)&&(Be<-Math.PI?Be+=Pe:Be>Math.PI&&(Be-=Pe),Ne<-Math.PI?Ne+=Pe:Ne>Math.PI&&(Ne-=Pe),Be<=Ne?a.theta=Math.max(Be,Math.min(Ne,a.theta)):a.theta=a.theta>(Be+Ne)/2?Math.max(Be,a.theta):Math.min(Ne,a.theta)),a.phi=Math.max(t.minPolarAngle,Math.min(t.maxPolarAngle,a.phi)),a.makeSafe(),t.enableDamping===!0?t.target.addScaledVector(h,t.dampingFactor):t.target.add(h),t.target.sub(t.cursor),t.target.clampLength(t.minTargetRadius,t.maxTargetRadius),t.target.add(t.cursor),t.zoomToCursor&&G||t.object.isOrthographicCamera?a.radius=oe(a.radius):a.radius=oe(a.radius*l),m.setFromSpherical(a),m.applyQuaternion(ne),Sn.copy(t.target).add(m),t.object.lookAt(t.target),t.enableDamping===!0?(c.theta*=1-t.dampingFactor,c.phi*=1-t.dampingFactor,h.multiplyScalar(1-t.dampingFactor)):(c.set(0,0,0),h.set(0,0,0));let Tt=!1;if(t.zoomToCursor&&G){let ot=null;if(t.object.isPerspectiveCamera){const it=m.length();ot=oe(it*l);const ft=it-ot;t.object.position.addScaledVector(B,ft),t.object.updateMatrixWorld()}else if(t.object.isOrthographicCamera){const it=new i.Vector3(X.x,X.y,0);it.unproject(t.object),t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/l)),t.object.updateProjectionMatrix(),Tt=!0;const ft=new i.Vector3(X.x,X.y,0);ft.unproject(t.object),t.object.position.sub(ft).add(it),t.object.updateMatrixWorld(),ot=m.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),t.zoomToCursor=!1;ot!==null&&(this.screenSpacePanning?t.target.set(0,0,-1).transformDirection(t.object.matrix).multiplyScalar(ot).add(t.object.position):(at.origin.copy(t.object.position),at.direction.set(0,0,-1).transformDirection(t.object.matrix),Math.abs(t.object.up.dot(at.direction))<_n?e.lookAt(t.target):(zt.setFromNormalAndCoplanarPoint(t.object.up,t.target),at.intersectPlane(zt,t.target))))}else t.object.isOrthographicCamera&&(t.object.zoom=Math.max(t.minZoom,Math.min(t.maxZoom,t.object.zoom/l)),t.object.updateProjectionMatrix(),Tt=!0);return l=1,G=!1,Tt||le.distanceToSquared(t.object.position)>o||8*(1-xe.dot(t.object.quaternion))>o||ze.distanceToSquared(t.target)>0?(t.dispatchEvent(Ut),le.copy(t.object.position),xe.copy(t.object.quaternion),ze.copy(t.target),!0):!1}}(),this.dispose=function(){t.domElement.removeEventListener("contextmenu",xn),t.domElement.removeEventListener("pointerdown",$),t.domElement.removeEventListener("pointercancel",te),t.domElement.removeEventListener("wheel",ke),t.domElement.removeEventListener("pointermove",E),t.domElement.removeEventListener("pointerup",te),t._domElementKeyEvents!==null&&(t._domElementKeyEvents.removeEventListener("keydown",Re),t._domElementKeyEvents=null)};const t=this,s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let r=s.NONE;const o=1e-6,a=new i.Spherical,c=new i.Spherical;let l=1;const h=new i.Vector3,u=new i.Vector2,d=new i.Vector2,f=new i.Vector2,g=new i.Vector2,b=new i.Vector2,w=new i.Vector2,v=new i.Vector2,L=new i.Vector2,F=new i.Vector2,B=new i.Vector3,X=new i.Vector2;let G=!1;const T=[],O={};let V=!1;function z(m){return m!==null?2*Math.PI/60*t.autoRotateSpeed*m:2*Math.PI/60/60*t.autoRotateSpeed}function R(m){const j=Math.abs(m*.01);return Math.pow(.95,t.zoomSpeed*j)}function H(m){c.theta-=m}function J(m){c.phi-=m}const U=function(){const m=new i.Vector3;return function(ne,le){m.setFromMatrixColumn(le,0),m.multiplyScalar(-ne),h.add(m)}}(),W=function(){const m=new i.Vector3;return function(ne,le){t.screenSpacePanning===!0?m.setFromMatrixColumn(le,1):(m.setFromMatrixColumn(le,0),m.crossVectors(t.object.up,m)),m.multiplyScalar(ne),h.add(m)}}(),Y=function(){const m=new i.Vector3;return function(ne,le){const xe=t.domElement;if(t.object.isPerspectiveCamera){const ze=t.object.position;m.copy(ze).sub(t.target);let Pe=m.length();Pe*=Math.tan(t.object.fov/2*Math.PI/180),U(2*ne*Pe/xe.clientHeight,t.object.matrix),W(2*le*Pe/xe.clientHeight,t.object.matrix)}else t.object.isOrthographicCamera?(U(ne*(t.object.right-t.object.left)/t.object.zoom/xe.clientWidth,t.object.matrix),W(le*(t.object.top-t.object.bottom)/t.object.zoom/xe.clientHeight,t.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),t.enablePan=!1)}}();function ie(m){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?l/=m:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function ge(m){t.object.isPerspectiveCamera||t.object.isOrthographicCamera?l*=m:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),t.enableZoom=!1)}function se(m,j){if(!t.zoomToCursor)return;G=!0;const ne=t.domElement.getBoundingClientRect(),le=m-ne.left,xe=j-ne.top,ze=ne.width,Pe=ne.height;X.x=le/ze*2-1,X.y=-(xe/Pe)*2+1,B.set(X.x,X.y,1).unproject(t.object).sub(t.object.position).normalize()}function oe(m){return Math.max(t.minDistance,Math.min(t.maxDistance,m))}function Ae(m){u.set(m.clientX,m.clientY)}function re(m){se(m.clientX,m.clientX),v.set(m.clientX,m.clientY)}function de(m){g.set(m.clientX,m.clientY)}function M(m){d.set(m.clientX,m.clientY),f.subVectors(d,u).multiplyScalar(t.rotateSpeed);const j=t.domElement;H(2*Math.PI*f.x/j.clientHeight),J(2*Math.PI*f.y/j.clientHeight),u.copy(d),t.update()}function A(m){L.set(m.clientX,m.clientY),F.subVectors(L,v),F.y>0?ie(R(F.y)):F.y<0&&ge(R(F.y)),v.copy(L),t.update()}function I(m){b.set(m.clientX,m.clientY),w.subVectors(b,g).multiplyScalar(t.panSpeed),Y(w.x,w.y),g.copy(b),t.update()}function D(m){se(m.clientX,m.clientY),m.deltaY<0?ge(R(m.deltaY)):m.deltaY>0&&ie(R(m.deltaY)),t.update()}function _(m){let j=!1;switch(m.code){case t.keys.UP:m.ctrlKey||m.metaKey||m.shiftKey?J(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):Y(0,t.keyPanSpeed),j=!0;break;case t.keys.BOTTOM:m.ctrlKey||m.metaKey||m.shiftKey?J(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):Y(0,-t.keyPanSpeed),j=!0;break;case t.keys.LEFT:m.ctrlKey||m.metaKey||m.shiftKey?H(2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):Y(t.keyPanSpeed,0),j=!0;break;case t.keys.RIGHT:m.ctrlKey||m.metaKey||m.shiftKey?H(-2*Math.PI*t.rotateSpeed/t.domElement.clientHeight):Y(-t.keyPanSpeed,0),j=!0;break}j&&(m.preventDefault(),t.update())}function C(m){if(T.length===1)u.set(m.pageX,m.pageY);else{const j=Je(m),ne=.5*(m.pageX+j.x),le=.5*(m.pageY+j.y);u.set(ne,le)}}function k(m){if(T.length===1)g.set(m.pageX,m.pageY);else{const j=Je(m),ne=.5*(m.pageX+j.x),le=.5*(m.pageY+j.y);g.set(ne,le)}}function N(m){const j=Je(m),ne=m.pageX-j.x,le=m.pageY-j.y,xe=Math.sqrt(ne*ne+le*le);v.set(0,xe)}function P(m){t.enableZoom&&N(m),t.enablePan&&k(m)}function y(m){t.enableZoom&&N(m),t.enableRotate&&C(m)}function x(m){if(T.length==1)d.set(m.pageX,m.pageY);else{const ne=Je(m),le=.5*(m.pageX+ne.x),xe=.5*(m.pageY+ne.y);d.set(le,xe)}f.subVectors(d,u).multiplyScalar(t.rotateSpeed);const j=t.domElement;H(2*Math.PI*f.x/j.clientHeight),J(2*Math.PI*f.y/j.clientHeight),u.copy(d)}function S(m){if(T.length===1)b.set(m.pageX,m.pageY);else{const j=Je(m),ne=.5*(m.pageX+j.x),le=.5*(m.pageY+j.y);b.set(ne,le)}w.subVectors(b,g).multiplyScalar(t.panSpeed),Y(w.x,w.y),g.copy(b)}function K(m){const j=Je(m),ne=m.pageX-j.x,le=m.pageY-j.y,xe=Math.sqrt(ne*ne+le*le);L.set(0,xe),F.set(0,Math.pow(L.y/v.y,t.zoomSpeed)),ie(F.y),v.copy(L);const ze=(m.pageX+j.x)*.5,Pe=(m.pageY+j.y)*.5;se(ze,Pe)}function Q(m){t.enableZoom&&K(m),t.enablePan&&S(m)}function ce(m){t.enableZoom&&K(m),t.enableRotate&&x(m)}function $(m){t.enabled!==!1&&(T.length===0&&(t.domElement.setPointerCapture(m.pointerId),t.domElement.addEventListener("pointermove",E),t.domElement.addEventListener("pointerup",te)),yo(m),m.pointerType==="touch"?mo(m):me(m))}function E(m){t.enabled!==!1&&(m.pointerType==="touch"?go(m):ye(m))}function te(m){wo(m),T.length===0&&(t.domElement.releasePointerCapture(m.pointerId),t.domElement.removeEventListener("pointermove",E),t.domElement.removeEventListener("pointerup",te)),t.dispatchEvent(Vt),r=s.NONE}function me(m){let j;switch(m.button){case 0:j=t.mouseButtons.LEFT;break;case 1:j=t.mouseButtons.MIDDLE;break;case 2:j=t.mouseButtons.RIGHT;break;default:j=-1}switch(j){case i.MOUSE.DOLLY:if(t.enableZoom===!1)return;re(m),r=s.DOLLY;break;case i.MOUSE.ROTATE:if(m.ctrlKey||m.metaKey||m.shiftKey){if(t.enablePan===!1)return;de(m),r=s.PAN}else{if(t.enableRotate===!1)return;Ae(m),r=s.ROTATE}break;case i.MOUSE.PAN:if(m.ctrlKey||m.metaKey||m.shiftKey){if(t.enableRotate===!1)return;Ae(m),r=s.ROTATE}else{if(t.enablePan===!1)return;de(m),r=s.PAN}break;default:r=s.NONE}r!==s.NONE&&t.dispatchEvent(mt)}function ye(m){switch(r){case s.ROTATE:if(t.enableRotate===!1)return;M(m);break;case s.DOLLY:if(t.enableZoom===!1)return;A(m);break;case s.PAN:if(t.enablePan===!1)return;I(m);break}}function ke(m){t.enabled===!1||t.enableZoom===!1||r!==s.NONE||(m.preventDefault(),t.dispatchEvent(mt),D(Oe(m)),t.dispatchEvent(Vt))}function Oe(m){const j=m.deltaMode,ne={clientX:m.clientX,clientY:m.clientY,deltaY:m.deltaY};switch(j){case 1:ne.deltaY*=16;break;case 2:ne.deltaY*=100;break}return m.ctrlKey&&!V&&(ne.deltaY*=10),ne}function We(m){m.key==="Control"&&(V=!0,document.addEventListener("keyup",be,{passive:!0,capture:!0}))}function be(m){m.key==="Control"&&(V=!1,document.removeEventListener("keyup",be,{passive:!0,capture:!0}))}function Re(m){t.enabled===!1||t.enablePan===!1||_(m)}function mo(m){switch(vn(m),T.length){case 1:switch(t.touches.ONE){case i.TOUCH.ROTATE:if(t.enableRotate===!1)return;C(m),r=s.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(t.enablePan===!1)return;k(m),r=s.TOUCH_PAN;break;default:r=s.NONE}break;case 2:switch(t.touches.TWO){case i.TOUCH.DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;P(m),r=s.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;y(m),r=s.TOUCH_DOLLY_ROTATE;break;default:r=s.NONE}break;default:r=s.NONE}r!==s.NONE&&t.dispatchEvent(mt)}function go(m){switch(vn(m),r){case s.TOUCH_ROTATE:if(t.enableRotate===!1)return;x(m),t.update();break;case s.TOUCH_PAN:if(t.enablePan===!1)return;S(m),t.update();break;case s.TOUCH_DOLLY_PAN:if(t.enableZoom===!1&&t.enablePan===!1)return;Q(m),t.update();break;case s.TOUCH_DOLLY_ROTATE:if(t.enableZoom===!1&&t.enableRotate===!1)return;ce(m),t.update();break;default:r=s.NONE}}function xn(m){t.enabled!==!1&&m.preventDefault()}function yo(m){T.push(m.pointerId)}function wo(m){delete O[m.pointerId];for(let j=0;j<T.length;j++)if(T[j]==m.pointerId){T.splice(j,1);return}}function vn(m){let j=O[m.pointerId];j===void 0&&(j=new i.Vector2,O[m.pointerId]=j),j.set(m.pageX,m.pageY)}function Je(m){const j=m.pointerId===T[0]?T[1]:T[0];return O[j]}t.domElement.addEventListener("contextmenu",xn),t.domElement.addEventListener("pointerdown",$),t.domElement.addEventListener("pointercancel",te),t.domElement.addEventListener("wheel",ke,{passive:!1}),document.addEventListener("keydown",We,{passive:!0,capture:!0}),this.update()}}const Xe=new i.Raycaster,we=new i.Vector3,Ge=new i.Vector3,pe=new i.Quaternion,Xt={X:new i.Vector3(1,0,0),Y:new i.Vector3(0,1,0),Z:new i.Vector3(0,0,1)},gt={type:"change"},Yt={type:"mouseDown"},Kt={type:"mouseUp",mode:null},Wt={type:"objectChange"};class Fn extends i.Object3D{constructor(e,n){super(),n===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),n=document),this.isTransformControls=!0,this.visible=!1,this.domElement=n,this.domElement.style.touchAction="none";const t=new Gn;this._gizmo=t,this.add(t);const s=new Tn;this._plane=s,this.add(s);const r=this;function o(L,F){let B=F;Object.defineProperty(r,L,{get:function(){return B!==void 0?B:F},set:function(X){B!==X&&(B=X,s[L]=X,t[L]=X,r.dispatchEvent({type:L+"-changed",value:X}),r.dispatchEvent(gt))}}),r[L]=F,s[L]=F,t[L]=F}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new i.Vector3,c=new i.Vector3,l=new i.Quaternion,h=new i.Quaternion,u=new i.Vector3,d=new i.Quaternion,f=new i.Vector3,g=new i.Vector3,b=new i.Vector3,w=0,v=new i.Vector3;o("worldPosition",a),o("worldPositionStart",c),o("worldQuaternion",l),o("worldQuaternionStart",h),o("cameraPosition",u),o("cameraQuaternion",d),o("pointStart",f),o("pointEnd",g),o("rotationAxis",b),o("rotationAngle",w),o("eye",v),this._offset=new i.Vector3,this._startNorm=new i.Vector3,this._endNorm=new i.Vector3,this._cameraScale=new i.Vector3,this._parentPosition=new i.Vector3,this._parentQuaternion=new i.Quaternion,this._parentQuaternionInv=new i.Quaternion,this._parentScale=new i.Vector3,this._worldScaleStart=new i.Vector3,this._worldQuaternionInv=new i.Quaternion,this._worldScale=new i.Vector3,this._positionStart=new i.Vector3,this._quaternionStart=new i.Quaternion,this._scaleStart=new i.Vector3,this._getPointer=Dn.bind(this),this._onPointerDown=On.bind(this),this._onPointerHover=kn.bind(this),this._onPointerMove=Bn.bind(this),this._onPointerUp=Nn.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;Xe.setFromCamera(e,this.camera);const n=yt(this._gizmo.picker[this.mode],Xe);n?this.axis=n.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){Xe.setFromCamera(e,this.camera);const n=yt(this._plane,Xe,!0);n&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(n.point).sub(this.worldPositionStart)),this.dragging=!0,Yt.mode=this.mode,this.dispatchEvent(Yt)}}pointerMove(e){const n=this.axis,t=this.mode,s=this.object;let r=this.space;if(t==="scale"?r="local":(n==="E"||n==="XYZE"||n==="XYZ")&&(r="world"),s===void 0||n===null||this.dragging===!1||e.button!==-1)return;Xe.setFromCamera(e,this.camera);const o=yt(this._plane,Xe,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),t==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),r==="local"&&n!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),n.indexOf("X")===-1&&(this._offset.x=0),n.indexOf("Y")===-1&&(this._offset.y=0),n.indexOf("Z")===-1&&(this._offset.z=0),r==="local"&&n!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),s.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(r==="local"&&(s.position.applyQuaternion(pe.copy(this._quaternionStart).invert()),n.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.position.applyQuaternion(this._quaternionStart)),r==="world"&&(s.parent&&s.position.add(we.setFromMatrixPosition(s.parent.matrixWorld)),n.search("X")!==-1&&(s.position.x=Math.round(s.position.x/this.translationSnap)*this.translationSnap),n.search("Y")!==-1&&(s.position.y=Math.round(s.position.y/this.translationSnap)*this.translationSnap),n.search("Z")!==-1&&(s.position.z=Math.round(s.position.z/this.translationSnap)*this.translationSnap),s.parent&&s.position.sub(we.setFromMatrixPosition(s.parent.matrixWorld))));else if(t==="scale"){if(n.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Ge.set(a,a,a)}else we.copy(this.pointStart),Ge.copy(this.pointEnd),we.applyQuaternion(this._worldQuaternionInv),Ge.applyQuaternion(this._worldQuaternionInv),Ge.divide(we),n.search("X")===-1&&(Ge.x=1),n.search("Y")===-1&&(Ge.y=1),n.search("Z")===-1&&(Ge.z=1);s.scale.copy(this._scaleStart).multiply(Ge),this.scaleSnap&&(n.search("X")!==-1&&(s.scale.x=Math.round(s.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Y")!==-1&&(s.scale.y=Math.round(s.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),n.search("Z")!==-1&&(s.scale.z=Math.round(s.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(t==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(we.setFromMatrixPosition(this.camera.matrixWorld));let c=!1;n==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(we.copy(this.rotationAxis).cross(this.eye))*a):(n==="X"||n==="Y"||n==="Z")&&(this.rotationAxis.copy(Xt[n]),we.copy(Xt[n]),r==="local"&&we.applyQuaternion(this.worldQuaternion),we.cross(this.eye),we.length()===0?c=!0:this.rotationAngle=this._offset.dot(we.normalize())*a),(n==="E"||c)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),r==="local"&&n!=="E"&&n!=="XYZE"?(s.quaternion.copy(this._quaternionStart),s.quaternion.multiply(pe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),s.quaternion.copy(pe.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),s.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(gt),this.dispatchEvent(Wt)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Kt.mode=this.mode,this.dispatchEvent(Kt)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(gt),this.dispatchEvent(Wt),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xe}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function Dn(p){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:p.button};{const e=this.domElement.getBoundingClientRect();return{x:(p.clientX-e.left)/e.width*2-1,y:-(p.clientY-e.top)/e.height*2+1,button:p.button}}}function kn(p){if(this.enabled)switch(p.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(p));break}}function On(p){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(p.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(p)),this.pointerDown(this._getPointer(p)))}function Bn(p){this.enabled&&this.pointerMove(this._getPointer(p))}function Nn(p){this.enabled&&(this.domElement.releasePointerCapture(p.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(p)))}function yt(p,e,n){const t=e.intersectObject(p,!0);for(let s=0;s<t.length;s++)if(t[s].object.visible||n)return t[s];return!1}const ct=new i.Euler,ae=new i.Vector3(0,1,0),qt=new i.Vector3(0,0,0),Qt=new i.Matrix4,lt=new i.Quaternion,ut=new i.Quaternion,Fe=new i.Vector3,Zt=new i.Matrix4,$e=new i.Vector3(1,0,0),Ye=new i.Vector3(0,1,0),He=new i.Vector3(0,0,1),ht=new i.Vector3,Ee=new i.Vector3,et=new i.Vector3;class Gn extends i.Object3D{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new i.MeshBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=new i.LineBasicMaterial({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=e.clone();t.opacity=.15;const s=n.clone();s.opacity=.5;const r=e.clone();r.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const a=e.clone();a.color.setHex(255);const c=e.clone();c.color.setHex(16711680),c.opacity=.5;const l=e.clone();l.color.setHex(65280),l.opacity=.5;const h=e.clone();h.color.setHex(255),h.opacity=.5;const u=e.clone();u.opacity=.25;const d=e.clone();d.color.setHex(16776960),d.opacity=.25,e.clone().color.setHex(16776960);const g=e.clone();g.color.setHex(7895160);const b=new i.CylinderGeometry(0,.04,.1,12);b.translate(0,.05,0);const w=new i.BoxGeometry(.08,.08,.08);w.translate(0,.04,0);const v=new i.BufferGeometry;v.setAttribute("position",new i.Float32BufferAttribute([0,0,0,1,0,0],3));const L=new i.CylinderGeometry(.0075,.0075,.5,3);L.translate(0,.25,0);function F(W,Y){const ie=new i.TorusGeometry(W,.0075,3,64,Y*Math.PI*2);return ie.rotateY(Math.PI/2),ie.rotateX(Math.PI/2),ie}function B(){const W=new i.BufferGeometry;return W.setAttribute("position",new i.Float32BufferAttribute([0,0,0,1,1,1],3)),W}const X={X:[[new i.Mesh(b,r),[.5,0,0],[0,0,-Math.PI/2]],[new i.Mesh(b,r),[-.5,0,0],[0,0,Math.PI/2]],[new i.Mesh(L,r),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new i.Mesh(b,o),[0,.5,0]],[new i.Mesh(b,o),[0,-.5,0],[Math.PI,0,0]],[new i.Mesh(L,o)]],Z:[[new i.Mesh(b,a),[0,0,.5],[Math.PI/2,0,0]],[new i.Mesh(b,a),[0,0,-.5],[-Math.PI/2,0,0]],[new i.Mesh(L,a),null,[Math.PI/2,0,0]]],XYZ:[[new i.Mesh(new i.OctahedronGeometry(.1,0),u.clone()),[0,0,0]]],XY:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),h.clone()),[.15,.15,0]]],YZ:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),c.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),l.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},G={X:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[.3,0,0],[0,0,-Math.PI/2]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,.3,0]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,-.3,0],[0,0,Math.PI]]],Z:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,0,.3],[Math.PI/2,0,0]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new i.Mesh(new i.OctahedronGeometry(.2,0),t)]],XY:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[.15,.15,0]]],YZ:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[.15,0,.15],[-Math.PI/2,0,0]]]},T={START:[[new i.Mesh(new i.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],END:[[new i.Mesh(new i.OctahedronGeometry(.01,2),s),null,null,null,"helper"]],DELTA:[[new i.Line(B(),s),null,null,null,"helper"]],X:[[new i.Line(v,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new i.Line(v,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new i.Line(v,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},O={XYZE:[[new i.Mesh(F(.5,1),g),null,[0,Math.PI/2,0]]],X:[[new i.Mesh(F(.5,.5),r)]],Y:[[new i.Mesh(F(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new i.Mesh(F(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new i.Mesh(F(.75,1),d),null,[0,Math.PI/2,0]]]},V={AXIS:[[new i.Line(v,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},z={XYZE:[[new i.Mesh(new i.SphereGeometry(.25,10,8),t)]],X:[[new i.Mesh(new i.TorusGeometry(.5,.1,4,24),t),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new i.Mesh(new i.TorusGeometry(.5,.1,4,24),t),[0,0,0],[Math.PI/2,0,0]]],Z:[[new i.Mesh(new i.TorusGeometry(.5,.1,4,24),t),[0,0,0],[0,0,-Math.PI/2]]],E:[[new i.Mesh(new i.TorusGeometry(.75,.1,2,24),t)]]},R={X:[[new i.Mesh(w,r),[.5,0,0],[0,0,-Math.PI/2]],[new i.Mesh(L,r),[0,0,0],[0,0,-Math.PI/2]],[new i.Mesh(w,r),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new i.Mesh(w,o),[0,.5,0]],[new i.Mesh(L,o)],[new i.Mesh(w,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new i.Mesh(w,a),[0,0,.5],[Math.PI/2,0,0]],[new i.Mesh(L,a),[0,0,0],[Math.PI/2,0,0]],[new i.Mesh(w,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),h),[.15,.15,0]]],YZ:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),c),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new i.Mesh(new i.BoxGeometry(.15,.15,.01),l),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new i.Mesh(new i.BoxGeometry(.1,.1,.1),u.clone())]]},H={X:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[.3,0,0],[0,0,-Math.PI/2]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,.3,0]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,-.3,0],[0,0,Math.PI]]],Z:[[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,0,.3],[Math.PI/2,0,0]],[new i.Mesh(new i.CylinderGeometry(.2,0,.6,4),t),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[.15,.15,0]]],YZ:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new i.Mesh(new i.BoxGeometry(.2,.2,.01),t),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new i.Mesh(new i.BoxGeometry(.2,.2,.2),t),[0,0,0]]]},J={X:[[new i.Line(v,s.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new i.Line(v,s.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new i.Line(v,s.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function U(W){const Y=new i.Object3D;for(const ie in W)for(let ge=W[ie].length;ge--;){const se=W[ie][ge][0].clone(),oe=W[ie][ge][1],Ae=W[ie][ge][2],re=W[ie][ge][3],de=W[ie][ge][4];se.name=ie,se.tag=de,oe&&se.position.set(oe[0],oe[1],oe[2]),Ae&&se.rotation.set(Ae[0],Ae[1],Ae[2]),re&&se.scale.set(re[0],re[1],re[2]),se.updateMatrix();const M=se.geometry.clone();M.applyMatrix4(se.matrix),se.geometry=M,se.renderOrder=1/0,se.position.set(0,0,0),se.rotation.set(0,0,0),se.scale.set(1,1,1),Y.add(se)}return Y}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=U(X)),this.add(this.gizmo.rotate=U(O)),this.add(this.gizmo.scale=U(R)),this.add(this.picker.translate=U(G)),this.add(this.picker.rotate=U(z)),this.add(this.picker.scale=U(H)),this.add(this.helper.translate=U(T)),this.add(this.helper.rotate=U(V)),this.add(this.helper.scale=U(J)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:ut;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let s=[];s=s.concat(this.picker[this.mode].children),s=s.concat(this.gizmo[this.mode].children),s=s.concat(this.helper[this.mode].children);for(let r=0;r<s.length;r++){const o=s[r];o.visible=!0,o.rotation.set(0,0,0),o.position.copy(this.worldPosition);let a;if(this.camera.isOrthographicCamera?a=(this.camera.top-this.camera.bottom)/this.camera.zoom:a=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),o.scale.set(1,1,1).multiplyScalar(a*this.size/4),o.tag==="helper"){o.visible=!1,o.name==="AXIS"?(o.visible=!!this.axis,this.axis==="X"&&(pe.setFromEuler(ct.set(0,0,0)),o.quaternion.copy(t).multiply(pe),Math.abs(ae.copy($e).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Y"&&(pe.setFromEuler(ct.set(0,0,Math.PI/2)),o.quaternion.copy(t).multiply(pe),Math.abs(ae.copy(Ye).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="Z"&&(pe.setFromEuler(ct.set(0,Math.PI/2,0)),o.quaternion.copy(t).multiply(pe),Math.abs(ae.copy(He).applyQuaternion(t).dot(this.eye))>.9&&(o.visible=!1)),this.axis==="XYZE"&&(pe.setFromEuler(ct.set(0,Math.PI/2,0)),ae.copy(this.rotationAxis),o.quaternion.setFromRotationMatrix(Qt.lookAt(qt,ae,Ye)),o.quaternion.multiply(pe),o.visible=this.dragging),this.axis==="E"&&(o.visible=!1)):o.name==="START"?(o.position.copy(this.worldPositionStart),o.visible=this.dragging):o.name==="END"?(o.position.copy(this.worldPosition),o.visible=this.dragging):o.name==="DELTA"?(o.position.copy(this.worldPositionStart),o.quaternion.copy(this.worldQuaternionStart),we.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),we.applyQuaternion(this.worldQuaternionStart.clone().invert()),o.scale.copy(we),o.visible=this.dragging):(o.quaternion.copy(t),this.dragging?o.position.copy(this.worldPositionStart):o.position.copy(this.worldPosition),this.axis&&(o.visible=this.axis.search(o.name)!==-1));continue}o.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(o.name==="X"&&Math.abs(ae.copy($e).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Y"&&Math.abs(ae.copy(Ye).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="Z"&&Math.abs(ae.copy(He).applyQuaternion(t).dot(this.eye))>.99&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XY"&&Math.abs(ae.copy(He).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="YZ"&&Math.abs(ae.copy($e).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1),o.name==="XZ"&&Math.abs(ae.copy(Ye).applyQuaternion(t).dot(this.eye))<.2&&(o.scale.set(1e-10,1e-10,1e-10),o.visible=!1)):this.mode==="rotate"&&(lt.copy(t),ae.copy(this.eye).applyQuaternion(pe.copy(t).invert()),o.name.search("E")!==-1&&o.quaternion.setFromRotationMatrix(Qt.lookAt(this.eye,qt,Ye)),o.name==="X"&&(pe.setFromAxisAngle($e,Math.atan2(-ae.y,ae.z)),pe.multiplyQuaternions(lt,pe),o.quaternion.copy(pe)),o.name==="Y"&&(pe.setFromAxisAngle(Ye,Math.atan2(ae.x,ae.z)),pe.multiplyQuaternions(lt,pe),o.quaternion.copy(pe)),o.name==="Z"&&(pe.setFromAxisAngle(He,Math.atan2(ae.y,ae.x)),pe.multiplyQuaternions(lt,pe),o.quaternion.copy(pe))),o.visible=o.visible&&(o.name.indexOf("X")===-1||this.showX),o.visible=o.visible&&(o.name.indexOf("Y")===-1||this.showY),o.visible=o.visible&&(o.name.indexOf("Z")===-1||this.showZ),o.visible=o.visible&&(o.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),o.material._color=o.material._color||o.material.color.clone(),o.material._opacity=o.material._opacity||o.material.opacity,o.material.color.copy(o.material._color),o.material.opacity=o.material._opacity,this.enabled&&this.axis&&(o.name===this.axis||this.axis.split("").some(function(c){return o.name===c}))&&(o.material.color.setHex(16776960),o.material.opacity=1)}super.updateMatrixWorld(e)}}class Tn extends i.Mesh{constructor(){super(new i.PlaneGeometry(1e5,1e5,2,2),new i.MeshBasicMaterial({visible:!1,wireframe:!0,side:i.DoubleSide,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let n=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(n="local"),ht.copy($e).applyQuaternion(n==="local"?this.worldQuaternion:ut),Ee.copy(Ye).applyQuaternion(n==="local"?this.worldQuaternion:ut),et.copy(He).applyQuaternion(n==="local"?this.worldQuaternion:ut),ae.copy(Ee),this.mode){case"translate":case"scale":switch(this.axis){case"X":ae.copy(this.eye).cross(ht),Fe.copy(ht).cross(ae);break;case"Y":ae.copy(this.eye).cross(Ee),Fe.copy(Ee).cross(ae);break;case"Z":ae.copy(this.eye).cross(et),Fe.copy(et).cross(ae);break;case"XY":Fe.copy(et);break;case"YZ":Fe.copy(ht);break;case"XZ":ae.copy(et),Fe.copy(Ee);break;case"XYZ":case"E":Fe.set(0,0,0);break}break;case"rotate":default:Fe.set(0,0,0)}Fe.length()===0?this.quaternion.copy(this.cameraQuaternion):(Zt.lookAt(we.set(0,0,0),Fe,ae),this.quaternion.setFromRotationMatrix(Zt)),super.updateMatrixWorld(e)}}const wt=new WeakMap;class jn extends i.Loader{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,n,t,s){const r=new i.FileLoader(this.manager);r.setPath(this.path),r.setResponseType("arraybuffer"),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,o=>{this.parse(o,n,s)},t,s)}parse(e,n,t=()=>{}){this.decodeDracoFile(e,n,null,null,i.SRGBColorSpace).catch(t)}decodeDracoFile(e,n,t,s,r=i.LinearSRGBColorSpace,o=()=>{}){const a={attributeIDs:t||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!t,vertexColorSpace:r};return this.decodeGeometry(e,a).then(n).catch(o)}decodeGeometry(e,n){const t=JSON.stringify(n);if(wt.has(e)){const c=wt.get(e);if(c.key===t)return c.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const r=this.workerNextTaskID++,o=e.byt