ss-component-new 1.1.290 → 1.1.310

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.
Files changed (75) hide show
  1. package/dist/{array-D339uZXb.js → array-CFIAOkpU.js} +2 -2
  2. package/dist/{array-AtQFJ2vI.cjs → array-Dp3mG6qP.cjs} +1 -1
  3. package/dist/{cloneDeep-CQWIrbqu.js → cloneDeep-BC6hApUL.js} +1 -1
  4. package/dist/{cloneDeep-Cy5gcH4s.cjs → cloneDeep-Dqfzct8G.cjs} +1 -1
  5. package/dist/{index-3kKzSjZ0.cjs → index-563TMWMC.cjs} +1 -1
  6. package/dist/{index-B8ZxJexC.cjs → index-5W3FYly6.cjs} +1 -1
  7. package/dist/{index-C2MFTfzW.js → index-6DprAE2h.js} +6 -6
  8. package/dist/{index-DXwKNWWk.cjs → index-B0WB2KTa.cjs} +1 -1
  9. package/dist/{index-cShxcVK6.js → index-B1nJ-Z39.js} +3 -3
  10. package/dist/{index-DnMhJfWN.js → index-B2-tbMJV.js} +4 -4
  11. package/dist/{index-CKju-MUG.cjs → index-BPoaubFA.cjs} +1 -1
  12. package/dist/{index-Bn4_BTJF.cjs → index-BRebILsV.cjs} +1 -1
  13. package/dist/{index-CtaOQXvX.cjs → index-BTnKTcJy.cjs} +1 -1
  14. package/dist/{index-BeqtgUA4.cjs → index-BUzuQGku.cjs} +1 -1
  15. package/dist/{index-Cv_BJkoF.js → index-BiA96Te2.js} +4 -4
  16. package/dist/{index-Qu4zMvbx.cjs → index-BlnkYO02.cjs} +1 -1
  17. package/dist/{index-CMclZit7.js → index-BqyjHr9C.js} +4 -4
  18. package/dist/{index-D07AfqMk.js → index-BsoflaB1.js} +3 -3
  19. package/dist/{index-BHcmcUsH.cjs → index-C098N8un.cjs} +1 -1
  20. package/dist/{index-D2t0GHuc.js → index-C4Sp8WeM.js} +4 -4
  21. package/dist/{index-Dv507uaz.cjs → index-CG7LSylY.cjs} +1 -1
  22. package/dist/{index-BBlUzqj4.cjs → index-CKbCejX8.cjs} +1 -1
  23. package/dist/{index-B5ot2AKt.cjs → index-CMhrZyHq.cjs} +1 -1
  24. package/dist/{index-DawWVxkB.js → index-CND4bAN1.js} +6 -6
  25. package/dist/{index-IjvmSCm2.js → index-COWtJfBt.js} +5 -5
  26. package/dist/{index-BsbrUEYh.js → index-CSMb6JUa.js} +9 -9
  27. package/dist/{index-YooFxY8Y.cjs → index-Cb4nldBH.cjs} +1 -1
  28. package/dist/{index-D9po9WOs.js → index-Cd3MpYaF.js} +8 -8
  29. package/dist/{index-BeriQ3fM.js → index-CeIsvjm_.js} +8 -8
  30. package/dist/{index-C7NJ9nFX.cjs → index-Cehda098.cjs} +1 -1
  31. package/dist/{index-DxO-iCvu.js → index-CfUQUcR0.js} +1 -1
  32. package/dist/{index-CmYcmqtc.cjs → index-Ci-roF0f.cjs} +1 -1
  33. package/dist/{index-Bzym-5H_.cjs → index-CqoO4f6W.cjs} +1 -1
  34. package/dist/{index-BQZDQO_i.js → index-CxHjQMe7.js} +5 -5
  35. package/dist/{index-4RyZMkSe.js → index-Cykuj77e.js} +7 -7
  36. package/dist/{index-BQDIPZDa.js → index-D25w_LCd.js} +4 -4
  37. package/dist/{index-BEGBgo_B.js → index-D4-10GVB.js} +5 -5
  38. package/dist/{index-DNNd6eR_.cjs → index-DA3Sh1Tz.cjs} +1 -1
  39. package/dist/{index-gNi9T_lb.cjs → index-DCCRnjTu.cjs} +1 -1
  40. package/dist/{index-CrrFhzv_.js → index-DE3uvzqv.js} +1 -1
  41. package/dist/{index-Cp7F_B6D.js → index-DJUjFOtq.js} +3 -3
  42. package/dist/{index-D5yajhtO.cjs → index-DX-ZG8i5.cjs} +1 -1
  43. package/dist/{index-BmmcZ2Tp.js → index-DhNtgRPf.js} +1 -1
  44. package/dist/{index-qs5AhtIZ.js → index-Dj4GAvUp.js} +3 -3
  45. package/dist/{index-EPYWKP2l.js → index-DjAg2mhq.js} +3 -3
  46. package/dist/{index-CjMbwBqq.js → index-Dk4rHBYA.js} +1 -1
  47. package/dist/index-Dl7Iwabv.cjs +9 -0
  48. package/dist/{index-YGsZEZKX.cjs → index-DpgIfvxQ.cjs} +1 -1
  49. package/dist/{index-Cnf64BJ6.cjs → index-Dv0cT1Jj.cjs} +1 -1
  50. package/dist/{index-uDD9_wyq.cjs → index-DzHb-2qg.cjs} +1 -1
  51. package/dist/{index-CwDWgUj2.js → index-KxCRKhYW.js} +7 -7
  52. package/dist/{index-DSmuTNGj.cjs → index-Tu-PtE4a.cjs} +1 -1
  53. package/dist/{index-f7hoVZUM.js → index-epYwDqWZ.js} +5 -5
  54. package/dist/{index-Cne4xArW.cjs → index-i0BszWbX.cjs} +1 -1
  55. package/dist/{index-DYiya7rv.js → index-ts5b_rKm.js} +1215 -1216
  56. package/dist/{index-DjfrBuEe.cjs → index-ukJ-kt4p.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-Z3XfdBed.cjs → index.vue_vue_type_script_setup_true_lang-C1lQOWLE.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-BZmr7K21.js → index.vue_vue_type_script_setup_true_lang-CApK0j7g.js} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-trTIwTQe.cjs → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-CmoZt9g1.cjs} +1 -1
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-D31_EwO5.js → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-PEeio78T.js} +13 -13
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CIggOAuR.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-DOzj8ZRs.js} +8 -8
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-COaR4FnN.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-r-NO8sGY.cjs} +1 -1
  63. package/dist/{login-CmjkXwNQ.cjs → login-BPkLsYkz.cjs} +1 -1
  64. package/dist/{login-DQiz4jLw.js → login-UhUPZuPH.js} +2 -2
  65. package/dist/{main-DjwccYLR.cjs → main-BTYMrU5V.cjs} +1 -1
  66. package/dist/{main-0Gji26N_.js → main-dSK-267_.js} +7 -7
  67. package/dist/{menu-djOhwwFt.cjs → menu-D1SsYDhc.cjs} +1 -1
  68. package/dist/{menu-CvBl29K2.js → menu-dd51TtC8.js} +1 -1
  69. package/dist/ss-component.cjs +1 -1
  70. package/dist/ss-component.css +1 -1
  71. package/dist/ss-component.js +7 -7
  72. package/dist/ss-component3.cjs +1 -1
  73. package/dist/ss-component3.js +1 -1
  74. package/package.json +1 -1
  75. package/dist/index-CS_8ym5J.cjs +0 -9
@@ -0,0 +1,9 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ke=require("./index-CG7LSylY.cjs"),Bt=require("./index-Cb4nldBH.cjs"),Ie=require("./index-DA3Sh1Tz.cjs"),r=require("./index-B0WB2KTa.cjs"),ye=require("./menu-D1SsYDhc.cjs"),Un=require("./index-ukJ-kt4p.cjs"),de=require("./index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-CmoZt9g1.cjs"),dt=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),lt=require("./array-Dp3mG6qP.cjs"),rn=require("./login-BPkLsYkz.cjs"),et=require("./index-BpPyaNFa.cjs"),ln=require("./index-BlnkYO02.cjs"),ct=require("./cloneDeep-Dqfzct8G.cjs"),Rt=require("./index-C098N8un.cjs"),zn=require("./index-DpgIfvxQ.cjs"),Jt={type:"change"},Dt={type:"start"},cn={type:"end"},vt=new r.Ray,Xt=new r.Plane,Gn=Math.cos(70*r.MathUtils.DEG2RAD),Te=new r.Vector3,Be=2*Math.PI,we={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Mt=1e-6;class qn extends r.Controls{constructor(o,l=null){super(o,l),this.state=we.NONE,this.target=new r.Vector3,this.cursor=new r.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.keyRotateSpeed=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:r.MOUSE.ROTATE,MIDDLE:r.MOUSE.DOLLY,RIGHT:r.MOUSE.PAN},this.touches={ONE:r.TOUCH.ROTATE,TWO:r.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 r.Vector3,this._lastQuaternion=new r.Quaternion,this._lastTargetPosition=new r.Vector3,this._quat=new r.Quaternion().setFromUnitVectors(o.up,new r.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new r.Spherical,this._sphericalDelta=new r.Spherical,this._scale=1,this._panOffset=new r.Vector3,this._rotateStart=new r.Vector2,this._rotateEnd=new r.Vector2,this._rotateDelta=new r.Vector2,this._panStart=new r.Vector2,this._panEnd=new r.Vector2,this._panDelta=new r.Vector2,this._dollyStart=new r.Vector2,this._dollyEnd=new r.Vector2,this._dollyDelta=new r.Vector2,this._dollyDirection=new r.Vector3,this._mouse=new r.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=$n.bind(this),this._onPointerDown=Hn.bind(this),this._onPointerUp=Yn.bind(this),this._onContextMenu=eo.bind(this),this._onMouseWheel=Zn.bind(this),this._onKeyDown=Jn.bind(this),this._onTouchStart=Xn.bind(this),this._onTouchMove=Qn.bind(this),this._onMouseDown=Kn.bind(this),this._onMouseMove=Wn.bind(this),this._interceptControlDown=to.bind(this),this._interceptControlUp=no.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(o){super.connect(o),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(o){o.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=o}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(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(Jt),this.update(),this.state=we.NONE}update(o=null){const l=this.object.position;Te.copy(l).sub(this.target),Te.applyQuaternion(this._quat),this._spherical.setFromVector3(Te),this.autoRotate&&this.state===we.NONE&&this._rotateLeft(this._getAutoRotationAngle(o)),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 c=this.minAzimuthAngle,u=this.maxAzimuthAngle;isFinite(c)&&isFinite(u)&&(c<-Math.PI?c+=Be:c>Math.PI&&(c-=Be),u<-Math.PI?u+=Be:u>Math.PI&&(u-=Be),c<=u?this._spherical.theta=Math.max(c,Math.min(u,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(c+u)/2?Math.max(c,this._spherical.theta):Math.min(u,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?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 d=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const _=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),d=_!=this._spherical.radius}if(Te.setFromSpherical(this._spherical),Te.applyQuaternion(this._quatInverse),l.copy(this.target).add(Te),this.object.lookAt(this.target),this.enableDamping===!0?(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 _=null;if(this.object.isPerspectiveCamera){const p=Te.length();_=this._clampDistance(p*this._scale);const w=p-_;this.object.position.addScaledVector(this._dollyDirection,w),this.object.updateMatrixWorld(),d=!!w}else if(this.object.isOrthographicCamera){const p=new r.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const w=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),d=w!==this.object.zoom;const y=new r.Vector3(this._mouse.x,this._mouse.y,0);y.unproject(this.object),this.object.position.sub(y).add(p),this.object.updateMatrixWorld(),_=Te.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;_!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(_).add(this.object.position):(vt.origin.copy(this.object.position),vt.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(vt.direction))<Gn?this.object.lookAt(this.target):(Xt.setFromNormalAndCoplanarPoint(this.object.up,this.target),vt.intersectPlane(Xt,this.target))))}else if(this.object.isOrthographicCamera){const _=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),_!==this.object.zoom&&(this.object.updateProjectionMatrix(),d=!0)}return this._scale=1,this._performCursorZoom=!1,d||this._lastPosition.distanceToSquared(this.object.position)>Mt||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Mt||this._lastTargetPosition.distanceToSquared(this.target)>Mt?(this.dispatchEvent(Jt),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?Be/60*this.autoRotateSpeed*o:Be/60/60*this.autoRotateSpeed}_getZoomScale(o){const l=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*l)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,l){Te.setFromMatrixColumn(l,0),Te.multiplyScalar(-o),this._panOffset.add(Te)}_panUp(o,l){this.screenSpacePanning===!0?Te.setFromMatrixColumn(l,1):(Te.setFromMatrixColumn(l,0),Te.crossVectors(this.object.up,Te)),Te.multiplyScalar(o),this._panOffset.add(Te)}_pan(o,l){const c=this.domElement;if(this.object.isPerspectiveCamera){const u=this.object.position;Te.copy(u).sub(this.target);let d=Te.length();d*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*d/c.clientHeight,this.object.matrix),this._panUp(2*l*d/c.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/c.clientWidth,this.object.matrix),this._panUp(l*(this.object.top-this.object.bottom)/this.object.zoom/c.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(o){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=o:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(o,l){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const c=this.domElement.getBoundingClientRect(),u=o-c.left,d=l-c.top,_=c.width,p=c.height;this._mouse.x=u/_*2-1,this._mouse.y=-(d/p)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(o){return Math.max(this.minDistance,Math.min(this.maxDistance,o))}_handleMouseDownRotate(o){this._rotateStart.set(o.clientX,o.clientY)}_handleMouseDownDolly(o){this._updateZoomParameters(o.clientX,o.clientX),this._dollyStart.set(o.clientX,o.clientY)}_handleMouseDownPan(o){this._panStart.set(o.clientX,o.clientY)}_handleMouseMoveRotate(o){this._rotateEnd.set(o.clientX,o.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft(Be*this._rotateDelta.x/l.clientHeight),this._rotateUp(Be*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(o){this._dollyEnd.set(o.clientX,o.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(o){this._panEnd.set(o.clientX,o.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(o){this._updateZoomParameters(o.clientX,o.clientY),o.deltaY<0?this._dollyIn(this._getZoomScale(o.deltaY)):o.deltaY>0&&this._dollyOut(this._getZoomScale(o.deltaY)),this.update()}_handleKeyDown(o){let l=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(Be*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),l=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-Be*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),l=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(Be*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),l=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-Be*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),l=!0;break}l&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._rotateStart.set(c,u)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panStart.set(c,u)}}_handleTouchStartDolly(o){const l=this._getSecondPointerPosition(o),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyStart.set(0,d)}_handleTouchStartDollyPan(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enablePan&&this._handleTouchStartPan(o)}_handleTouchStartDollyRotate(o){this.enableZoom&&this._handleTouchStartDolly(o),this.enableRotate&&this._handleTouchStartRotate(o)}_handleTouchMoveRotate(o){if(this._pointers.length==1)this._rotateEnd.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),d=.5*(o.pageY+c.y);this._rotateEnd.set(u,d)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const l=this.domElement;this._rotateLeft(Be*this._rotateDelta.x/l.clientHeight),this._rotateUp(Be*this._rotateDelta.y/l.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const l=this._getSecondPointerPosition(o),c=.5*(o.pageX+l.x),u=.5*(o.pageY+l.y);this._panEnd.set(c,u)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(o){const l=this._getSecondPointerPosition(o),c=o.pageX-l.x,u=o.pageY-l.y,d=Math.sqrt(c*c+u*u);this._dollyEnd.set(0,d),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 _=(o.pageX+l.x)*.5,p=(o.pageY+l.y)*.5;this._updateZoomParameters(_,p)}_handleTouchMoveDollyPan(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enablePan&&this._handleTouchMovePan(o)}_handleTouchMoveDollyRotate(o){this.enableZoom&&this._handleTouchMoveDolly(o),this.enableRotate&&this._handleTouchMoveRotate(o)}_addPointer(o){this._pointers.push(o.pointerId)}_removePointer(o){delete this._pointerPositions[o.pointerId];for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId){this._pointers.splice(l,1);return}}_isTrackingPointer(o){for(let l=0;l<this._pointers.length;l++)if(this._pointers[l]==o.pointerId)return!0;return!1}_trackPointer(o){let l=this._pointerPositions[o.pointerId];l===void 0&&(l=new r.Vector2,this._pointerPositions[o.pointerId]=l),l.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const l=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[l]}_customWheelEvent(o){const l=o.deltaMode,c={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(l){case 1:c.deltaY*=16;break;case 2:c.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(c.deltaY*=10),c}}function Hn(M){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(M.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(M)&&(this._addPointer(M),M.pointerType==="touch"?this._onTouchStart(M):this._onMouseDown(M)))}function $n(M){this.enabled!==!1&&(M.pointerType==="touch"?this._onTouchMove(M):this._onMouseMove(M))}function Yn(M){switch(this._removePointer(M),this._pointers.length){case 0:this.domElement.releasePointerCapture(M.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(cn),this.state=we.NONE;break;case 1:const o=this._pointers[0],l=this._pointerPositions[o];this._onTouchStart({pointerId:o,pageX:l.x,pageY:l.y});break}}function Kn(M){let o;switch(M.button){case 0:o=this.mouseButtons.LEFT;break;case 1:o=this.mouseButtons.MIDDLE;break;case 2:o=this.mouseButtons.RIGHT;break;default:o=-1}switch(o){case r.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(M),this.state=we.DOLLY;break;case r.MOUSE.ROTATE:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}break;case r.MOUSE.PAN:if(M.ctrlKey||M.metaKey||M.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(M),this.state=we.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(M),this.state=we.PAN}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Wn(M){switch(this.state){case we.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(M);break;case we.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(M);break;case we.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(M);break}}function Zn(M){this.enabled===!1||this.enableZoom===!1||this.state!==we.NONE||(M.preventDefault(),this.dispatchEvent(Dt),this._handleMouseWheel(this._customWheelEvent(M)),this.dispatchEvent(cn))}function Jn(M){this.enabled!==!1&&this._handleKeyDown(M)}function Xn(M){switch(this._trackPointer(M),this._pointers.length){case 1:switch(this.touches.ONE){case r.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(M),this.state=we.TOUCH_ROTATE;break;case r.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(M),this.state=we.TOUCH_PAN;break;default:this.state=we.NONE}break;case 2:switch(this.touches.TWO){case r.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(M),this.state=we.TOUCH_DOLLY_PAN;break;case r.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(M),this.state=we.TOUCH_DOLLY_ROTATE;break;default:this.state=we.NONE}break;default:this.state=we.NONE}this.state!==we.NONE&&this.dispatchEvent(Dt)}function Qn(M){switch(this._trackPointer(M),this.state){case we.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(M),this.update();break;case we.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(M),this.update();break;case we.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(M),this.update();break;case we.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(M),this.update();break;default:this.state=we.NONE}}function eo(M){this.enabled!==!1&&M.preventDefault()}function to(M){M.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function no(M){M.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oo(M){let o=null,l=null,c=null,u=null,d=null,_=null;const p=e.ref([]),w=e.ref(new r.Vector3),y=e.ref(new r.Vector3),V=()=>{if(!M.value)return;o=new r.Scene,o.background=new r.Color(16777215);const E=M.value;l=new r.PerspectiveCamera(75,E.clientWidth/E.clientHeight,.1,1e4),c=new r.WebGLRenderer({antialias:!0,alpha:!0}),c.setSize(E.clientWidth,E.clientHeight),c.localClippingEnabled=!0,c.shadowMap.enabled=!0,c.shadowMap.type=r.PCFSoftShadowMap,c.toneMapping=r.ACESFilmicToneMapping,c.toneMappingExposure=1,c.outputColorSpace=r.SRGBColorSpace,E.appendChild(c.domElement),u=new qn(l,c.domElement),u.enableDamping=!0,u.dampingFactor=.05,d=new r.Xe(l,c,{container:E,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),d.attachControls(u),D(),B()},D=()=>{const E=new r.AmbientLight(4210752,.6);o.add(E);const k=new r.DirectionalLight(16777215,2);k.position.set(10,10,8),k.castShadow=!0,k.shadow.mapSize.width=2048,k.shadow.mapSize.height=2048,k.shadow.camera.near=.5,k.shadow.camera.far=50,o.add(k);const g=new r.DirectionalLight(16777215,.8);g.position.set(-8,-8,6),o.add(g);const j=new r.DirectionalLight(16777215,.6);j.position.set(0,-15,2),o.add(j);const A=new r.HemisphereLight(16777215,4473924,.8);o.add(A);const x=new r.PointLight(16777215,1,50);x.position.set(15,15,15),o.add(x);const q=new r.PointLight(16777215,.5,50);q.position.set(-15,-15,15),o.add(q)},B=()=>{_=requestAnimationFrame(B),u&&u.update(),c&&o&&l&&c.render(o,l),d&&d.render()},T=E=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(g=>{E[g]&&E[g].dispose&&E[g].dispose()}),E.dispose&&E.dispose()},R=E=>{E.traverse(k=>{k.geometry&&k.geometry.dispose(),k.material&&(Array.isArray(k.material)?k.material.forEach(g=>{T(g)}):T(k.material))})};return{currentModels:p,initialCameraPosition:w,initialTargetPosition:y,initThreeJS:V,handleResize:()=>{if(!M.value||!l||!c||!d)return;const E=M.value,k=E.clientWidth,g=E.clientHeight;l.aspect=k/g,l.updateProjectionMatrix(),c.setSize(k,g),d.update()},fitCameraToAllModels:()=>{if(!l||!u||p.value.length===0)return;const E=new r.Box3;p.value.forEach(F=>{E.expandByObject(F)});const k=E.getSize(new r.Vector3),g=E.getCenter(new r.Vector3),A=Math.max(k.x,k.y,k.z)*.8,x=new r.Vector3(g.x+A,g.y+A,g.z+A),q=g.clone();l.position.copy(x),l.lookAt(q),u.target.copy(q),u.update(),w.value.copy(x),y.value.copy(q)},getThreeJSObjects:()=>({scene:o,camera:l,renderer:c,controls:u,gizmo:d}),clearAllModels:()=>{if(!o)return;p.value.forEach(k=>{o.remove(k),R(k)});const E=[];o.children.forEach(k=>{!k.isLight&&!k.isCamera&&E.push(k)}),E.forEach(k=>{o.remove(k),R(k)}),p.value=[]},cleanup:()=>{_&&cancelAnimationFrame(_),c&&c.dispose(),u&&u.dispose(),d&&d.dispose()}}}function so(M,o){const l=e.ref(!1);let c=null,u=12700,d=new r.Vector3,_=new r.Vector3,p=new r.Vector3,w=0,y=null;const V=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2,D=m=>{const S=new r.Vector3,N=w*1.2,O=new r.Vector3(p.x+N,p.y,p.z),E=new r.Vector3(p.x,p.y+N,p.z),k=new r.Vector3(p.x,p.y-N,p.z);if(m<=.567){const j=m/.567*Math.PI*2;S.x=p.x+Math.cos(j)*N,S.z=p.z+Math.sin(j)*N,S.y=p.y}else if(m<=.724){const g=(m-.567)/.157,j=V(g);S.lerpVectors(O,E,j)}else if(m<=.881){const g=(m-.724)/.157,A=V(g)*Math.PI;S.x=p.x+Math.sin(A)*N,S.y=p.y+Math.cos(A)*N,S.z=p.z}else{const g=(m-.881)/.119,j=V(g);S.lerpVectors(k,d,j)}return S},B=()=>{const{camera:m,controls:S}=M();if(!m||!S)return;c||(c=Date.now());const N=Date.now()-c,O=Math.min(N/u,1);if(O>=1){R();return}const E=D(O);m.position.copy(E),m.lookAt(p),S.target.copy(p),y=requestAnimationFrame(B)},T=()=>{if(o.value.length===0)return;const{camera:m,controls:S}=M();if(!m||!S)return;d.copy(m.position),_.copy(S.target);const N=new r.Box3;o.value.forEach(x=>{N.expandByObject(x)});const O=N.getSize(new r.Vector3);p=N.getCenter(new r.Vector3),w=Math.max(O.x,O.y,O.z)*1.2;const E=new r.Vector3(p.x+w*1.2,p.y,p.z);S.enabled=!1;const k=m.position.clone(),g=1e3,j=Date.now(),A=()=>{const x=Date.now()-j,q=Math.min(x/g,1),F=V(q);m.position.lerpVectors(k,E,F),m.lookAt(p),S.target.copy(p),q<1?requestAnimationFrame(A):(l.value=!0,c=null,B())};A()},R=()=>{l.value=!1,c=null,y&&(cancelAnimationFrame(y),y=null);const{controls:m}=M();m&&(m.enabled=!0,m.target.copy(_))};return{isAnimating:l,toggleAnimation:()=>{if(l.value){l.value=!1,c=null,y&&(cancelAnimationFrame(y),y=null);const{camera:m,controls:S}=M();if(!m||!S)return;S.enabled=!0;const N=m.position.clone(),O=S.target.clone(),E=1500,k=Date.now(),g=()=>{const j=Date.now()-k,A=Math.min(j/E,1),x=V(A);m.position.lerpVectors(N,d,x),S.target.lerpVectors(O,_,x),A<1&&requestAnimationFrame(g)};g()}else T()},startAnimation:T,stopAnimation:R}}function io(M,o){const l=e.ref(!1),c=e.ref("none");let u=[],d=[],_=new r.Box3,p=new r.Vector3;const w=()=>{u=[new r.Plane(new r.Vector3(1,0,0),0),new r.Plane(new r.Vector3(0,1,0),0),new r.Plane(new r.Vector3(0,0,1),0)]},y=()=>{_.makeEmpty(),o.value.forEach(v=>{_.expandByObject(v)}),p=_.getCenter(new r.Vector3)},V=v=>{const m=_.getSize(new r.Vector3);let S,N,O;v==="x"?(S=new r.PlaneGeometry(m.z*1.2,m.y*1.2),N=new r.Vector3(p.x,p.y,p.z),O=new r.Euler(0,Math.PI/2,0)):v==="y"?(S=new r.PlaneGeometry(m.x*1.2,m.z*1.2),N=new r.Vector3(p.x,p.y,p.z),O=new r.Euler(Math.PI/2,0,0)):v==="z"&&(S=new r.PlaneGeometry(m.x*1.2,m.y*1.2),N=new r.Vector3(p.x,p.y,p.z),O=new r.Euler(0,0,0));const E=new r.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:r.DoubleSide,depthWrite:!1}),k=new r.Mesh(S,E);return k.position.copy(N),k.rotation.copy(O),k},D=()=>{if(B(),T(),c.value==="none")return;y();let v=null;if(c.value==="x"?(u[0].constant=-p.x,v=u[0]):c.value==="y"?(u[1].constant=-p.y,v=u[1]):c.value==="z"&&(u[2].constant=-p.z,v=u[2]),v){o.value.forEach(S=>{S.traverse(N=>{N.isMesh&&N.material&&(Array.isArray(N.material)?N.material.forEach(O=>{O.clippingPlanes=[v]}):N.material.clippingPlanes=[v])})});const{scene:m}=M();if(m){const S=V(c.value);m.add(S),d.push(S)}}},B=()=>{o.value.forEach(v=>{v.traverse(m=>{m.isMesh&&m.material&&(Array.isArray(m.material)?m.material.forEach(S=>{S.clippingPlanes=[]}):m.material.clippingPlanes=[])})})},T=()=>{const{scene:v}=M();v&&d.forEach(m=>{v.remove(m),m.geometry.dispose(),m.material.dispose()}),d=[]};return{isClipping:l,activeClippingAxis:c,toggleClipping:()=>{l.value=!l.value,l.value?(w(),o.value.length>0&&y()):(c.value="none",B(),T())},updateClippingPlanes:D,clearClippingPlanes:B,clearClippingMeshes:T}}const ao=/^[og]\s*(.+)?/,ro=/^mtllib /,lo=/^usemtl /,co=/^usemap /,Qt=/\s+/,en=new r.Vector3,St=new r.Vector3,tn=new r.Vector3,nn=new r.Vector3,Oe=new r.Vector3,xt=new r.Color;function uo(){const M={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(o,l){if(this.object&&this.object.fromDeclaration===!1){this.object.name=o,this.object.fromDeclaration=l!==!1;return}const c=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:o||"",fromDeclaration:l!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(u,d){const _=this._finalize(!1);_&&(_.inherited||_.groupCount<=0)&&this.materials.splice(_.index,1);const p={index:this.materials.length,name:u||"",mtllib:Array.isArray(d)&&d.length>0?d[d.length-1]:"",smooth:_!==void 0?_.smooth:this.smooth,groupStart:_!==void 0?_.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(w){const y={index:typeof w=="number"?w:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return y.clone=this.clone.bind(y),y}};return this.materials.push(p),p},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(u){const d=this.currentMaterial();if(d&&d.groupEnd===-1&&(d.groupEnd=this.geometry.vertices.length/3,d.groupCount=d.groupEnd-d.groupStart,d.inherited=!1),u&&this.materials.length>1)for(let _=this.materials.length-1;_>=0;_--)this.materials[_].groupCount<=0&&this.materials.splice(_,1);return u&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),d}},c&&c.name&&typeof c.clone=="function"){const u=c.clone(0);u.inherited=!0,this.object.materials.push(u)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseNormalIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/3)*3},parseUVIndex:function(o,l){const c=parseInt(o,10);return(c>=0?c-1:c+l/2)*2},addVertex:function(o,l,c){const u=this.vertices,d=this.object.geometry.vertices;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+2])},addVertexPoint:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addVertexLine:function(o){const l=this.vertices;this.object.geometry.vertices.push(l[o+0],l[o+1],l[o+2])},addNormal:function(o,l,c){const u=this.normals,d=this.object.geometry.normals;d.push(u[o+0],u[o+1],u[o+2]),d.push(u[l+0],u[l+1],u[l+2]),d.push(u[c+0],u[c+1],u[c+2])},addFaceNormal:function(o,l,c){const u=this.vertices,d=this.object.geometry.normals;en.fromArray(u,o),St.fromArray(u,l),tn.fromArray(u,c),Oe.subVectors(tn,St),nn.subVectors(en,St),Oe.cross(nn),Oe.normalize(),d.push(Oe.x,Oe.y,Oe.z),d.push(Oe.x,Oe.y,Oe.z),d.push(Oe.x,Oe.y,Oe.z)},addColor:function(o,l,c){const u=this.colors,d=this.object.geometry.colors;u[o]!==void 0&&d.push(u[o+0],u[o+1],u[o+2]),u[l]!==void 0&&d.push(u[l+0],u[l+1],u[l+2]),u[c]!==void 0&&d.push(u[c+0],u[c+1],u[c+2])},addUV:function(o,l,c){const u=this.uvs,d=this.object.geometry.uvs;d.push(u[o+0],u[o+1]),d.push(u[l+0],u[l+1]),d.push(u[c+0],u[c+1])},addDefaultUV:function(){const o=this.object.geometry.uvs;o.push(0,0),o.push(0,0),o.push(0,0)},addUVLine:function(o){const l=this.uvs;this.object.geometry.uvs.push(l[o+0],l[o+1])},addFace:function(o,l,c,u,d,_,p,w,y){const V=this.vertices.length;let D=this.parseVertexIndex(o,V),B=this.parseVertexIndex(l,V),T=this.parseVertexIndex(c,V);if(this.addVertex(D,B,T),this.addColor(D,B,T),p!==void 0&&p!==""){const R=this.normals.length;D=this.parseNormalIndex(p,R),B=this.parseNormalIndex(w,R),T=this.parseNormalIndex(y,R),this.addNormal(D,B,T)}else this.addFaceNormal(D,B,T);if(u!==void 0&&u!==""){const R=this.uvs.length;D=this.parseUVIndex(u,R),B=this.parseUVIndex(d,R),T=this.parseUVIndex(_,R),this.addUV(D,B,T),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const l=this.vertices.length;for(let c=0,u=o.length;c<u;c++){const d=this.parseVertexIndex(o[c],l);this.addVertexPoint(d),this.addColor(d)}},addLineGeometry:function(o,l){this.object.geometry.type="Line";const c=this.vertices.length,u=this.uvs.length;for(let d=0,_=o.length;d<_;d++)this.addVertexLine(this.parseVertexIndex(o[d],c));for(let d=0,_=l.length;d<_;d++)this.addUVLine(this.parseUVIndex(l[d],u))}};return M.startObject("",!1),M}class Pt extends r.Loader{constructor(o){super(o),this.materials=null}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,u)}setMaterials(o){return this.materials=o,this}parse(o){const l=new uo;o.indexOf(`\r
2
+ `)!==-1&&(o=o.replace(/\r\n/g,`
3
+ `)),o.indexOf(`\\
4
+ `)!==-1&&(o=o.replace(/\\\n/g,""));const c=o.split(`
5
+ `);let u=[];for(let p=0,w=c.length;p<w;p++){const y=c[p].trimStart();if(y.length===0)continue;const V=y.charAt(0);if(V!=="#")if(V==="v"){const D=y.split(Qt);switch(D[0]){case"v":l.vertices.push(parseFloat(D[1]),parseFloat(D[2]),parseFloat(D[3])),D.length>=7?(xt.setRGB(parseFloat(D[4]),parseFloat(D[5]),parseFloat(D[6]),r.SRGBColorSpace),l.colors.push(xt.r,xt.g,xt.b)):l.colors.push(void 0,void 0,void 0);break;case"vn":l.normals.push(parseFloat(D[1]),parseFloat(D[2]),parseFloat(D[3]));break;case"vt":l.uvs.push(parseFloat(D[1]),parseFloat(D[2]));break}}else if(V==="f"){const B=y.slice(1).trim().split(Qt),T=[];for(let v=0,m=B.length;v<m;v++){const S=B[v];if(S.length>0){const N=S.split("/");T.push(N)}}const R=T[0];for(let v=1,m=T.length-1;v<m;v++){const S=T[v],N=T[v+1];l.addFace(R[0],S[0],N[0],R[1],S[1],N[1],R[2],S[2],N[2])}}else if(V==="l"){const D=y.substring(1).trim().split(" ");let B=[];const T=[];if(y.indexOf("/")===-1)B=D;else for(let R=0,v=D.length;R<v;R++){const m=D[R].split("/");m[0]!==""&&B.push(m[0]),m[1]!==""&&T.push(m[1])}l.addLineGeometry(B,T)}else if(V==="p"){const B=y.slice(1).trim().split(" ");l.addPointGeometry(B)}else if((u=ao.exec(y))!==null){const D=(" "+u[0].slice(1).trim()).slice(1);l.startObject(D)}else if(lo.test(y))l.object.startMaterial(y.substring(7).trim(),l.materialLibraries);else if(ro.test(y))l.materialLibraries.push(y.substring(7).trim());else if(co.test(y))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(V==="s"){if(u=y.split(" "),u.length>1){const B=u[1].trim().toLowerCase();l.object.smooth=B!=="0"&&B!=="off"}else l.object.smooth=!0;const D=l.object.currentMaterial();D&&(D.smooth=l.object.smooth)}else{if(y==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+y+'"')}}l.finalize();const d=new r.Group;if(d.materialLibraries=[].concat(l.materialLibraries),!(l.objects.length===1&&l.objects[0].geometry.vertices.length===0)===!0)for(let p=0,w=l.objects.length;p<w;p++){const y=l.objects[p],V=y.geometry,D=y.materials,B=V.type==="Line",T=V.type==="Points";let R=!1;if(V.vertices.length===0)continue;const v=new r.BufferGeometry;v.setAttribute("position",new r.Float32BufferAttribute(V.vertices,3)),V.normals.length>0&&v.setAttribute("normal",new r.Float32BufferAttribute(V.normals,3)),V.colors.length>0&&(R=!0,v.setAttribute("color",new r.Float32BufferAttribute(V.colors,3))),V.hasUVIndices===!0&&v.setAttribute("uv",new r.Float32BufferAttribute(V.uvs,2));const m=[];for(let N=0,O=D.length;N<O;N++){const E=D[N],k=E.name+"_"+E.smooth+"_"+R;let g=l.materials[k];if(this.materials!==null){if(g=this.materials.create(E.name),B&&g&&!(g instanceof r.LineBasicMaterial)){const j=new r.LineBasicMaterial;r.Material.prototype.copy.call(j,g),j.color.copy(g.color),g=j}else if(T&&g&&!(g instanceof r.PointsMaterial)){const j=new r.PointsMaterial({size:10,sizeAttenuation:!1});r.Material.prototype.copy.call(j,g),j.color.copy(g.color),j.map=g.map,g=j}}g===void 0&&(B?g=new r.LineBasicMaterial:T?g=new r.PointsMaterial({size:1,sizeAttenuation:!1}):g=new r.MeshPhongMaterial,g.name=E.name,g.flatShading=!E.smooth,g.vertexColors=R,l.materials[k]=g),m.push(g)}let S;if(m.length>1){for(let N=0,O=D.length;N<O;N++){const E=D[N];v.addGroup(E.groupStart,E.groupCount,N)}B?S=new r.LineSegments(v,m):T?S=new r.Points(v,m):S=new r.Mesh(v,m)}else B?S=new r.LineSegments(v,m[0]):T?S=new r.Points(v,m[0]):S=new r.Mesh(v,m[0]);S.name=y.name,d.add(S)}else if(l.vertices.length>0){const p=new r.PointsMaterial({size:1,sizeAttenuation:!1}),w=new r.BufferGeometry;w.setAttribute("position",new r.Float32BufferAttribute(l.vertices,3)),l.colors.length>0&&l.colors[0]!==void 0&&(w.setAttribute("color",new r.Float32BufferAttribute(l.colors,3)),p.vertexColors=!0);const y=new r.Points(w,p);d.add(y)}return d}}class Lt extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=this.path===""?r.LoaderUtils.extractUrlBase(o):this.path,p=new r.FileLoader(this.manager);p.setPath(this.path),p.setRequestHeader(this.requestHeader),p.setWithCredentials(this.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(y){u?u(y):console.error(y),d.manager.itemError(o)}},c,u)}setMaterialOptions(o){return this.materialOptions=o,this}parse(o,l){const c=o.split(`
6
+ `);let u={};const d=/\s+/,_={};for(let w=0;w<c.length;w++){let y=c[w];if(y=y.trim(),y.length===0||y.charAt(0)==="#")continue;const V=y.indexOf(" ");let D=V>=0?y.substring(0,V):y;D=D.toLowerCase();let B=V>=0?y.substring(V+1):"";if(B=B.trim(),D==="newmtl")u={name:B},_[B]=u;else if(D==="ka"||D==="kd"||D==="ks"||D==="ke"){const T=B.split(d,3);u[D]=[parseFloat(T[0]),parseFloat(T[1]),parseFloat(T[2])]}else u[D]=B}const p=new ho(this.resourcePath||l,this.materialOptions);return p.setCrossOrigin(this.crossOrigin),p.setManager(this.manager),p.setMaterials(_),p}}class ho{constructor(o="",l={}){this.baseUrl=o,this.options=l,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:r.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:r.RepeatWrapping}setCrossOrigin(o){return this.crossOrigin=o,this}setManager(o){this.manager=o}setMaterials(o){this.materialsInfo=this.convert(o),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(o){if(!this.options)return o;const l={};for(const c in o){const u=o[c],d={};l[c]=d;for(const _ in u){let p=!0,w=u[_];const y=_.toLowerCase();switch(y){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(w=[w[0]/255,w[1]/255,w[2]/255]),this.options&&this.options.ignoreZeroRGBs&&w[0]===0&&w[1]===0&&w[2]===0&&(p=!1);break}p&&(d[y]=w)}}return l}preload(){for(const o in this.materialsInfo)this.create(o)}getIndex(o){return this.nameLookup[o]}getAsArray(){let o=0;for(const l in this.materialsInfo)this.materialsArray[o]=this.create(l),this.nameLookup[l]=o,o++;return this.materialsArray}create(o){return this.materials[o]===void 0&&this.createMaterial_(o),this.materials[o]}createMaterial_(o){const l=this,c=this.materialsInfo[o],u={name:o,side:this.side};function d(p,w){return typeof w!="string"||w===""?"":/^https?:\/\//i.test(w)?w:p+w}function _(p,w){if(u[p])return;const y=l.getTextureParams(w,u),V=l.loadTexture(d(l.baseUrl,y.url));V.repeat.copy(y.scale),V.offset.copy(y.offset),V.wrapS=l.wrap,V.wrapT=l.wrap,(p==="map"||p==="emissiveMap")&&(V.colorSpace=r.SRGBColorSpace),u[p]=V}for(const p in c){const w=c[p];let y;if(w!=="")switch(p.toLowerCase()){case"kd":u.color=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ks":u.specular=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"ke":u.emissive=r.ColorManagement.colorSpaceToWorking(new r.Color().fromArray(w),r.SRGBColorSpace);break;case"map_kd":_("map",w);break;case"map_ks":_("specularMap",w);break;case"map_ke":_("emissiveMap",w);break;case"norm":_("normalMap",w);break;case"map_bump":case"bump":_("bumpMap",w);break;case"disp":_("displacementMap",w);break;case"map_d":_("alphaMap",w),u.transparent=!0;break;case"ns":u.shininess=parseFloat(w);break;case"d":y=parseFloat(w),y<1&&(u.opacity=y,u.transparent=!0);break;case"tr":y=parseFloat(w),this.options&&this.options.invertTrProperty&&(y=1-y),y>0&&(u.opacity=1-y,u.transparent=!0);break}}return this.materials[o]=new r.MeshPhongMaterial(u),this.materials[o]}getTextureParams(o,l){const c={scale:new r.Vector2(1,1),offset:new r.Vector2(0,0)},u=o.split(/\s+/);let d;return d=u.indexOf("-bm"),d>=0&&(l.bumpScale=parseFloat(u[d+1]),u.splice(d,2)),d=u.indexOf("-mm"),d>=0&&(l.displacementBias=parseFloat(u[d+1]),l.displacementScale=parseFloat(u[d+2]),u.splice(d,3)),d=u.indexOf("-s"),d>=0&&(c.scale.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),d=u.indexOf("-o"),d>=0&&(c.offset.set(parseFloat(u[d+1]),parseFloat(u[d+2])),u.splice(d,4)),c.url=u.join(" ").trim(),c}loadTexture(o,l,c,u,d){const _=this.manager!==void 0?this.manager:r.DefaultLoadingManager;let p=_.getHandler(o);p===null&&(p=new r.TextureLoader(_)),p.setCrossOrigin&&p.setCrossOrigin(this.crossOrigin);const w=p.load(o,c,u,d);return l!==void 0&&(w.mapping=l),w}}class Nt extends r.Loader{constructor(o){super(o)}load(o,l,c,u){const d=this,_=new r.FileLoader(this.manager);_.setPath(this.path),_.setResponseType("arraybuffer"),_.setRequestHeader(this.requestHeader),_.setWithCredentials(this.withCredentials),_.load(o,function(p){try{l(d.parse(p))}catch(w){u?u(w):console.error(w),d.manager.itemError(o)}},c,u)}parse(o){function l(y){const V=new DataView(y),D=32/8*3+32/8*3*3+16/8,B=V.getUint32(80,!0);if(80+32/8+B*D===V.byteLength)return!0;const R=[115,111,108,105,100];for(let v=0;v<5;v++)if(c(R,V,v))return!1;return!0}function c(y,V,D){for(let B=0,T=y.length;B<T;B++)if(y[B]!==V.getUint8(D+B))return!1;return!0}function u(y){const V=new DataView(y),D=V.getUint32(80,!0);let B,T,R,v=!1,m,S,N,O,E;for(let F=0;F<70;F++)V.getUint32(F,!1)==1129270351&&V.getUint8(F+4)==82&&V.getUint8(F+5)==61&&(v=!0,m=new Float32Array(D*3*3),S=V.getUint8(F+6)/255,N=V.getUint8(F+7)/255,O=V.getUint8(F+8)/255,E=V.getUint8(F+9)/255);const k=84,g=12*4+2,j=new r.BufferGeometry,A=new Float32Array(D*3*3),x=new Float32Array(D*3*3),q=new r.Color;for(let F=0;F<D;F++){const U=k+F*g,ie=V.getFloat32(U,!0),ce=V.getFloat32(U+4,!0),b=V.getFloat32(U+8,!0);if(v){const h=V.getUint16(U+48,!0);(h&32768)===0?(B=(h&31)/31,T=(h>>5&31)/31,R=(h>>10&31)/31):(B=S,T=N,R=O)}for(let h=1;h<=3;h++){const I=U+h*12,$=F*3*3+(h-1)*3;A[$]=V.getFloat32(I,!0),A[$+1]=V.getFloat32(I+4,!0),A[$+2]=V.getFloat32(I+8,!0),x[$]=ie,x[$+1]=ce,x[$+2]=b,v&&(q.setRGB(B,T,R,r.SRGBColorSpace),m[$]=q.r,m[$+1]=q.g,m[$+2]=q.b)}}return j.setAttribute("position",new r.BufferAttribute(A,3)),j.setAttribute("normal",new r.BufferAttribute(x,3)),v&&(j.setAttribute("color",new r.BufferAttribute(m,3)),j.hasColors=!0,j.alpha=E),j}function d(y){const V=new r.BufferGeometry,D=/solid([\s\S]*?)endsolid/g,B=/facet([\s\S]*?)endfacet/g,T=/solid\s(.+)/;let R=0;const v=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,m=new RegExp("vertex"+v+v+v,"g"),S=new RegExp("normal"+v+v+v,"g"),N=[],O=[],E=[],k=new r.Vector3;let g,j=0,A=0,x=0;for(;(g=D.exec(y))!==null;){A=x;const q=g[0],F=(g=T.exec(q))!==null?g[1]:"";for(E.push(F);(g=B.exec(q))!==null;){let ce=0,b=0;const h=g[0];for(;(g=S.exec(h))!==null;)k.x=parseFloat(g[1]),k.y=parseFloat(g[2]),k.z=parseFloat(g[3]),b++;for(;(g=m.exec(h))!==null;)N.push(parseFloat(g[1]),parseFloat(g[2]),parseFloat(g[3])),O.push(k.x,k.y,k.z),ce++,x++;b!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+R),ce!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+R),R++}const U=A,ie=x-A;V.userData.groupNames=E,V.addGroup(U,ie,j),j++}return V.setAttribute("position",new r.Float32BufferAttribute(N,3)),V.setAttribute("normal",new r.Float32BufferAttribute(O,3)),V}function _(y){return typeof y!="string"?new TextDecoder().decode(y):y}function p(y){if(typeof y=="string"){const V=new Uint8Array(y.length);for(let D=0;D<y.length;D++)V[D]=y.charCodeAt(D)&255;return V.buffer||V}else return y}const w=p(o);return l(w)?u(w):d(_(o))}}class on extends r.DataTextureLoader{constructor(o){super(o)}parse(o){function l(h){switch(h.image_type){case B:case v:if(h.colormap_length>256||h.colormap_size!==24||h.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case T:case R:case m:case S:if(h.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case D:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+h.image_type)}if(h.width<=0||h.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(h.pixel_size!==8&&h.pixel_size!==16&&h.pixel_size!==24&&h.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+h.pixel_size)}function c(h,I,$,H,re){let P,se;const W=$.pixel_size>>3,K=$.width*$.height*W;if(I&&(se=re.subarray(H,H+=$.colormap_length*($.colormap_size>>3))),h){P=new Uint8Array(K);let Z,G,X,he=0;const pe=new Uint8Array(W);for(;he<K;)if(Z=re[H++],G=(Z&127)+1,Z&128){for(X=0;X<W;++X)pe[X]=re[H++];for(X=0;X<G;++X)P.set(pe,he+X*W);he+=W*G}else{for(G*=W,X=0;X<G;++X)P[he+X]=re[H++];he+=G}}else P=re.subarray(H,H+=I?$.width*$.height:K);return{pixel_data:P,palettes:se}}function u(h,I,$,H,re,P,se,W,K){const Z=K;let G,X=0,he,pe;const le=q.width;for(pe=I;pe!==H;pe+=$)for(he=re;he!==se;he+=P,X++)G=W[X],h[(he+le*pe)*4+3]=255,h[(he+le*pe)*4+2]=Z[G*3+0],h[(he+le*pe)*4+1]=Z[G*3+1],h[(he+le*pe)*4+0]=Z[G*3+2];return h}function d(h,I,$,H,re,P,se,W){let K,Z=0,G,X;const he=q.width;for(X=I;X!==H;X+=$)for(G=re;G!==se;G+=P,Z+=2)K=W[Z+0]+(W[Z+1]<<8),h[(G+he*X)*4+0]=(K&31744)>>7,h[(G+he*X)*4+1]=(K&992)>>2,h[(G+he*X)*4+2]=(K&31)<<3,h[(G+he*X)*4+3]=K&32768?0:255;return h}function _(h,I,$,H,re,P,se,W){let K=0,Z,G;const X=q.width;for(G=I;G!==H;G+=$)for(Z=re;Z!==se;Z+=P,K+=3)h[(Z+X*G)*4+3]=255,h[(Z+X*G)*4+2]=W[K+0],h[(Z+X*G)*4+1]=W[K+1],h[(Z+X*G)*4+0]=W[K+2];return h}function p(h,I,$,H,re,P,se,W){let K=0,Z,G;const X=q.width;for(G=I;G!==H;G+=$)for(Z=re;Z!==se;Z+=P,K+=4)h[(Z+X*G)*4+2]=W[K+0],h[(Z+X*G)*4+1]=W[K+1],h[(Z+X*G)*4+0]=W[K+2],h[(Z+X*G)*4+3]=W[K+3];return h}function w(h,I,$,H,re,P,se,W){let K,Z=0,G,X;const he=q.width;for(X=I;X!==H;X+=$)for(G=re;G!==se;G+=P,Z++)K=W[Z],h[(G+he*X)*4+0]=K,h[(G+he*X)*4+1]=K,h[(G+he*X)*4+2]=K,h[(G+he*X)*4+3]=255;return h}function y(h,I,$,H,re,P,se,W){let K=0,Z,G;const X=q.width;for(G=I;G!==H;G+=$)for(Z=re;Z!==se;Z+=P,K+=2)h[(Z+X*G)*4+0]=W[K+0],h[(Z+X*G)*4+1]=W[K+0],h[(Z+X*G)*4+2]=W[K+0],h[(Z+X*G)*4+3]=W[K+1];return h}function V(h,I,$,H,re){let P,se,W,K,Z,G;switch((q.flags&N)>>O){default:case g:P=0,W=1,Z=I,se=0,K=1,G=$;break;case E:P=0,W=1,Z=I,se=$-1,K=-1,G=-1;break;case j:P=I-1,W=-1,Z=-1,se=0,K=1,G=$;break;case k:P=I-1,W=-1,Z=-1,se=$-1,K=-1,G=-1;break}if(ie)switch(q.pixel_size){case 8:w(h,se,K,G,P,W,Z,H);break;case 16:y(h,se,K,G,P,W,Z,H);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(q.pixel_size){case 8:u(h,se,K,G,P,W,Z,H,re);break;case 16:d(h,se,K,G,P,W,Z,H);break;case 24:_(h,se,K,G,P,W,Z,H);break;case 32:p(h,se,K,G,P,W,Z,H);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return h}const D=0,B=1,T=2,R=3,v=9,m=10,S=11,N=48,O=4,E=0,k=1,g=2,j=3;if(o.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let A=0;const x=new Uint8Array(o),q={id_length:x[A++],colormap_type:x[A++],image_type:x[A++],colormap_index:x[A++]|x[A++]<<8,colormap_length:x[A++]|x[A++]<<8,colormap_size:x[A++],origin:[x[A++]|x[A++]<<8,x[A++]|x[A++]<<8],width:x[A++]|x[A++]<<8,height:x[A++]|x[A++]<<8,pixel_size:x[A++],flags:x[A++]};if(l(q),q.id_length+A>o.length)throw new Error("THREE.TGALoader: No data.");A+=q.id_length;let F=!1,U=!1,ie=!1;switch(q.image_type){case v:F=!0,U=!0;break;case B:U=!0;break;case m:F=!0;break;case T:break;case S:F=!0,ie=!0;break;case R:ie=!0;break}const ce=new Uint8Array(q.width*q.height*4),b=c(F,U,q,A,x);return V(ce,q.width,q.height,b.pixel_data,b.palettes),{data:ce,width:q.width,height:q.height,flipY:!0,generateMipmaps:!0,minFilter:r.LinearMipmapLinearFilter}}}class po extends r.Loader{load(o,l,c,u){const d=this,_=d.path===""?r.LoaderUtils.extractUrlBase(o):d.path,p=new r.FileLoader(d.manager);p.setPath(d.path),p.setRequestHeader(d.requestHeader),p.setWithCredentials(d.withCredentials),p.load(o,function(w){try{l(d.parse(w,_))}catch(y){u?u(y):console.error(y),d.manager.itemError(o)}},c,u)}parse(o,l){function c(n,t){const i=[],s=n.childNodes;for(let a=0,f=s.length;a<f;a++){const C=s[a];C.nodeName===t&&i.push(C)}return i}function u(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=t[s];return i}function d(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseFloat(t[s]);return i}function _(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),i=new Array(t.length);for(let s=0,a=t.length;s<a;s++)i[s]=parseInt(t[s]);return i}function p(n){return n.substring(1)}function w(){return"three_default_"+On++}function y(n){return Object.keys(n).length===0}function V(n){return{unit:D(c(n,"unit")[0]),upAxis:B(c(n,"up_axis")[0])}}function D(n){return n!==void 0&&n.hasAttribute("meter")===!0?parseFloat(n.getAttribute("meter")):1}function B(n){return n!==void 0?n.textContent:"Y_UP"}function T(n,t,i,s){const a=c(n,t)[0];if(a!==void 0){const f=c(a,i);for(let C=0;C<f.length;C++)s(f[C])}}function R(n,t){for(const i in n){const s=n[i];s.build=t(n[i])}}function v(n,t){return n.build!==void 0||(n.build=t(n)),n.build}function m(n){const t={sources:{},samplers:{},channels:{}};let i=!1;for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType!==1)continue;let C;switch(f.nodeName){case"source":C=f.getAttribute("id"),t.sources[C]=Ge(f);break;case"sampler":C=f.getAttribute("id"),t.samplers[C]=S(f);break;case"channel":C=f.getAttribute("target"),t.channels[C]=N(f);break;case"animation":m(f),i=!0;break;default:console.log(f)}}i===!1&&(ae.animations[n.getAttribute("id")||r.MathUtils.generateUUID()]=t)}function S(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=p(a.getAttribute("source")),C=a.getAttribute("semantic");t.inputs[C]=f;break}}return t}function N(n){const t={};let s=n.getAttribute("target").split("/");const a=s.shift();let f=s.shift();const C=f.indexOf("(")!==-1,J=f.indexOf(".")!==-1;if(J)s=f.split("."),f=s.shift(),t.member=s.shift();else if(C){const z=f.split("(");f=z.shift();for(let Y=0;Y<z.length;Y++)z[Y]=parseInt(z[Y].replace(/\)/,""));t.indices=z}return t.id=a,t.sid=f,t.arraySyntax=C,t.memberSyntax=J,t.sampler=p(n.getAttribute("source")),t}function O(n){const t=[],i=n.channels,s=n.samplers,a=n.sources;for(const f in i)if(i.hasOwnProperty(f)){const C=i[f],J=s[C.sampler],z=J.inputs.INPUT,Y=J.inputs.OUTPUT,te=a[z],L=a[Y],ee=k(C,te,L);q(ee,t)}return t}function E(n){return v(ae.animations[n],O)}function k(n,t,i){const s=ae.nodes[n.id],a=bt(s.id),f=s.transforms[n.sid],C=s.matrix.clone().transpose();let J,z,Y,te,L,ee;const Q={};switch(f){case"matrix":for(Y=0,te=t.array.length;Y<te;Y++)if(J=t.array[Y],z=Y*i.stride,Q[J]===void 0&&(Q[J]={}),n.arraySyntax===!0){const ve=i.array[z],be=n.indices[0]+4*n.indices[1];Q[J][be]=ve}else for(L=0,ee=i.stride;L<ee;L++)Q[J][L]=i.array[z+L];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',f);break}const oe=g(Q,C);return{name:a.uuid,keyframes:oe}}function g(n,t){const i=[];for(const a in n)i.push({time:parseFloat(a),value:n[a]});i.sort(s);for(let a=0;a<16;a++)F(i,a,t.elements[a]);return i;function s(a,f){return a.time-f.time}}const j=new r.Vector3,A=new r.Vector3,x=new r.Quaternion;function q(n,t){const i=n.keyframes,s=n.name,a=[],f=[],C=[],J=[];for(let z=0,Y=i.length;z<Y;z++){const te=i[z],L=te.time,ee=te.value;De.fromArray(ee).transpose(),De.decompose(j,x,A),a.push(L),f.push(j.x,j.y,j.z),C.push(x.x,x.y,x.z,x.w),J.push(A.x,A.y,A.z)}return f.length>0&&t.push(new r.VectorKeyframeTrack(s+".position",a,f)),C.length>0&&t.push(new r.QuaternionKeyframeTrack(s+".quaternion",a,C)),J.length>0&&t.push(new r.VectorKeyframeTrack(s+".scale",a,J)),t}function F(n,t,i){let s,a=!0,f,C;for(f=0,C=n.length;f<C;f++)s=n[f],s.value[t]===void 0?s.value[t]=null:a=!1;if(a===!0)for(f=0,C=n.length;f<C;f++)s=n[f],s.value[t]=i;else U(n,t)}function U(n,t){let i,s;for(let a=0,f=n.length;a<f;a++){const C=n[a];if(C.value[t]===null){if(i=ie(n,a,t),s=ce(n,a,t),i===null){C.value[t]=s.value[t];continue}if(s===null){C.value[t]=i.value[t];continue}b(C,i,s,t)}}}function ie(n,t,i){for(;t>=0;){const s=n[t];if(s.value[i]!==null)return s;t--}return null}function ce(n,t,i){for(;t<n.length;){const s=n[t];if(s.value[i]!==null)return s;t++}return null}function b(n,t,i,s){if(i.time-t.time===0){n.value[s]=t.value[s];return}n.value[s]=(n.time-t.time)*(i.value[s]-t.value[s])/(i.time-t.time)+t.value[s]}function h(n){const t={name:n.getAttribute("id")||"default",start:parseFloat(n.getAttribute("start")||0),end:parseFloat(n.getAttribute("end")||0),animations:[]};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_animation":t.animations.push(p(a.getAttribute("url")));break}}ae.clips[n.getAttribute("id")]=t}function I(n){const t=[],i=n.name,s=n.end-n.start||-1,a=n.animations;for(let f=0,C=a.length;f<C;f++){const J=E(a[f]);for(let z=0,Y=J.length;z<Y;z++)t.push(J[z])}return new r.AnimationClip(i,s,t)}function $(n){return v(ae.clips[n],I)}function H(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"skin":t.id=p(a.getAttribute("source")),t.skin=re(a);break;case"morph":t.id=p(a.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}ae.controllers[n.getAttribute("id")]=t}function re(n){const t={sources:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=d(a.textContent);break;case"source":const f=a.getAttribute("id");t.sources[f]=Ge(a);break;case"joints":t.joints=P(a);break;case"vertex_weights":t.vertexWeights=se(a);break}}return t}function P(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),C=p(a.getAttribute("source"));t.inputs[f]=C;break}}return t}function se(n){const t={inputs:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=a.getAttribute("semantic"),C=p(a.getAttribute("source")),J=parseInt(a.getAttribute("offset"));t.inputs[f]={id:C,offset:J};break;case"vcount":t.vcount=_(a.textContent);break;case"v":t.v=_(a.textContent);break}}return t}function W(n){const t={id:n.id},i=ae.geometries[t.id];return n.skin!==void 0&&(t.skin=K(n.skin),i.sources.skinIndices=t.skin.indices,i.sources.skinWeights=t.skin.weights),t}function K(n){const i={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=n.sources,a=n.vertexWeights,f=a.vcount,C=a.v,J=a.inputs.JOINT.offset,z=a.inputs.WEIGHT.offset,Y=n.sources[n.joints.inputs.JOINT],te=n.sources[n.joints.inputs.INV_BIND_MATRIX],L=s[a.inputs.WEIGHT.id].array;let ee=0,Q,oe,ne;for(Q=0,ne=f.length;Q<ne;Q++){const be=f[Q],fe=[];for(oe=0;oe<be;oe++){const me=C[ee+J],Ye=C[ee+z],Ve=L[Ye];fe.push({index:me,weight:Ve}),ee+=2}for(fe.sort(ve),oe=0;oe<4;oe++){const me=fe[oe];me!==void 0?(i.indices.array.push(me.index),i.weights.array.push(me.weight)):(i.indices.array.push(0),i.weights.array.push(0))}}for(n.bindShapeMatrix?i.bindMatrix=new r.Matrix4().fromArray(n.bindShapeMatrix).transpose():i.bindMatrix=new r.Matrix4().identity(),Q=0,ne=Y.array.length;Q<ne;Q++){const be=Y.array[Q],fe=new r.Matrix4().fromArray(te.array,Q*te.stride).transpose();i.joints.push({name:be,boneInverse:fe})}return i;function ve(be,fe){return fe.weight-be.weight}}function Z(n){return v(ae.controllers[n],W)}function G(n){const t={init_from:c(n,"init_from")[0].textContent};ae.images[n.getAttribute("id")]=t}function X(n){return n.build!==void 0?n.build:n.init_from}function he(n){const t=ae.images[n];return t!==void 0?v(t,X):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",n),null)}function pe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"profile_COMMON":t.profile=le(a);break}}ae.effects[n.getAttribute("id")]=t}function le(n){const t={surfaces:{},samplers:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"newparam":Se(a,t);break;case"technique":t.technique=tt(a);break;case"extra":t.extra=Ue(a);break}}return t}function Se(n,t){const i=n.getAttribute("sid");for(let s=0,a=n.childNodes.length;s<a;s++){const f=n.childNodes[s];if(f.nodeType===1)switch(f.nodeName){case"surface":t.surfaces[i]=Le(f);break;case"sampler2D":t.samplers[i]=Fe(f);break}}}function Le(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"init_from":t.init_from=a.textContent;break}}return t}function Fe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"source":t.source=a.textContent;break}}return t}function tt(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=a.nodeName,t.parameters=nt(a);break;case"extra":t.extra=Ue(a);break}}return t}function nt(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[a.nodeName]=We(a);break;case"transparent":t[a.nodeName]={opaque:a.hasAttribute("opaque")?a.getAttribute("opaque"):"A_ONE",data:We(a)};break}}return t}function We(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":t[a.nodeName]=d(a.textContent);break;case"float":t[a.nodeName]=parseFloat(a.textContent);break;case"texture":t[a.nodeName]={id:a.getAttribute("texture"),extra:Ze(a)};break}}return t}function Ze(n){const t={technique:{}};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"extra":ot(a,t);break}}return t}function ot(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":Ne(a,t);break}}}function Ne(n,t){for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[a.nodeName]=parseFloat(a.textContent);break;case"wrapU":case"wrapV":a.textContent.toUpperCase()==="TRUE"?t.technique[a.nodeName]=1:a.textContent.toUpperCase()==="FALSE"?t.technique[a.nodeName]=0:t.technique[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=Pe(a);break}}}function Ue(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique":t.technique=xe(a);break}}return t}function xe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"double_sided":t[a.nodeName]=parseInt(a.textContent);break;case"bump":t[a.nodeName]=Pe(a);break}}return t}function Pe(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"texture":t[a.nodeName]={id:a.getAttribute("texture"),texcoord:a.getAttribute("texcoord"),extra:Ze(a)};break}}return t}function ue(n){return n}function ut(n){return v(ae.effects[n],ue)}function ht(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"instance_effect":t.url=p(a.getAttribute("url"));break}}ae.materials[n.getAttribute("id")]=t}function Ce(n){let t,i=n.slice((n.lastIndexOf(".")-1>>>0)+2);switch(i=i.toLowerCase(),i){case"tga":t=At;break;default:t=Kt}return t}function Je(n){const t=ut(n.url),i=t.profile.technique;let s;switch(i.type){case"phong":case"blinn":s=new r.MeshPhongMaterial;break;case"lambert":s=new r.MeshLambertMaterial;break;default:s=new r.MeshBasicMaterial;break}s.name=n.name||"";function a(z,Y=null){const te=t.profile.samplers[z.id];let L=null;if(te!==void 0){const ee=t.profile.surfaces[te.source];L=he(ee.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),L=he(z.id);if(L!==null){const ee=Ce(L);if(ee!==void 0){const Q=ee.load(L),oe=z.extra;if(oe!==void 0&&oe.technique!==void 0&&y(oe.technique)===!1){const ne=oe.technique;Q.wrapS=ne.wrapU?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.wrapT=ne.wrapV?r.RepeatWrapping:r.ClampToEdgeWrapping,Q.offset.set(ne.offsetU||0,ne.offsetV||0),Q.repeat.set(ne.repeatU||1,ne.repeatV||1)}else Q.wrapS=r.RepeatWrapping,Q.wrapT=r.RepeatWrapping;return Y!==null&&(Q.colorSpace=Y),Q}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",L),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",z.id),null}const f=i.parameters;for(const z in f){const Y=f[z];switch(z){case"diffuse":Y.color&&s.color.fromArray(Y.color),Y.texture&&(s.map=a(Y.texture,r.SRGBColorSpace));break;case"specular":Y.color&&s.specular&&s.specular.fromArray(Y.color),Y.texture&&(s.specularMap=a(Y.texture));break;case"bump":Y.texture&&(s.normalMap=a(Y.texture));break;case"ambient":Y.texture&&(s.lightMap=a(Y.texture,r.SRGBColorSpace));break;case"shininess":Y.float&&s.shininess&&(s.shininess=Y.float);break;case"emission":Y.color&&s.emissive&&s.emissive.fromArray(Y.color),Y.texture&&(s.emissiveMap=a(Y.texture,r.SRGBColorSpace));break}}r.ColorManagement.colorSpaceToWorking(s.color,r.SRGBColorSpace),s.specular&&r.ColorManagement.colorSpaceToWorking(s.specular,r.SRGBColorSpace),s.emissive&&r.ColorManagement.colorSpaceToWorking(s.emissive,r.SRGBColorSpace);let C=f.transparent,J=f.transparency;if(J===void 0&&C&&(J={float:1}),C===void 0&&J&&(C={opaque:"A_ONE",data:{color:[1,1,1,1]}}),C&&J)if(C.data.texture)s.transparent=!0;else{const z=C.data.color;switch(C.opaque){case"A_ONE":s.opacity=z[3]*J.float;break;case"RGB_ZERO":s.opacity=1-z[0]*J.float;break;case"A_ZERO":s.opacity=1-z[3]*J.float;break;case"RGB_ONE":s.opacity=z[0]*J.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',C.opaque)}s.opacity<1&&(s.transparent=!0)}if(i.extra!==void 0&&i.extra.technique!==void 0){const z=i.extra.technique;for(const Y in z){const te=z[Y];switch(Y){case"double_sided":s.side=te===1?r.DoubleSide:r.FrontSide;break;case"bump":s.normalMap=a(te.texture),s.normalScale=new r.Vector2(1,1);break}}}return s}function st(n){return v(ae.materials[n],Je)}function it(n){const t={name:n.getAttribute("name")};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"optics":t.optics=pt(a);break}}ae.cameras[n.getAttribute("id")]=t}function pt(n){for(let t=0;t<n.childNodes.length;t++){const i=n.childNodes[t];switch(i.nodeName){case"technique_common":return ft(i)}}return{}}function ft(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"perspective":case"orthographic":t.technique=s.nodeName,t.parameters=at(s);break}}return t}function at(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"xfov":case"yfov":case"xmag":case"ymag":case"znear":case"zfar":case"aspect_ratio":t[s.nodeName]=parseFloat(s.textContent);break}}return t}function ge(n){let t;switch(n.optics.technique){case"perspective":t=new r.PerspectiveCamera(n.optics.parameters.yfov,n.optics.parameters.aspect_ratio,n.optics.parameters.znear,n.optics.parameters.zfar);break;case"orthographic":let i=n.optics.parameters.ymag,s=n.optics.parameters.xmag;const a=n.optics.parameters.aspect_ratio;s=s===void 0?i*a:s,i=i===void 0?s/a:i,s*=.5,i*=.5,t=new r.OrthographicCamera(-s,s,i,-i,n.optics.parameters.znear,n.optics.parameters.zfar);break;default:t=new r.PerspectiveCamera;break}return t.name=n.name||"",t}function ke(n){const t=ae.cameras[n];return t!==void 0?v(t,ge):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",n),null)}function je(n){let t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"technique_common":t=Ae(a);break}}ae.lights[n.getAttribute("id")]=t}function Ae(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=a.nodeName,t.parameters=_e(a)}}return t}function _e(n){const t={};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"color":const f=d(a.textContent);t.color=new r.Color().fromArray(f),r.ColorManagement.colorSpaceToWorking(t.color,r.SRGBColorSpace);break;case"falloff_angle":t.falloffAngle=parseFloat(a.textContent);break;case"quadratic_attenuation":const C=parseFloat(a.textContent);t.distance=C?Math.sqrt(1/C):0;break}}return t}function Re(n){let t;switch(n.technique){case"directional":t=new r.DirectionalLight;break;case"point":t=new r.PointLight;break;case"spot":t=new r.SpotLight;break;case"ambient":t=new r.AmbientLight;break}return n.parameters.color&&t.color.copy(n.parameters.color),n.parameters.distance&&(t.distance=n.parameters.distance),t}function qe(n){const t=ae.lights[n];return t!==void 0?v(t,Re):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",n),null)}function He(n){const t={name:n.getAttribute("name"),sources:{},vertices:{},primitives:[]},i=c(n,"mesh")[0];if(i!==void 0){for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;const f=a.getAttribute("id");switch(a.nodeName){case"source":t.sources[f]=Ge(a);break;case"vertices":t.vertices=rt(a);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",a.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(Xe(a));break;default:console.log(a)}}ae.geometries[n.getAttribute("id")]=t}}function Ge(n){const t={array:[],stride:3};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"float_array":t.array=d(s.textContent);break;case"Name_array":t.array=u(s.textContent);break;case"technique_common":const a=c(s,"accessor")[0];a!==void 0&&(t.stride=parseInt(a.getAttribute("stride")));break}}return t}function rt(n){const t={};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];s.nodeType===1&&(t[s.getAttribute("semantic")]=p(s.getAttribute("source")))}return t}function Xe(n){const t={type:n.nodeName,material:n.getAttribute("material"),count:parseInt(n.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let i=0,s=n.childNodes.length;i<s;i++){const a=n.childNodes[i];if(a.nodeType===1)switch(a.nodeName){case"input":const f=p(a.getAttribute("source")),C=a.getAttribute("semantic"),J=parseInt(a.getAttribute("offset")),z=parseInt(a.getAttribute("set")),Y=z>0?C+z:C;t.inputs[Y]={id:f,offset:J},t.stride=Math.max(t.stride,J+1),C==="TEXCOORD"&&(t.hasUV=!0);break;case"vcount":t.vcount=_(a.textContent);break;case"p":t.p=_(a.textContent);break}}return t}function Qe(n){const t={};for(let i=0;i<n.length;i++){const s=n[i];t[s.type]===void 0&&(t[s.type]=[]),t[s.type].push(s)}return t}function $e(n){let t=0;for(let i=0,s=n.length;i<s;i++)n[i].hasUV===!0&&t++;t>0&&t<n.length&&(n.uvsNeedsFix=!0)}function mt(n){const t={},i=n.sources,s=n.vertices,a=n.primitives;if(a.length===0)return{};const f=Qe(a);for(const C in f){const J=f[C];$e(J),t[C]=un(J,i,s)}return t}function un(n,t,i){const s={},a={array:[],stride:0},f={array:[],stride:0},C={array:[],stride:0},J={array:[],stride:0},z={array:[],stride:0},Y={array:[],stride:4},te={array:[],stride:4},L=new r.BufferGeometry,ee=[];let Q=0;for(let oe=0;oe<n.length;oe++){const ne=n[oe],ve=ne.inputs;let be=0;switch(ne.type){case"lines":case"linestrips":be=ne.count*2;break;case"triangles":be=ne.count*3;break;case"polylist":for(let fe=0;fe<ne.count;fe++){const me=ne.vcount[fe];switch(me){case 3:be+=3;break;case 4:be+=6;break;default:be+=(me-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",ne.type)}L.addGroup(Q,be,oe),Q+=be,ne.material&&ee.push(ne.material);for(const fe in ve){const me=ve[fe];switch(fe){case"VERTEX":for(const Ye in i){const Ve=i[Ye];switch(Ye){case"POSITION":const yt=a.array.length;if(ze(ne,t[Ve],me.offset,a.array),a.stride=t[Ve].stride,t.skinWeights&&t.skinIndices&&(ze(ne,t.skinIndices,me.offset,Y.array),ze(ne,t.skinWeights,me.offset,te.array)),ne.hasUV===!1&&n.uvsNeedsFix===!0){const In=(a.array.length-yt)/a.stride;for(let Zt=0;Zt<In;Zt++)C.array.push(0,0)}break;case"NORMAL":ze(ne,t[Ve],me.offset,f.array),f.stride=t[Ve].stride;break;case"COLOR":ze(ne,t[Ve],me.offset,z.array),z.stride=t[Ve].stride;break;case"TEXCOORD":ze(ne,t[Ve],me.offset,C.array),C.stride=t[Ve].stride;break;case"TEXCOORD1":ze(ne,t[Ve],me.offset,J.array),C.stride=t[Ve].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',Ye)}}break;case"NORMAL":ze(ne,t[me.id],me.offset,f.array),f.stride=t[me.id].stride;break;case"COLOR":ze(ne,t[me.id],me.offset,z.array,!0),z.stride=t[me.id].stride;break;case"TEXCOORD":ze(ne,t[me.id],me.offset,C.array),C.stride=t[me.id].stride;break;case"TEXCOORD1":ze(ne,t[me.id],me.offset,J.array),J.stride=t[me.id].stride;break}}}return a.array.length>0&&L.setAttribute("position",new r.Float32BufferAttribute(a.array,a.stride)),f.array.length>0&&L.setAttribute("normal",new r.Float32BufferAttribute(f.array,f.stride)),z.array.length>0&&L.setAttribute("color",new r.Float32BufferAttribute(z.array,z.stride)),C.array.length>0&&L.setAttribute("uv",new r.Float32BufferAttribute(C.array,C.stride)),J.array.length>0&&L.setAttribute("uv1",new r.Float32BufferAttribute(J.array,J.stride)),Y.array.length>0&&L.setAttribute("skinIndex",new r.Float32BufferAttribute(Y.array,Y.stride)),te.array.length>0&&L.setAttribute("skinWeight",new r.Float32BufferAttribute(te.array,te.stride)),s.data=L,s.type=n[0].type,s.materialKeys=ee,s}function ze(n,t,i,s,a=!1){const f=n.p,C=n.stride,J=n.vcount;function z(L){let ee=f[L+i]*te;const Q=ee+te;for(;ee<Q;ee++)s.push(Y[ee]);if(a){const oe=s.length-te-1;_t.setRGB(s[oe+0],s[oe+1],s[oe+2],r.SRGBColorSpace),s[oe+0]=_t.r,s[oe+1]=_t.g,s[oe+2]=_t.b}}const Y=t.array,te=t.stride;if(n.vcount!==void 0){let L=0;for(let ee=0,Q=J.length;ee<Q;ee++){const oe=J[ee];if(oe===4){const ne=L+C*0,ve=L+C*1,be=L+C*2,fe=L+C*3;z(ne),z(ve),z(fe),z(ve),z(be),z(fe)}else if(oe===3){const ne=L+C*0,ve=L+C*1,be=L+C*2;z(ne),z(ve),z(be)}else if(oe>4)for(let ne=1,ve=oe-2;ne<=ve;ne++){const be=L+C*0,fe=L+C*ne,me=L+C*(ne+1);z(be),z(fe),z(me)}L+=C*oe}}else for(let L=0,ee=f.length;L<ee;L+=C)z(L)}function Ft(n){return v(ae.geometries[n],mt)}function hn(n){const t={name:n.getAttribute("name")||"",joints:{},links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":mn(s,t);break}}ae.kinematicsModels[n.getAttribute("id")]=t}function pn(n){return n.build!==void 0?n.build:n}function fn(n){return v(ae.kinematicsModels[n],pn)}function mn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"joint":t.joints[s.getAttribute("sid")]=gn(s);break;case"link":t.links.push(jt(s));break}}}function gn(n){let t;for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"prismatic":case"revolute":t=bn(s);break}}return t}function bn(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",axis:new r.Vector3,limits:{min:0,max:0},type:n.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=d(s.textContent);t.axis.fromArray(a);break;case"limits":const f=s.getElementsByTagName("max")[0],C=s.getElementsByTagName("min")[0];t.limits.max=parseFloat(f.textContent),t.limits.min=parseFloat(C.textContent);break}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function jt(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",attachments:[],transforms:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"attachment_full":t.attachments.push(yn(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function yn(n){const t={joint:n.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"link":t.links.push(jt(s));break;case"matrix":case"translate":case"rotate":t.transforms.push(Ot(s));break}}return t}function Ot(n){const t={type:n.nodeName},i=d(n.textContent);switch(t.type){case"matrix":t.obj=new r.Matrix4,t.obj.fromArray(i).transpose();break;case"translate":t.obj=new r.Vector3,t.obj.fromArray(i);break;case"rotate":t.obj=new r.Vector3,t.obj.fromArray(i),t.angle=r.MathUtils.degToRad(i[3]);break}return t}function wn(n){const t={name:n.getAttribute("name")||"",rigidBodies:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"rigid_body":t.rigidBodies[s.getAttribute("name")]={},_n(s,t.rigidBodies[s.getAttribute("name")]);break}}ae.physicsModels[n.getAttribute("id")]=t}function _n(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"technique_common":kn(s,t);break}}}function kn(n,t){for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"inertia":t.inertia=d(s.textContent);break;case"mass":t.mass=d(s.textContent)[0];break}}}function Cn(n){const t={bindJointAxis:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"bind_joint_axis":t.bindJointAxis.push(vn(s));break}}ae.kinematicsScenes[p(n.getAttribute("url"))]=t}function vn(n){const t={target:n.getAttribute("target").split("/").pop()};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType===1)switch(s.nodeName){case"axis":const a=s.getElementsByTagName("param")[0];t.axis=a.textContent;const f=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=f.substring(0,f.length-1);break}}return t}function xn(n){return n.build!==void 0?n.build:n}function Nn(n){return v(ae.kinematicsScenes[n],xn)}function En(){const n=Object.keys(ae.kinematicsModels)[0],t=Object.keys(ae.kinematicsScenes)[0],i=Object.keys(ae.visualScenes)[0];if(n===void 0||t===void 0)return;const s=fn(n),a=Nn(t),f=Ht(i),C=a.bindJointAxis,J={};for(let te=0,L=C.length;te<L;te++){const ee=C[te],Q=Ee.querySelector('[sid="'+ee.target+'"]');if(Q){const oe=Q.parentElement;z(ee.jointIndex,oe)}}function z(te,L){const ee=L.getAttribute("name"),Q=s.joints[te];f.traverse(function(oe){oe.name===ee&&(J[te]={object:oe,transforms:Tn(L),joint:Q,position:Q.zeroPosition})})}const Y=new r.Matrix4;Wt={joints:s&&s.joints,getJointValue:function(te){const L=J[te];if(L)return L.position;console.warn("THREE.ColladaLoader: Joint "+te+" doesn't exist.")},setJointValue:function(te,L){const ee=J[te];if(ee){const Q=ee.joint;if(L>Q.limits.max||L<Q.limits.min)console.warn("THREE.ColladaLoader: Joint "+te+" value "+L+" outside of limits (min: "+Q.limits.min+", max: "+Q.limits.max+").");else if(Q.static)console.warn("THREE.ColladaLoader: Joint "+te+" is static.");else{const oe=ee.object,ne=Q.axis,ve=ee.transforms;De.identity();for(let be=0;be<ve.length;be++){const fe=ve[be];if(fe.sid&&fe.sid.indexOf(te)!==-1)switch(Q.type){case"revolute":De.multiply(Y.makeRotationAxis(ne,r.MathUtils.degToRad(L)));break;case"prismatic":De.multiply(Y.makeTranslation(ne.x*L,ne.y*L,ne.z*L));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Q.type);break}else switch(fe.type){case"matrix":De.multiply(fe.obj);break;case"translate":De.multiply(Y.makeTranslation(fe.obj.x,fe.obj.y,fe.obj.z));break;case"scale":De.scale(fe.obj);break;case"rotate":De.multiply(Y.makeRotationAxis(fe.obj,fe.angle));break}}oe.matrix.copy(De),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),J[te].position=L}}else console.log("THREE.ColladaLoader: "+te+" does not exist.")}}}function Tn(n){const t=[],i=Ee.querySelector('[id="'+n.id+'"]');for(let s=0;s<i.childNodes.length;s++){const a=i.childNodes[s];if(a.nodeType!==1)continue;let f,C;switch(a.nodeName){case"matrix":f=d(a.textContent);const J=new r.Matrix4().fromArray(f).transpose();t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:J});break;case"translate":case"scale":f=d(a.textContent),C=new r.Vector3().fromArray(f),t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:C});break;case"rotate":f=d(a.textContent),C=new r.Vector3().fromArray(f);const z=r.MathUtils.degToRad(f[3]);t.push({sid:a.getAttribute("sid"),type:a.nodeName,obj:C,angle:z});break}}return t}function An(n){const t=n.getElementsByTagName("node");for(let i=0;i<t.length;i++){const s=t[i];s.hasAttribute("id")===!1&&s.setAttribute("id",w())}}const De=new r.Matrix4,gt=new r.Vector3;function Et(n){const t={name:n.getAttribute("name")||"",type:n.getAttribute("type"),id:n.getAttribute("id"),sid:n.getAttribute("sid"),matrix:new r.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];if(s.nodeType!==1)continue;let a;switch(s.nodeName){case"node":t.nodes.push(s.getAttribute("id")),Et(s);break;case"instance_camera":t.instanceCameras.push(p(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(It(s));break;case"instance_light":t.instanceLights.push(p(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(It(s));break;case"instance_node":t.instanceNodes.push(p(s.getAttribute("url")));break;case"matrix":a=d(s.textContent),t.matrix.multiply(De.fromArray(a).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":a=d(s.textContent),gt.fromArray(a),t.matrix.multiply(De.makeTranslation(gt.x,gt.y,gt.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":a=d(s.textContent);const f=r.MathUtils.degToRad(a[3]);t.matrix.multiply(De.makeRotationAxis(gt.fromArray(a),f)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":a=d(s.textContent),t.matrix.scale(gt.fromArray(a)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Gt(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):ae.nodes[t.id]=t,t}function It(n){const t={id:p(n.getAttribute("url")),materials:{},skeletons:[]};for(let i=0;i<n.childNodes.length;i++){const s=n.childNodes[i];switch(s.nodeName){case"bind_material":const a=s.getElementsByTagName("instance_material");for(let f=0;f<a.length;f++){const C=a[f],J=C.getAttribute("symbol"),z=C.getAttribute("target");t.materials[J]=p(z)}break;case"skeleton":t.skeletons.push(p(s.textContent));break}}return t}function Mn(n,t){const i=[],s=[];let a,f,C;for(a=0;a<n.length;a++){const Y=n[a];let te;if(Gt(Y))te=bt(Y),Ut(te,t,i);else if(Bn(Y)){const ee=ae.visualScenes[Y].children;for(let Q=0;Q<ee.length;Q++){const oe=ee[Q];if(oe.type==="JOINT"){const ne=bt(oe.id);Ut(ne,t,i)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Y)}for(a=0;a<t.length;a++)for(f=0;f<i.length;f++)if(C=i[f],C.bone.name===t[a].name){s[a]=C,C.processed=!0;break}for(a=0;a<i.length;a++)C=i[a],C.processed===!1&&(s.push(C),C.processed=!0);const J=[],z=[];for(a=0;a<s.length;a++)C=s[a],J.push(C.bone),z.push(C.boneInverse);return new r.Skeleton(J,z)}function Ut(n,t,i){n.traverse(function(s){if(s.isBone===!0){let a;for(let f=0;f<t.length;f++){const C=t[f];if(C.name===s.name){a=C.boneInverse;break}}a===void 0&&(a=new r.Matrix4),i.push({bone:s,boneInverse:a,processed:!1})}})}function Sn(n){const t=[],i=n.matrix,s=n.nodes,a=n.type,f=n.instanceCameras,C=n.instanceControllers,J=n.instanceLights,z=n.instanceGeometries,Y=n.instanceNodes;for(let L=0,ee=s.length;L<ee;L++)t.push(bt(s[L]));for(let L=0,ee=f.length;L<ee;L++){const Q=ke(f[L]);Q!==null&&t.push(Q.clone())}for(let L=0,ee=C.length;L<ee;L++){const Q=C[L],oe=Z(Q.id),ne=Ft(oe.id),ve=zt(ne,Q.materials),be=Q.skeletons,fe=oe.skin.joints,me=Mn(be,fe);for(let Ye=0,Ve=ve.length;Ye<Ve;Ye++){const yt=ve[Ye];yt.isSkinnedMesh&&(yt.bind(me,oe.skin.bindMatrix),yt.normalizeSkinWeights()),t.push(yt)}}for(let L=0,ee=J.length;L<ee;L++){const Q=qe(J[L]);Q!==null&&t.push(Q.clone())}for(let L=0,ee=z.length;L<ee;L++){const Q=z[L],oe=Ft(Q.id),ne=zt(oe,Q.materials);for(let ve=0,be=ne.length;ve<be;ve++)t.push(ne[ve])}for(let L=0,ee=Y.length;L<ee;L++)t.push(bt(Y[L]).clone());let te;if(s.length===0&&t.length===1)te=t[0];else{te=a==="JOINT"?new r.Bone:new r.Group;for(let L=0;L<t.length;L++)te.add(t[L])}return te.name=a==="JOINT"?n.sid:n.name,te.matrix.copy(i),te.matrix.decompose(te.position,te.quaternion,te.scale),te}const Pn=new r.MeshBasicMaterial({name:r.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function Ln(n,t){const i=[];for(let s=0,a=n.length;s<a;s++){const f=t[n[s]];f===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",n[s]),i.push(Pn)):i.push(st(f))}return i}function zt(n,t){const i=[];for(const s in n){const a=n[s],f=Ln(a.materialKeys,t);if(f.length===0&&(s==="lines"||s==="linestrips"?f.push(new r.LineBasicMaterial):f.push(new r.MeshPhongMaterial)),s==="lines"||s==="linestrips")for(let Y=0,te=f.length;Y<te;Y++){const L=f[Y];if(L.isMeshPhongMaterial===!0||L.isMeshLambertMaterial===!0){const ee=new r.LineBasicMaterial;ee.color.copy(L.color),ee.opacity=L.opacity,ee.transparent=L.transparent,f[Y]=ee}}const C=a.data.attributes.skinIndex!==void 0,J=f.length===1?f[0]:f;let z;switch(s){case"lines":z=new r.LineSegments(a.data,J);break;case"linestrips":z=new r.Line(a.data,J);break;case"triangles":case"polylist":C?z=new r.SkinnedMesh(a.data,J):z=new r.Mesh(a.data,J);break}i.push(z)}return i}function Gt(n){return ae.nodes[n]!==void 0}function bt(n){return v(ae.nodes[n],Sn)}function Vn(n){const t={name:n.getAttribute("name"),children:[]};An(n);const i=c(n,"node");for(let s=0;s<i.length;s++)t.children.push(Et(i[s]));ae.visualScenes[n.getAttribute("id")]=t}function qt(n){const t=new r.Group;t.name=n.name;const i=n.children;for(let s=0;s<i.length;s++){const a=i[s];t.add(bt(a.id))}return t}function Bn(n){return ae.visualScenes[n]!==void 0}function Ht(n){return v(ae.visualScenes[n],qt)}function Rn(n){const t=c(n,"instance_visual_scene")[0];return Ht(p(t.getAttribute("url")))}function Dn(){const n=ae.clips;if(y(n)===!0){if(y(ae.animations)===!1){const t=[];for(const i in ae.animations){const s=E(i);for(let a=0,f=s.length;a<f;a++)t.push(s[a])}kt.push(new r.AnimationClip("default",-1,t))}}else for(const t in n)kt.push($(t))}function Fn(n){let t="";const i=[n];for(;i.length;){const s=i.shift();s.nodeType===Node.TEXT_NODE?t+=s.textContent:(t+=`
7
+ `,i.push(...s.childNodes))}return t.trim()}if(o.length===0)return{scene:new r.Scene};const $t=new DOMParser().parseFromString(o,"application/xml"),Ee=c($t,"COLLADA")[0],Tt=$t.getElementsByTagName("parsererror")[0];if(Tt!==void 0){const n=c(Tt,"div")[0];let t;return n?t=n.textContent:t=Fn(Tt),console.error(`THREE.ColladaLoader: Failed to parse collada file.
8
+ `,t),null}const jn=Ee.getAttribute("version");console.debug("THREE.ColladaLoader: File version",jn);const Yt=V(c(Ee,"asset")[0]),Kt=new r.TextureLoader(this.manager);Kt.setPath(this.resourcePath||l).setCrossOrigin(this.crossOrigin);let At;on&&(At=new on(this.manager),At.setPath(this.resourcePath||l));const _t=new r.Color,kt=[];let Wt={},On=0;const ae={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};T(Ee,"library_animations","animation",m),T(Ee,"library_animation_clips","animation_clip",h),T(Ee,"library_controllers","controller",H),T(Ee,"library_images","image",G),T(Ee,"library_effects","effect",pe),T(Ee,"library_materials","material",ht),T(Ee,"library_cameras","camera",it),T(Ee,"library_lights","light",je),T(Ee,"library_geometries","geometry",He),T(Ee,"library_nodes","node",Et),T(Ee,"library_visual_scenes","visual_scene",Vn),T(Ee,"library_kinematics_models","kinematics_model",hn),T(Ee,"library_physics_models","physics_model",wn),T(Ee,"scene","instance_kinematics_scene",Cn),R(ae.animations,O),R(ae.clips,I),R(ae.controllers,W),R(ae.images,X),R(ae.effects,ue),R(ae.materials,Je),R(ae.cameras,ge),R(ae.lights,Re),R(ae.geometries,mt),R(ae.visualScenes,qt),Dn(),En();const Ct=Rn(c(Ee,"scene")[0]);return Ct.animations=kt,Yt.upAxis==="Z_UP"&&(console.warn("THREE.ColladaLoader: You are loading an asset with a Z-UP coordinate system. The loader just rotates the asset to transform it into Y-UP. The vertex data are not converted, see #24289."),Ct.rotation.set(-Math.PI/2,0,0)),Ct.scale.multiplyScalar(Yt.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),kt},kinematics:Wt,library:ae,scene:Ct}}}const Vt=new r.Quaternion,sn=new r.Euler;function wt(M){return M?M.trim().split(/\s+/g).map(o=>parseFloat(o)):[0,0,0]}function an(M,o,l=!1){l||M.rotation.set(0,0,0),sn.set(o[0],o[1],o[2],"ZYX"),Vt.setFromEuler(sn),Vt.multiply(M.quaternion),M.quaternion.copy(Vt)}class fo{constructor(o){this.manager=o||r.DefaultLoadingManager,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(o){return new Promise((l,c)=>{this.load(o,l,null,c)})}load(o,l,c,u){const d=this.manager,_=r.LoaderUtils.extractUrlBase(o),p=this.manager.resolveURL(o);d.itemStart(p),fetch(p,this.fetchOptions).then(w=>{if(w.ok)return c&&c(null),w.text();throw new Error(`URDFLoader: Failed to load url '${p}' with error code ${w.status} : ${w.statusText}.`)}).then(w=>{const y=this.parse(w,this.workingPath||_);l(y),d.itemEnd(p)}).catch(w=>{u?u(w):console.error("URDFLoader: Error loading file.",w),d.itemError(p),d.itemEnd(p)})}parse(o,l=this.workingPath){const c=this.packages,u=this.loadMeshCb,d=this.parseVisual,_=this.parseCollision,p=this.manager,w={},y={},V={};function D(N){if(!/^package:\/\//.test(N))return l?l+N:N;const[O,E]=N.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof c=="string")return c.endsWith(O)?c+"/"+E:c+"/"+O+"/"+E;if(c instanceof Function)return c(O)+"/"+E;if(typeof c=="object")return O in c?c[O]+"/"+E:(console.error(`URDFLoader : ${O} not found in provided package list.`),null)}function B(N){let O;N instanceof Document?O=[...N.children]:N instanceof Element?O=[N]:O=[...new DOMParser().parseFromString(N,"text/xml").children];const E=O.filter(k=>k.nodeName==="robot").pop();return T(E)}function T(N){const O=[...N.children],E=O.filter(F=>F.nodeName.toLowerCase()==="link"),k=O.filter(F=>F.nodeName.toLowerCase()==="joint"),g=O.filter(F=>F.nodeName.toLowerCase()==="material"),j=new r.URDFRobot;j.robotName=N.getAttribute("name"),j.urdfRobotNode=N,g.forEach(F=>{const U=F.getAttribute("name");V[U]=m(F)});const A={},x={};E.forEach(F=>{const U=F.getAttribute("name"),ie=N.querySelector(`child[link="${U}"]`)===null;w[U]=v(F,A,x,ie?j:null)}),k.forEach(F=>{const U=F.getAttribute("name");y[U]=R(F)}),j.joints=y,j.links=w,j.colliders=x,j.visual=A;const q=Object.values(y);return q.forEach(F=>{F instanceof r.URDFMimicJoint&&y[F.mimicJoint].mimicJoints.push(F)}),q.forEach(F=>{const U=new Set,ie=ce=>{if(U.has(ce))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");U.add(ce),ce.mimicJoints.forEach(b=>{ie(b)})};ie(F)}),j.frames={...x,...A,...w,...y},j}function R(N){const O=[...N.children],E=N.getAttribute("type");let k;const g=O.find(U=>U.nodeName.toLowerCase()==="mimic");g?(k=new r.URDFMimicJoint,k.mimicJoint=g.getAttribute("joint"),k.multiplier=parseFloat(g.getAttribute("multiplier")||1),k.offset=parseFloat(g.getAttribute("offset")||0)):k=new r.URDFJoint,k.urdfNode=N,k.name=N.getAttribute("name"),k.urdfName=k.name,k.jointType=E;let j=null,A=null,x=[0,0,0],q=[0,0,0];O.forEach(U=>{const ie=U.nodeName.toLowerCase();ie==="origin"?(x=wt(U.getAttribute("xyz")),q=wt(U.getAttribute("rpy"))):ie==="child"?A=w[U.getAttribute("link")]:ie==="parent"?j=w[U.getAttribute("link")]:ie==="limit"&&(k.limit.lower=parseFloat(U.getAttribute("lower")||k.limit.lower),k.limit.upper=parseFloat(U.getAttribute("upper")||k.limit.upper))}),j.add(k),k.add(A),an(k,q),k.position.set(x[0],x[1],x[2]);const F=O.filter(U=>U.nodeName.toLowerCase()==="axis")[0];if(F){const U=F.getAttribute("xyz").split(/\s+/g).map(ie=>parseFloat(ie));k.axis=new r.Vector3(U[0],U[1],U[2]),k.axis.normalize()}return k}function v(N,O,E,k=null){k===null&&(k=new r.URDFLink);const g=[...N.children];return k.name=N.getAttribute("name"),k.urdfName=k.name,k.urdfNode=N,d&&g.filter(A=>A.nodeName.toLowerCase()==="visual").forEach(A=>{const x=S(A,V);if(k.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,O[q]=x}}),_&&g.filter(A=>A.nodeName.toLowerCase()==="collision").forEach(A=>{const x=S(A);if(k.add(x),A.hasAttribute("name")){const q=A.getAttribute("name");x.name=q,x.urdfName=q,E[q]=x}}),k}function m(N){const O=[...N.children],E=new r.MeshPhongMaterial;return E.name=N.getAttribute("name")||"",O.forEach(k=>{const g=k.nodeName.toLowerCase();if(g==="color"){const j=k.getAttribute("rgba").split(/\s/g).map(A=>parseFloat(A));E.color.setRGB(j[0],j[1],j[2]),E.opacity=j[3],E.transparent=j[3]<1,E.depthWrite=!E.transparent}else if(g==="texture"){const j=k.getAttribute("filename");if(j){const A=new r.TextureLoader(p),x=D(j);E.map=A.load(x),E.map.colorSpace=r.SRGBColorSpace}}}),E}function S(N,O={}){const E=N.nodeName.toLowerCase()==="collision",k=[...N.children];let g=null;const j=k.filter(x=>x.nodeName.toLowerCase()==="material")[0];if(j){const x=j.getAttribute("name");x&&x in O?g=O[x]:g=m(j)}else g=new r.MeshPhongMaterial;const A=E?new r.URDFCollider:new r.URDFVisual;return A.urdfNode=N,k.forEach(x=>{const q=x.nodeName.toLowerCase();if(q==="geometry"){const F=x.children[0].nodeName.toLowerCase();if(F==="mesh"){const U=x.children[0].getAttribute("filename"),ie=D(U);if(ie!==null){const ce=x.children[0].getAttribute("scale");if(ce){const b=wt(ce);A.scale.set(b[0],b[1],b[2])}u(ie,p,(b,h)=>{h?console.error("URDFLoader: Error loading mesh.",h):b&&(b instanceof r.Mesh&&(b.material=g),b.position.set(0,0,0),b.quaternion.identity(),A.add(b))})}}else if(F==="box"){const U=new r.Mesh;U.geometry=new r.BoxGeometry(1,1,1),U.material=g;const ie=wt(x.children[0].getAttribute("size"));U.scale.set(ie[0],ie[1],ie[2]),A.add(U)}else if(F==="sphere"){const U=new r.Mesh;U.geometry=new r.SphereGeometry(1,30,30),U.material=g;const ie=parseFloat(x.children[0].getAttribute("radius"))||0;U.scale.set(ie,ie,ie),A.add(U)}else if(F==="cylinder"){const U=new r.Mesh;U.geometry=new r.CylinderGeometry(1,1,1,30),U.material=g;const ie=parseFloat(x.children[0].getAttribute("radius"))||0,ce=parseFloat(x.children[0].getAttribute("length"))||0;U.scale.set(ie,ce,ie),U.rotation.set(Math.PI/2,0,0),A.add(U)}}else if(q==="origin"){const F=wt(x.getAttribute("xyz")),U=wt(x.getAttribute("rpy"));A.position.set(F[0],F[1],F[2]),A.rotation.set(0,0,0),an(A,U)}}),A}return B(o)}defaultMeshLoader(o,l,c){/\.stl$/i.test(o)?new Nt(l).load(o,d=>{const _=new r.Mesh(d,new r.MeshPhongMaterial);c(_)}):/\.dae$/i.test(o)?new po(l).load(o,d=>c(d.scene)):console.warn(`URDFLoader: Could not load model at ${o}.
9
+ No loader available`)}}function mo(M,o,l,c,u){const d=async B=>{try{const T=await Rt.downloadAvatarApi({url:B});if(T.status!==200)throw new Error(`下载失败: ${T.status}`);return T.data}catch(T){throw console.error("addModelFromUrl失败:",T),T}},_=B=>new Promise((T,R)=>{const v=new FileReader;v.onload=m=>{try{const S=m.target.result,O=new Lt().parse(S);O.preload(),T(O)}catch(S){R(S)}},v.onerror=()=>{R(new Error("MTL文件读取失败"))},v.readAsText(B)}),p=async B=>{const T={materials:{},create:function(R){return this.materials[R]?this.materials[R]:(console.warn(`Material '${R}' not found, using default material`),new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))},getAsArray:function(){const R=[];for(const v in this.materials)R.push(this.materials[v]);return R},preload:function(){for(const R in this.materials)this.materials[R].map&&(this.materials[R].map.needsUpdate=!0)}};for(const R of B){const v=await _(R);Object.assign(T.materials,v.materials)}return T.preload(),T},w=async(B,T=[])=>new Promise((R,v)=>{const m=new FileReader;m.onload=async S=>{try{const N=S.target.result;let O=null;T&&T.length>0&&(T.length===1?O=await _(T[0]):O=await p(T));const E=new Pt;O&&E.setMaterials(O);const k=E.parse(N);O||k.traverse(g=>{g.isMesh&&(g.material=new r.MeshPhongMaterial({color:8947848,side:r.DoubleSide}))}),R(k)}catch(N){v(N)}},m.onerror=()=>{v(new Error("OBJ文件读取失败"))},m.readAsText(B)}),y=async B=>{var T;try{l.value=!0;const{scene:R}=M();if(!R)throw new Error("Scene not initialized");u();const v=[];for(let m=0;m<B.length;m++){const S=B[m];c.value=`正在加载模型 ${m+1}/${B.length}...`;const N=await d(S.objUrl),O=((T=S.objUrl)==null?void 0:T.split("/").pop())||`model_${m}.obj`,E=new File([N],O,{type:N.type});let k=[];if(S.mtlUrls){const j=Array.isArray(S.mtlUrls)?S.mtlUrls:[S.mtlUrls];for(let A=0;A<j.length;A++){const x=j[A],q=await d(x),F=(x==null?void 0:x.split("/").pop())||`material_${m}_${A}.mtl`,U=new File([q],F,{type:q.type});k.push(U)}}const g=await w(E,k);R.add(g),o.value.push(g),v.push(g)}return l.value=!1,v}catch(R){throw console.error("加载模型失败:",R),l.value=!1,R}},V=async(B,T,R=[],v=[])=>{let m;const S=B.toLowerCase();switch(S){case".txt":case".cpt":case".obj":const N=await T.text();if(S===".txt"||S===".cpt"){const ce=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,h=[...N.matchAll(ce)].map(H=>({x:parseFloat(H[1]),y:parseFloat(H[2]),z:parseFloat(H[3])})),I=new r.BufferGeometry,$=h.flatMap(H=>[H.x,H.y,H.z]);if(I.setAttribute("position",new r.Float32BufferAttribute($,3)),S===".txt"){const H=new r.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});m=new r.Points(I,H)}else if(S===".cpt"){const H=new r.LineBasicMaterial({color:"#5B5C99",linewidth:100});m=new r.Line(I,H)}}else if(S===".obj"){const ce=new Pt;if(R&&R.length>0){const b=new Lt;for(const h of R){const I=await h.text(),$=b.parse(I);$.preload(),ce.setMaterials($);break}}m=ce.parse(N),(!R||R.length===0)&&m.traverse(b=>{b.isMesh&&(b.material=new r.MeshPhongMaterial({color:"#B3B3D4"})),b instanceof r.Mesh&&(b.material.side=r.DoubleSide)})}break;case".stl":const O=await T.arrayBuffer(),k=new Nt().parse(O),g=new r.MeshPhongMaterial({color:"#B3B3D4",side:r.DoubleSide});m=new r.Mesh(k,g);break;case".urdf":const j=await T.text(),A=new fo,x=new Map;v.forEach(ce=>{x.set(ce.name,ce.blob)}),A.loadMeshCb=async(ce,b,h,I,$)=>{const H=ce.split("/").pop(),re=x.get(H);if(!re){$(new Error(`找不到文件: ${H}`));return}const P=H.split(".").pop().toLowerCase();switch(P){case"stl":const se=await re.arrayBuffer(),K=new Nt(b).parse(se),Z=new r.Mesh(K,new r.MeshPhongMaterial);h(Z);break;case"obj":const G=await re.text(),X=new Pt(b),he=H.replace(".obj",".mtl"),pe=x.get(he);if(pe){const Se=await pe.text(),Fe=new Lt(b).parse(Se);Fe.preload(),X.setMaterials(Fe)}const le=X.parse(G);h(le);break;default:$(new Error(`不支持的文件格式: ${P}`))}},m=A.parse(j);break;case".nc":const q=["Mach_B_Axis_0.STL","Mach_C_Axis_0.STL","Mach_X_Axis_0.STL","Mach_Y_Axis_0.STL","Mach_Z_Axis_0.STL","Mach_Spindle_0.STL"],F={"Mach_Y_Axis_0.STL":"rgb(128,118,152)","Mach_B_Axis_0.STL":"rgb(204,143,89)","Mach_C_Axis_0.STL":"rgb(145,245,251)","Mach_X_Axis_0.STL":"rgb(125,158,192)","Mach_Z_Axis_0.STL":"rgb(248,228,118)","Mach_Spindle_0.STL":"rgb(145,145,145)"},U=new r.Group,ie=q.map(ce=>new Promise((b,h)=>{new Nt().load(`/model/${ce}`,$=>{const H=new r.MeshPhongMaterial({color:F[ce]||"#B3B3D4",side:r.DoubleSide}),re=new r.Mesh($,H);b(re)},void 0,h)}));try{(await Promise.all(ie)).forEach(b=>U.add(b)),m=U}catch(ce){throw console.error("加载NC文件对应的STL文件失败:",ce),new Error("无法加载.NC文件对应的STL文件")}break;default:throw new Error(`不支持的文件格式: ${B}`)}return m};return{addModelsFromUrls:y,loadModelByDefaultPath:async B=>{console.log(B);try{l.value=!0,c.value="正在加载模型...";const{scene:T}=M();if(!T)throw new Error("Scene not initialized");u(),await new Promise(v=>setTimeout(v,100));const R=[];for(let v=0;v<B.length;v++){const m=B[v],S=await V(m.suffix,m.blob,m.mtlBlobs||[],m.meshFiles||[]);T.add(S),o.value.push(S),R.push(S)}return l.value=!1,c.value="",R}catch(T){throw console.error("加载模型失败:",T),l.value=!1,c.value="",T}}}}const go={class:"obj-viewer-container"},bo={class:"floating-controls"},yo=["disabled"],wo=["disabled","title"],_o={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},ko={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Co=["disabled"],vo=["title"],xo={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},No={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Eo={key:0,class:"clipping-panel"},To={class:"panel-content"},Ao={class:"radio-group"},Mo={class:"radio-label"},So={class:"radio-label"},Po={class:"radio-label"},Lo={class:"radio-label"},Vo={key:1,class:"loading-overlay"},Bo={__name:"threeModel",setup(M,{expose:o}){const l=e.ref(null),c=e.ref(!1),u=e.ref(""),d=e.ref(!1),_=e.ref(!1),{currentModels:p,initialCameraPosition:w,initialTargetPosition:y,initThreeJS:V,handleResize:D,fitCameraToAllModels:B,getThreeJSObjects:T,clearAllModels:R,cleanup:v}=oo(l),{isAnimating:m,toggleAnimation:S,stopAnimation:N}=so(T,p),{isClipping:O,activeClippingAxis:E,toggleClipping:k,updateClippingPlanes:g}=io(T,p),{addModelsFromUrls:j,loadModelByDefaultPath:A}=mo(T,p,c,u,R),x=()=>{if(_.value||p.value.length===0)return;_.value=!0,m.value&&N();const{camera:b,controls:h}=T();if(!b||!h)return;h.enabled=!0;const I=W=>W<.5?4*W*W*W:1-Math.pow(-2*W+2,3)/2,$=b.position.clone(),H=h.target.clone(),re=1500,P=Date.now(),se=()=>{const W=Date.now()-P,K=Math.min(W/re,1),Z=I(K);b.position.lerpVectors($,w.value,Z),h.target.lerpVectors(H,y.value,Z),K<1?requestAnimationFrame(se):_.value=!1};se()},q=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{d.value=!1,e.nextTick(()=>{D()})}).catch(b=>{console.error("无法退出全屏:",b)}):l.value.requestFullscreen().then(()=>{d.value=!0,e.nextTick(()=>{D()})}).catch(b=>{console.error("无法进入全屏:",b)})},F=()=>{d.value=!!document.fullscreenElement,d.value||e.nextTick(()=>{D()})},U=async(b,h)=>{try{m.value&&N(),O.value&&k();const I=await h(b);return B(),I}catch(I){throw console.error("加载模型失败:",I),I}},ie=async b=>U(b,j),ce=async b=>U(b,A);return e.onMounted(async()=>{await e.nextTick(),V(),window.addEventListener("resize",D),document.addEventListener("fullscreenchange",F)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",D),document.removeEventListener("fullscreenchange",F),m.value&&N(),v()}),o({addModelsFromUrls:ie,loadModelByDefaultPath:ce}),(b,h)=>(e.openBlock(),e.createElementBlock("div",go,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",bo,[e.createElementVNode("button",{onClick:x,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:c.value||e.unref(p).length===0||_.value,title:"重置"},h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.createElementVNode("polyline",{points:"9,22 9,12 15,12 15,22"})],-1)]),8,yo),e.createElementVNode("button",{onClick:h[0]||(h[0]=(...I)=>e.unref(S)&&e.unref(S)(...I)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(m)}]),disabled:c.value||e.unref(p).length===0,title:e.unref(m)?"停止动画":"动画视图"},[e.unref(m)?(e.openBlock(),e.createElementBlock("svg",ko,h[12]||(h[12]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("rect",{x:"9.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"12.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",_o,h[11]||(h[11]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("polygon",{points:"10,8 16,12 10,16",fill:"currentColor"},null,-1)])))],10,wo),e.createElementVNode("button",{onClick:h[1]||(h[1]=(...I)=>e.unref(k)&&e.unref(k)(...I)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(O)}]),disabled:c.value||e.unref(p).length===0,title:"剖面视图"},h[13]||(h[13]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18"}),e.createElementVNode("line",{x1:"-14",y1:"12",x2:"30",y2:"12","stroke-dasharray":"4,2"})],-1)]),10,Co),e.createElementVNode("button",{onClick:q,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:d.value?"退出全屏":"全屏"},[d.value?(e.openBlock(),e.createElementBlock("svg",No,h[15]||(h[15]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",xo,h[14]||(h[14]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))],8,vo)]),e.unref(O)?(e.openBlock(),e.createElementBlock("div",Eo,[e.createElementVNode("div",To,[e.createElementVNode("div",Ao,[e.createElementVNode("label",Mo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[2]||(h[2]=I=>e.isRef(E)?E.value=I:null),onChange:h[3]||(h[3]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[16]||(h[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",So,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":h[4]||(h[4]=I=>e.isRef(E)?E.value=I:null),onChange:h[5]||(h[5]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[17]||(h[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Po,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":h[6]||(h[6]=I=>e.isRef(E)?E.value=I:null),onChange:h[7]||(h[7]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[18]||(h[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":h[8]||(h[8]=I=>e.isRef(E)?E.value=I:null),onChange:h[9]||(h[9]=(...I)=>e.unref(g)&&e.unref(g)(...I))},null,544),[[e.vModelRadio,e.unref(E)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",Vo,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(u.value),1)])):e.createCommentVNode("",!0)]))}},Ro=dt._export_sfc(Bo,[["__scopeId","data-v-4d1111d9"]]),Do={class:"bread-content"},Fo=["onClick"],jo={key:0,class:"split-title"},Oo={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(M,{emit:o}){const l=M,c=e.ref([]),u=o;e.onMounted(()=>{c.value=l==null?void 0:l.breadArray}),e.watch(()=>l==null?void 0:l.breadArray,()=>{c.value=l==null?void 0:l.breadArray},{deep:!0,immediate:!0});const d=_=>{u("click",_)};return(_,p)=>(e.openBlock(),e.createElementBlock("div",Do,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(w,y)=>{var V;return e.openBlock(),e.createElementBlock("div",{key:y,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:D=>d(w),style:e.normalizeStyle({opacity:((V=c.value)==null?void 0:V.length)-1===y?"0.7":"1"})},e.toDisplayString(w.value),13,Fo),y!==c.value.length-1&&Array.isArray(c.value)?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},dn=dt._export_sfc(Oo,[["__scopeId","data-v-ded7e2bd"]]),Io={class:"item-menu-content"},Uo={class:"item-left-content"},zo={key:0,class:"page-icon"},Go={class:"avatar"},qo={style:{display:"flex"}},Ho={class:"select-icon"},$o={key:0,class:"model-operate",style:{width:"0px"}},Yo={class:"model-select"},Ko={class:"model-fill"},Wo={key:1,class:"show-main-content"},Zo={class:"show-content"},Jo={class:"item-view-group"},Xo={class:"show-item-content"},Qo={class:"item-view-group"},es={key:2,class:"show-main-content"},ts={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(M,{emit:o}){const l=rn.useLoginState(),{loginUserInfo:c,cryptoInfo:u}=ye.storeToRefs(l);e.onMounted(()=>{ln.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const d=r.useModelComp(Ie.pinia);r.useFormToTableComp(Ie.pinia),e.ref(!0);const _=ye.useMenuState();e.ref(!0);const{itemData:p,isEdit:w,isRefreshCurStructure:y,curStructureCompIds:V}=ye.storeToRefs(d),D=r.useUnit(Ie.pinia),{activeMenuPath:B,menus:T,importLoading:R}=ye.storeToRefs(_),{selectIndex:v,selectTitle:m}=ye.storeToRefs(D);return e.ref([]),e.ref(!1),(S,N)=>{const O=e.resolveComponent("el-aside"),E=e.resolveComponent("el-button"),k=e.resolveComponent("el-avatar"),g=e.resolveComponent("el-header"),j=e.resolveComponent("router-view"),A=e.resolveComponent("el-main"),x=e.resolveComponent("el-container"),q=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(x,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(w)==="view"?(e.openBlock(),e.createBlock(O,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>{var F;return[e.createElementVNode("div",Io,[e.createElementVNode("div",Uo,[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",zo,[e.createVNode(E,{text:"",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>N[2]||(N[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(E,{text:"",onClick:N[0]||(N[0]=U=>{var ie,ce;return e.unref(de.clickSavePage)((ce=(ie=e.unref(m))==null?void 0:ie.map(b=>b.value))==null?void 0:ce.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[N[3]||(N[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(dn,{key:e.unref(m),breadArray:e.unref(m),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Go,[e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:N[1]||(N[1]=(...U)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...U))},[e.createElementVNode("div",qo,[e.createVNode(et.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),N[4]||(N[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Ho,[e.renderSlot(S.$slots,"default",{},void 0,!0)]),e.createVNode(k,{size:35,src:(F=e.unref(c))==null?void 0:F.avatarUrl},{default:e.withCtx(()=>{var U;return[e.createTextVNode(e.toDisplayString(((U=e.unref(c))==null?void 0:U.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(A,null,{default:e.withCtx(()=>{var F,U,ie,ce;return[e.unref(w)==="edit"?(e.openBlock(),e.createElementBlock("div",$o,[e.createElementVNode("div",Yo,[e.createVNode(Ke.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:S.innerWidth},[e.createVNode(Ke.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(Ke.modelFill)])])):S.$route.path==="/"&&((F=e.unref(de.showItems))==null?void 0:F.length)>0&&e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Zo,[(U=e.unref(ct.cloneDeep)(e.unref(de.showItems)))!=null&&U.find(b=>b.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:S.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ie=e.unref(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:ie.filter(b=>b.comp==="FormTop"),(b,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Jo,e.toDisplayString(b.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(b.comp)),{itemData:b==null?void 0:b.compData,childItemData:b==null?void 0:b.itemChildData,key:(b==null?void 0:b.id)??h,onChange:e.unref(de.onChange),index:(b==null?void 0:b.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",Xo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ce=e.unref(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:ce.filter(b=>b.comp!=="FormTop"),(b,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",Qo,e.toDisplayString(b.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(b.comp)),{itemData:b==null?void 0:b.compData,childItemData:b==null?void 0:b.itemChildData,key:(b==null?void 0:b.id)??h,onChange:e.unref(de.onChange),index:(b==null?void 0:b.id)??h,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",es,[e.createVNode(j)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[q,e.unref(R)]])}}},ns=dt._export_sfc(ts,[["__scopeId","data-v-d2611062"]]);function os(M,o,l,c,u,d){const _=e.resolveComponent("svg-icon"),p=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(p,{mode:M.mode,menuList:M.renderMenuList,onClickMenu:M.clickMenu,onOpenMenu:M.openMenu,onCloseMenu:M.closeMenu},{title:e.withCtx(({menu:w})=>[e.createVNode(_,{name:w.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(w.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ss=dt._export_sfc(de._sfc_main,[["render",os],["__scopeId","data-v-e003bdbb"]]),Me=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources"},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],is={class:"structure-buttons"},as={class:"structure-paths"},rs={class:"client-header-user"},ls={class:"select-icon"},cs={class:"model-select"},ds={class:"model-show"},us={class:"model-fill"},hs={class:"client-header-logo"},ps={class:"client-header-menu"},fs={class:"client-header-user"},ms={style:{display:"flex"}},gs={class:"select-icon"},bs={class:"client-main-content"},ys={key:0,class:"item-view-group"},ws={key:0,class:"calculator"},_s={class:"router-aside"},ks=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(M){const o=r.useUnit(Ie.pinia),l=e.ref(0),c=e.ref(!1),{selectTitle:u}=ye.storeToRefs(o),d=e.ref(!1),_=r.useTableComp(Ie.pinia),{tableShowThree:p}=ye.storeToRefs(_),w=rn.useLoginState(),{loginUserInfo:y}=ye.storeToRefs(w),V=r.useModelComp(Ie.pinia),{isEdit:D}=ye.storeToRefs(V),B=ye.useMenuState(Ie.pinia),T=Un.useFormComp(Ie.pinia),{objUrl:R,blobUrls:v}=ye.storeToRefs(T),m=e.ref(null),S=e.ref(!0),{importLoading:N,activeMenuPath:O,platName:E}=ye.storeToRefs(B),k=e.ref(!1);e.watch(()=>O.value,async b=>{b&&(k.value=!0)},{immediate:!0});const g=async b=>{var $,H,re,P,se,W,K;const h=($=b==null?void 0:b.split("/"))==null?void 0:$[0],I=await ye.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:h}});return((H=I==null?void 0:I.data)==null?void 0:H.type)==="success"?((K=(W=(se=(P=(re=I==null?void 0:I.data)==null?void 0:re.result)==null?void 0:P[0])==null?void 0:se.value)==null?void 0:W.tableData)==null?void 0:K.隐藏三维显示)!==!0:!0};e.watch(()=>de.showItems.value,()=>{var b,h,I;((b=de.showItems.value)==null?void 0:b.length)===2&&((h=de.showItems.value)!=null&&h.find($=>($==null?void 0:$.name)==="输入"))&&((I=de.showItems.value)!=null&&I.find($=>($==null?void 0:$.name)==="输出"))?d.value=!0:d.value=!1},{deep:!0,immediate:!0}),e.watch(()=>O.value,async()=>{O.value&&(S.value=await g(O.value))},{deep:!0,immediate:!0}),e.watch(()=>[R.value,m.value],()=>{var b;((b=R.value)==null?void 0:b.length)>0&&m.value&&m.value.addModelsFromUrls(R.value)},{immediate:!0,deep:!0}),e.watch(()=>v==null?void 0:v.value,async()=>{var b,h,I,$;if(v!=null&&v.value&&((b=v==null?void 0:v.value)==null?void 0:b.length)>0&&!((h=de.showItems.value)!=null&&h.find(H=>(H==null?void 0:H.name)==="输入")&&((I=de.showItems.value)!=null&&I.find(H=>(H==null?void 0:H.name)==="输出")))){let H=[];const re=await(($=ct.cloneDeep(v==null?void 0:v.value))==null?void 0:$.map(async P=>{var Z,G,X,he,pe,le,Se,Le,Fe,tt,nt,We,Ze,ot,Ne;let se,W,K=(Z=P==null?void 0:P.blob)==null?void 0:Z.split(",");if((K==null?void 0:K.length)>1){let Ue=await(K==null?void 0:K.map(async xe=>{var ue,ut,ht,Ce,Je,st,it;console.log(232,xe),se=await ye.axios.get((ue=xe.split("undefined,"))==null?void 0:ue[1],{responseType:"blob",headers:{"Content-Type":"application/json"}}),console.log(2321,se);let Pe=[];if(((ut=P==null?void 0:P.mtlBlobs)==null?void 0:ut.length)>0){let pt=await((ht=P==null?void 0:P.mtlBlobs)==null?void 0:ht.map(async ft=>{let at=await ye.axios.get(ft,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Pe.push(new Blob([at.data],{type:"application/octet-stream;charset=UTF-8"})),at}));await Promise.all(pt)}return((Je=xe==null?void 0:xe.split("."))==null?void 0:Je[((Ce=xe==null?void 0:xe.split("."))==null?void 0:Ce.length)-1])!=="undefined"&&H.push({suffix:"."+((it=xe==null?void 0:xe.split("."))==null?void 0:it[((st=xe==null?void 0:xe.split("."))==null?void 0:st.length)-1]),blob:new Blob([se.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Pe}),se}));await Promise.all(Ue)}else if(!((G=P==null?void 0:P.blob)!=null&&G.includes("https://"))&&!((X=P==null?void 0:P.blob)!=null&&X.includes("http://"))){se=await Rt.downloadAvatarApi({url:P==null?void 0:P.blob});let Ue=[];if(((he=P==null?void 0:P.mtlBlobs)==null?void 0:he.length)>0){let xe=await((pe=P==null?void 0:P.mtlBlobs)==null?void 0:pe.map(async Pe=>{let ue=await Rt.downloadAvatarApi({url:Pe});return Ue.push(new Blob([ue.data],{type:"application/octet-stream;charset=UTF-8"})),ue}));await Promise.all(xe)}W={suffix:"."+((Fe=(le=P==null?void 0:P.blob)==null?void 0:le.split("."))==null?void 0:Fe[((Le=(Se=P==null?void 0:P.blob)==null?void 0:Se.split("."))==null?void 0:Le.length)-1]),blob:new Blob([se.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Ue}}else{se=await ye.axios.get(P==null?void 0:P.blob,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Ue=[];if(((tt=P==null?void 0:P.mtlBlobs)==null?void 0:tt.length)>0){let xe=await((nt=P==null?void 0:P.mtlBlobs)==null?void 0:nt.map(async Pe=>{let ue=await ye.axios.get(Pe,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Ue.push(new Blob([ue.data],{type:"application/octet-stream;charset=UTF-8"})),ue}));await Promise.all(xe)}W={suffix:"."+((Ne=(We=P==null?void 0:P.blob)==null?void 0:We.split("."))==null?void 0:Ne[((ot=(Ze=P==null?void 0:P.blob)==null?void 0:Ze.split("."))==null?void 0:ot.length)-1]),blob:new Blob([se.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Ue}}console.log(2321,W),W&&H.push(W)}));await Promise.all(re),m.value.loadModelByDefaultPath(H)}},{immediate:!0,deep:!0}),e.watch(()=>p.value,async()=>{var h,I,$,H;if(p.value!==""&&p.value){let re=(h=O.value)==null?void 0:h.split("/"),P=re[(re==null?void 0:re.length)-2];const W=(((I=Me==null?void 0:Me.find(X=>(X==null?void 0:X.key)===P))==null?void 0:I.download)??"")+"/"+p.value,K=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Z=await ye.axios.post(W,null,{responseType:"blob",headers:{Authorization:K,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var b=new Blob([Z.data],{type:"application/octet-stream;charset=UTF-8"});const G=[{suffix:"."+((H=($=p.value)==null?void 0:$.split("."))==null?void 0:H[1]),blob:b,mtlBlobs:[]}];m.value.loadModelByDefaultPath(G)}},{deep:!0,immediate:!0});const j=async()=>{var se,W,K,Z,G,X,he,pe,le,Se,Le,Fe,tt,nt,We,Ze,ot;c.value=!0;let b=(se=O.value)==null?void 0:se.split("/"),h=b[(b==null?void 0:b.length)-2];const I=((W=Me==null?void 0:Me.find(Ne=>(Ne==null?void 0:Ne.key)===h))==null?void 0:W.value)??"";let $="";const H=await ye.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((K=H==null?void 0:H.data)==null?void 0:K.code)===200&&($=`Bearer ${(G=(Z=H.data)==null?void 0:Z.result)==null?void 0:G.accessToken}`,sessionStorage.setItem("magicToken",$));const re=$===""?"123456":$,P=await ye.axios.post(I,null,{headers:{Authorization:re,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((X=P==null?void 0:P.data)==null?void 0:X.type)==="success"&&r.IsJson((pe=(he=P==null?void 0:P.data)==null?void 0:he.result)==null?void 0:pe.result)){const Ne=(tt=(Fe=(Le=JSON.parse((Se=(le=P==null?void 0:P.data)==null?void 0:le.result)==null?void 0:Se.result))==null?void 0:Le.lines_file_paths)==null?void 0:Fe[0])==null?void 0:tt.split("\\"),xe=(((nt=Me==null?void 0:Me.find(ue=>(ue==null?void 0:ue.key)===h))==null?void 0:nt.resources)??"")+"/"+(((Ne==null?void 0:Ne[(Ne==null?void 0:Ne.length)-2])==="inputResources"?"outputResources":Ne==null?void 0:Ne[(Ne==null?void 0:Ne.length)-2])??"outputResources"),Pe=await ye.axios.post(xe,null,{headers:{Authorization:re,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=Pe==null?void 0:Pe.data)==null?void 0:We.type)==="success"){const ue=(Ze=Pe==null?void 0:Pe.data)==null?void 0:Ze.result,ut=de.showItems.value,ht=await((ot=ct.cloneDeep(ut))==null?void 0:ot.map(async Ce=>{var Je,st,it,pt,ft,at;if((Ce==null?void 0:Ce.name)==="输出"){if((Ce==null?void 0:Ce.comp)==="Table")Ce.compData=(Je=Ce==null?void 0:Ce.compData)==null?void 0:Je.map(ge=>{var ke,je;return(ge==null?void 0:ge.key)==="tableContents"&&(ge.contents=(je=(ke=ge==null?void 0:ge.contents)==null?void 0:ke.map(Ae=>(Ae=Ae==null?void 0:Ae.map((_e,Re)=>{var qe,He,Ge;return typeof _e=="string"&&Re>1?((qe=ge==null?void 0:ge.contents)==null?void 0:qe.length)>1?_e=((He=ue==null?void 0:ue[Re-1])!=null&&He.includes("input")?_e:ue==null?void 0:ue[Re-1])??_e:_e=ue==null?void 0:ue[0]:_e=((Ge=ue==null?void 0:ue[Re-1])!=null&&Ge.includes("input")?_e:ue==null?void 0:ue[Re-1])??_e,_e}),Ae)))==null?void 0:je.filter((Ae,_e)=>_e<=(ue==null?void 0:ue.length)-1)),ge});else if((Ce==null?void 0:Ce.comp)==="Form"){let ge="";if(ue==null||ue.forEach(ke=>{ge=ge===""?ge+ke:ge+","+ke}),Ce.compData=(st=Ce==null?void 0:Ce.compData)==null?void 0:st.map(ke=>{var je;return(ke==null?void 0:ke.key)==="formContent"&&(ke.contents=(je=ke.contents)==null?void 0:je.map(Ae=>(Ae.value=ge,Ae))),ke}),(it=ge==null?void 0:ge.split(","))!=null&&it.find(ke=>ke.includes(".obj"))){let ke={};ke.suffix=".obj";const je=[];let Ae=await((ft=(pt=ge==null?void 0:ge.split(","))==null?void 0:pt.filter(_e=>_e.includes(".obj")||_e.includes(".mtl")))==null?void 0:ft.map(async _e=>{var qe,He;if(_e.includes(".obj")){const rt=(((qe=Me==null?void 0:Me.find($e=>($e==null?void 0:$e.key)===h))==null?void 0:qe.download)??"")+"/"+_e,Xe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Qe=await ye.axios.post(rt,null,{responseType:"blob",headers:{Authorization:Xe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Qe.data],{type:"application/octet-stream;charset=UTF-8"});ke.blob=Re}else if(_e.includes(".mtl")){const rt=(((He=Me==null?void 0:Me.find(mt=>(mt==null?void 0:mt.key)===h))==null?void 0:He.download)??"")+"/"+_e,Xe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Qe=await ye.axios.post(rt,null,{responseType:"blob",headers:{Authorization:Xe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Re=new Blob([Qe.data],{type:"application/octet-stream;charset=UTF-8"});je.push(Re)}}));await Promise.all(Ae),ke.mtlBlobs=je,m.value.loadModelByDefaultPath([ke])}else{const ke=[];let je=await((at=ge==null?void 0:ge.split(","))==null?void 0:at.map(async Ae=>{var Xe,Qe;let _e={};_e.suffix="."+((Xe=Ae==null?void 0:Ae.split("."))==null?void 0:Xe[1]);const qe=(((Qe=Me==null?void 0:Me.find($e=>($e==null?void 0:$e.key)===h))==null?void 0:Qe.download)??"")+"/"+Ae,He=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ge=await ye.axios.post(qe,null,{responseType:"blob",headers:{Authorization:He,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var rt=new Blob([Ge.data],{type:"application/octet-stream;charset=UTF-8"});_e.blob=rt,ke.push(_e)}));await Promise.all(je),m.value.loadModelByDefaultPath(ke)}}}return Ce}));de.showItems.value=await Promise.all(ht)}}l.value++,c.value=!1},A=e.ref(""),x=e.ref("open"),q=e.ref("open"),F=e.ref(!1),U=()=>{const b=document.getElementById("menuCollapse");x.value==="open"?(b.style.width="18.75rem",b.style.height="96%",b.style.overflow="auto"):(b.style.width="50px",b.style.height="50px",b.style.overflow="hidden")},ie=()=>{const b=document.getElementById("operateCollapse");q.value==="open"?(b.style.width="25rem",b.style.height="96%",b.style.overflow="auto"):(b.style.width="50px",b.style.height="50px",b.style.overflow="hidden")},ce=()=>{F.value=!F.value;const b=document.getElementById("operateCollapse"),h=document.getElementById("menuCollapse");F.value?(h.style.width="18.75rem",b.style.width="calc(100% - 24rem)"):b.style.width="400px"};return(b,h)=>{const I=e.resolveComponent("el-button"),$=e.resolveComponent("el-avatar"),H=e.resolveComponent("el-header"),re=e.resolveComponent("el-container"),P=e.resolveComponent("el-icon"),se=e.resolveComponent("el-input"),W=e.resolveComponent("el-aside"),K=e.resolveComponent("el-collapse-item"),Z=e.resolveComponent("el-collapse"),G=e.resolveComponent("el-main"),X=e.resolveComponent("router-view"),he=e.resolveDirective("loading");return e.unref(D)==="edit"?(e.openBlock(),e.createBlock(re,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(H,{class:"client-structure-header"},{default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",is,[e.createVNode(I,{class:"select-icon",onClick:e.unref(de.onBack)},{default:e.withCtx(()=>h[6]||(h[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(I,{class:"select-icon",onClick:h[0]||(h[0]=le=>{var Se,Le;return e.unref(de.clickSavePage)((Le=(Se=e.unref(u))==null?void 0:Se.map(Fe=>Fe.value))==null?void 0:Le.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[h[7]||(h[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",as,[(e.openBlock(),e.createBlock(dn,{key:e.unref(u),breadArray:e.unref(u),onClick:e.unref(de.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",rs,[e.createElementVNode("div",ls,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),e.createVNode($,{size:35,src:(pe=e.unref(y))==null?void 0:pe.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(y))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(D)==="edit"?(e.openBlock(),e.createBlock(re,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",cs,[e.createVNode(Ke.modelSelect)]),e.createElementVNode("div",ds,[e.createVNode(Ke.modelShow)]),e.createElementVNode("div",us,[e.createVNode(Ke.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(re,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(H,{class:"client-header"},{default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",hs,[e.createVNode(et.SvgIcon,{name:"logo",style:{width:"clamp(18px, 1.5rem, 24px)",height:"clamp(18px, 1.5rem, 24px)","margin-right":"8px"}}),e.createTextVNode(" "+e.toDisplayString(e.unref(E)===""?"CPMPIP":e.unref(E)),1)]),e.createElementVNode("div",ps,[e.createVNode(ss,{mode:"horizontal"})]),e.createElementVNode("div",fs,[e.createVNode(se,{modelValue:A.value,"onUpdate:modelValue":h[1]||(h[1]=le=>A.value=le),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode(P,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(ln.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(D)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:h[2]||(h[2]=(...le)=>e.unref(de.onSelectFixContent)&&e.unref(de.onSelectFixContent)(...le))},[e.createElementVNode("div",ms,[e.createVNode(et.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),h[8]||(h[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",gs,[e.renderSlot(b.$slots,"default",{},void 0,!0)]),e.createVNode($,{size:35,src:(pe=e.unref(y))==null?void 0:pe.avatarUrl},{default:e.withCtx(()=>{var le;return[e.createTextVNode(e.toDisplayString(((le=e.unref(y))==null?void 0:le.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(re,{class:"client-body"},{default:e.withCtx(()=>[b.$route.path==="/"?(e.openBlock(),e.createBlock(G,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(Z,{modelValue:x.value,"onUpdate:modelValue":h[3]||(h[3]=pe=>x.value=pe),accordion:"",class:"client-aside",id:"menuCollapse",onChange:U},{default:e.withCtx(()=>[e.createVNode(K,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:x.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(W,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",bs,[e.createVNode(Ro,{isShow:k.value,windowConfig:M.windowConfig,ref_key:"threeModelRef",ref:m},null,8,["isShow","windowConfig"])]),e.createVNode(Z,{modelValue:q.value,"onUpdate:modelValue":h[5]||(h[5]=pe=>q.value=pe),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:ie},{default:e.withCtx(()=>[e.createVNode(K,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(et.SvgIcon,{name:q.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var pe;return[e.createElementVNode("div",null,[e.createVNode(et.SvgIcon,{class:"fold-icon",name:F.value?"Right":"Left",onClick:ce},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((pe=e.unref(ct.cloneDeep)(e.unref(de.showItems)))==null?void 0:pe.filter(le=>le.comp!=="FormTop"),(le,Se)=>{var Le;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:Se},[((Le=le==null?void 0:le.comp)==null?void 0:Le.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",ys,e.toDisplayString(le.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(de.getComponents)(le.comp)),{compName:le.name,itemData:le==null?void 0:le.compData,childItemData:le==null?void 0:le.itemChildData,key:(le==null?void 0:le.id)??Se,onChange:e.unref(de.onChange),index:(le==null?void 0:le.id)??Se,onContentChange:e.unref(de.onContentChange),onPageChange:e.unref(de.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),d.value?(e.openBlock(),e.createElementBlock("div",ws,[e.createVNode(zn._sfc_main,{class:"calculator-content",onClickTrigger:h[4]||(h[4]=le=>j()),loading:c.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(G,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",_s,[e.createVNode(W,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(Bt.default,{mode:"vertical"})]),_:1})]),e.createVNode(G,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(X)]),_:1})]),_:1}))]),_:1})]),_:3})),[[he,e.unref(N)]])}}}),Cs=dt._export_sfc(ks,[["__scopeId","data-v-1495f0cd"]]),vs={class:"system-wrap"},xs={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(M){const o=r.useModelComp(Ie.pinia),l=r.useUnit(Ie.pinia),c=ye.useMenuState();e.ref(!1);const u=e.ref(!0),d=M;return e.onMounted(()=>{}),e.watch(()=>[d==null?void 0:d.content,d==null?void 0:d.jsonContents],async()=>{var w,y,V,D;if(((w=d==null?void 0:d.jsonContents)==null?void 0:w.length)>0){o.setOriginalData(d==null?void 0:d.jsonContents);return}if(!(d!=null&&d.content)||((y=d==null?void 0:d.content)==null?void 0:y.length)===0)return;u.value=!0,c.setImportLoading(!0);let _=[],p=[];l.setSelectTitle([]),l.setSelectIndex(""),l.setSelectMenu(""),(D=(V=d==null?void 0:d.content)==null?void 0:V.filter(B=>B!==""))==null||D.forEach(B=>{lt.isExpandStringToJson(B)?p.push(lt.expandStringToJson(B)):lt.expandNewStringToJson(B)?p.push(lt.expandNewStringToJson(B)):lt.expandContentStringToJson(B)?p.push(lt.expandContentStringToJson(B)):p.push(de.expandToNewContents(B))}),_=p==null?void 0:p[0],await de.savePageDataAsync(_),await r.loadingSystemType(),o.setOriginalData(_),c.setImportLoading(!1)},{deep:!0,immediate:!0}),(_,p)=>(e.openBlock(),e.createElementBlock("div",vs,[M.platform==="browser"?(e.openBlock(),e.createBlock(ns,{key:0},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Cs,{key:1,windowConfig:M.windowConfig},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Ns=dt._export_sfc(xs,[["__scopeId","data-v-65a44ad9"]]),Es={class:"add-model-content"},Ts={key:0,class:"model-operate"},As={class:"model-select"},Ms={class:"model-fill"},Ss={key:1,class:"model-view"},Ps={key:0,class:"model-import-data"},Ls={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(M,{emit:o}){const l=M,c=o,u=e.ref([]),d=e.ref([]),_=e.ref([]),p=e.ref(0),w=r.useModelComp(Ie.pinia),y=ye.useMenuState(Ie.pinia),{itemData:V,originalData:D}=ye.storeToRefs(w),{activeMenuPath:B,platform:T}=ye.storeToRefs(y),R=e.ref(null),v=e.ref(0),m=e.ref([]);e.ref("");const S=e.ref(0),N=g=>{c("contentChange",g)},O=g=>{var A;const j=(A=ct.cloneDeep(g==null?void 0:g.wholeValue))==null?void 0:A.map(x=>{var q;return(x==null?void 0:x.comp)==="Form"&&(x.compData=(q=x.compData)==null?void 0:q.map(F=>((F==null?void 0:F.key)==="formContent"&&(F.contents=lt.arrayToNumberArray(F==null?void 0:F.contents)),F))),x});c("change",{originalContents:D.value,currentContents:g==null?void 0:g.wholeValue,editContent:g==null?void 0:g.editValue,arrayToContents:j})};e.watch(()=>d.value,()=>{S.value===d.value.length&&d.value.length!==0&&(u.value=d.value)},{deep:!0,immediate:!0});const E=()=>{R.value.click()},k=async g=>{const j=g.target.files;if(!j)return;new FileReader,u.value=[],d.value=[],S.value=j.length;const A=Array.from(j).map(async x=>await new Promise(q=>{const F=new FileReader;F.onload=U=>{try{d.value.push(U.target.result),v.value++}catch(ie){console.error("解析失败:",ie);return}},F.onerror=()=>q(`读取 ${x.name} 失败`),F.readAsText(x),g.target.value="",R.value=null}));await Promise.all(A)};return e.watch(()=>[l==null?void 0:l.content,l==null?void 0:l.jsonContents],async()=>{await r.loadingSystemType(),u.value=l.content,_.value=l==null?void 0:l.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>v.value,()=>{var g;((g=m.value)==null?void 0:g.length)!==0&&(w.setOriginalData(m.value),w.setItemData(m.value))},{deep:!0,immediate:!0}),(g,j)=>{const A=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Es,[(l==null?void 0:l.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ts,[e.createElementVNode("div",As,[e.createVNode(Ke.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(Ke.modelShow)])),e.createElementVNode("div",Ms,[e.createVNode(Ke.modelFill)])])):e.createCommentVNode("",!0),(l==null?void 0:l.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Ss,[(e.openBlock(),e.createBlock(Ns,{platform:e.unref(T),content:u.value,onChange:O,jsonContents:_.value,onContentChange:N,key:p.value},{default:e.withCtx(()=>{var x;return[((x=l==null?void 0:l.jsonContents)==null?void 0:x.length)===0&&(l!=null&&l.showButton)?(e.openBlock(),e.createElementBlock("div",Ps,[e.createElementVNode("div",{class:"import-button",onClick:E},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:R,accept:".txt, .inm",onChange:k,style:{display:"none"},multiple:""},null,544),e.createVNode(A,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),j[0]||(j[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Vs=dt._export_sfc(Ls,[["__scopeId","data-v-4bf164f6"]]);exports.default=Vs;