ss-component-new 1.1.340 → 1.1.342

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 (74) hide show
  1. package/dist/{array-IAE5kJFG.cjs → array-BbLR4QFJ.cjs} +1 -1
  2. package/dist/{array-B06PZ90z.js → array-CIgl-zVp.js} +2 -2
  3. package/dist/{cloneDeep-B_AN9BZz.js → cloneDeep-B6dvqPwg.js} +1 -1
  4. package/dist/{cloneDeep-Y6SiJhri.cjs → cloneDeep-CsbXNSYy.cjs} +1 -1
  5. package/dist/{index-CgTJOHb6.cjs → index-1jVBtKXq.cjs} +1 -1
  6. package/dist/{index-B-xnZmbi.cjs → index-2Y_8Spti.cjs} +1 -1
  7. package/dist/{index-ChlLoDlf.cjs → index-BFz8ojUA.cjs} +1 -1
  8. package/dist/{index-CUbs-rQo.js → index-BGPQJXB3.js} +8 -8
  9. package/dist/{index-D7GTOlty.js → index-BMBjPvzr.js} +3 -3
  10. package/dist/{index-BAsOoTcX.js → index-BNhZu2YE.js} +4 -4
  11. package/dist/{index-BDb1KYMF.cjs → index-BRGrtqBY.cjs} +1 -1
  12. package/dist/{index-C1W9DoMg.js → index-B_NUrr4d.js} +3 -3
  13. package/dist/{index-9U7a4Lnn.js → index-BbZ5oZ0i.js} +1 -1
  14. package/dist/{index-DFbzBbkE.cjs → index-BcYDkpFv.cjs} +1 -1
  15. package/dist/{index-C4oaDD_g.js → index-BhsyjobL.js} +1 -1
  16. package/dist/{index-KES5JdwO.cjs → index-BkteT_oe.cjs} +1 -1
  17. package/dist/{index-B0GOpCVV.cjs → index-BnzdBVAZ.cjs} +1 -1
  18. package/dist/{index-DvdzE7Hf.cjs → index-BpyPhZFL.cjs} +1 -1
  19. package/dist/{index-NjLtPFI3.cjs → index-BtgTpXO3.cjs} +1 -1
  20. package/dist/{index-dc6tjlmP.cjs → index-BzDI1Hk1.cjs} +1 -1
  21. package/dist/{index-CDr_vYjF.js → index-C7YAhn2s.js} +4 -4
  22. package/dist/{index-DvvHClYJ.cjs → index-C80LCckV.cjs} +1 -1
  23. package/dist/{index-MH1oGtgn.cjs → index-CCBUJLcW.cjs} +1 -1
  24. package/dist/{index-Drs0Rsir.js → index-CFuHMQ0E.js} +3 -3
  25. package/dist/{index-DAKnsULb.cjs → index-CTItPGo-.cjs} +1 -1
  26. package/dist/{index-DR0WoAsz.js → index-CaDX01yd.js} +7 -7
  27. package/dist/{index-Cc6csIgf.cjs → index-CanLcekr.cjs} +1 -1
  28. package/dist/{index-Q5yac929.cjs → index-CpSZLiKk.cjs} +1 -1
  29. package/dist/{index-BCB0PEiR.cjs → index-CtXYbr9R.cjs} +1 -1
  30. package/dist/{index-Dg6ue4vz.cjs → index-CyUifof7.cjs} +2 -2
  31. package/dist/{index-ywmQAIKw.js → index-Cz6mt4xg.js} +3 -3
  32. package/dist/{index-xncpD9kf.js → index-D1SmPFCi.js} +4 -4
  33. package/dist/{index-B28cChvk.js → index-D24pmlO4.js} +7 -7
  34. package/dist/{index-BHF1ffp8.js → index-D5utaOGh.js} +15 -15
  35. package/dist/{index-DDdi9GZb.js → index-DABs8Kxo.js} +3 -3
  36. package/dist/{index-9Qo6zr3A.js → index-DBOIQSzb.js} +6 -6
  37. package/dist/{index-nu33sXcH.cjs → index-DERavfV0.cjs} +1 -1
  38. package/dist/{index-CrkPJvoF.cjs → index-DGhwNtIt.cjs} +1 -1
  39. package/dist/{index-DbQyV8A0.cjs → index-DLKC6eHy.cjs} +1 -1
  40. package/dist/{index-DwSfL4Mu.cjs → index-DOLlBmj2.cjs} +1 -1
  41. package/dist/{index-ELSCYb0q.cjs → index-DR0edIox.cjs} +1 -1
  42. package/dist/{index-Dam7jFb7.js → index-DXg7q_C4.js} +4 -4
  43. package/dist/{index-D4ctAO59.js → index-DkyKDNU2.js} +5 -5
  44. package/dist/{index-DPFPehud.cjs → index-Dmd8Gu9w.cjs} +1 -1
  45. package/dist/{index-DA4_7Z7H.js → index-DnUb2lBQ.js} +1 -1
  46. package/dist/{index-BxvxIhMb.cjs → index-DpFIZqXx.cjs} +1 -1
  47. package/dist/{index-ijUUHiQt.js → index-DszdIT7Q.js} +1 -1
  48. package/dist/{index-DuR9UdpW.js → index-DwWpxE53.js} +5 -5
  49. package/dist/{index-C9siKrRV.js → index-HNpuyw2U.js} +4 -4
  50. package/dist/{index-CNFKEdQr.js → index-IcpToIdy.js} +8 -8
  51. package/dist/{index-LMMepcVW.cjs → index-Lf5outC1.cjs} +1 -1
  52. package/dist/{index-C6Z9WchS.js → index-PfDSH60C.js} +5 -5
  53. package/dist/{index-t-T1ZMSZ.js → index-SijcElo_.js} +9 -9
  54. package/dist/{index-CJkfJyDo.js → index-Y0Cyumla.js} +5 -5
  55. package/dist/{index-DvcIn1u0.js → index-eD5QqJJO.js} +6 -6
  56. package/dist/{index-B8UHRfF_.cjs → index-rtQK9z6N.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_script_setup_true_lang-Dn-MIsQU.js → index.vue_vue_type_script_setup_true_lang-B2Pk0SDZ.js} +1 -1
  58. package/dist/{index.vue_vue_type_script_setup_true_lang-7xnZP-Qj.cjs → index.vue_vue_type_script_setup_true_lang-BLVTWxQ6.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_62633fa4_lang-Bvzwj2Wc.js → index.vue_vue_type_style_index_0_scoped_62633fa4_lang-DZg4mORk.js} +13 -13
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_62633fa4_lang-xSXwoed0.cjs → index.vue_vue_type_style_index_0_scoped_62633fa4_lang-fyq9ZrLg.cjs} +1 -1
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CLHTc7GG.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-C-VFwt4I.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-BWpBHfy4.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-Dc6z5Mju.js} +8 -8
  63. package/dist/{login-Com7R_T4.js → login-CGsSxGrp.js} +2 -2
  64. package/dist/{login-yEjJpKiY.cjs → login-CJlmnJXf.cjs} +1 -1
  65. package/dist/{main-BMPuoYVr.cjs → main-BB-V7rpk.cjs} +1 -1
  66. package/dist/{main-4EeVCnR6.js → main-CHMOdLsc.js} +7 -7
  67. package/dist/{menu-s4M6domI.js → menu-DWyy1zjD.js} +1 -1
  68. package/dist/{menu-CHw9SnTy.cjs → menu-sqTDeabF.cjs} +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
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ct=require("./index-B0GOpCVV.cjs"),zt=require("./index-DPFPehud.cjs"),tt=require("./index-BDb1KYMF.cjs"),i=require("./index-BxvxIhMb.cjs"),pe=require("./menu-CHw9SnTy.cjs"),Gn=require("./index-DvvHClYJ.cjs"),ue=require("./index.vue_vue_type_style_index_0_scoped_62633fa4_lang-xSXwoed0.cjs"),_t=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),wt=require("./array-IAE5kJFG.cjs"),fn=require("./login-yEjJpKiY.cjs"),mt=require("./index-BpPyaNFa.cjs"),mn=require("./index-Cc6csIgf.cjs"),gt=require("./cloneDeep-Y6SiJhri.cjs"),Gt=require("./index-DvdzE7Hf.cjs"),Dt=require("./index-MH1oGtgn.cjs"),sn={type:"change"},Ht={type:"start"},gn={type:"end"},St=new i.Ray,an=new i.Plane,Hn=Math.cos(70*i.MathUtils.DEG2RAD),Ue=new i.Vector3,Ze=2*Math.PI,Te={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ft=1e-6;class qn extends i.Controls{constructor(o,c=null){super(o,c),this.state=Te.NONE,this.target=new i.Vector3,this.cursor=new i.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.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:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN},this.touches={ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new i.Vector3,this._lastQuaternion=new i.Quaternion,this._lastTargetPosition=new i.Vector3,this._quat=new i.Quaternion().setFromUnitVectors(o.up,new i.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new i.Spherical,this._sphericalDelta=new i.Spherical,this._scale=1,this._panOffset=new i.Vector3,this._rotateStart=new i.Vector2,this._rotateEnd=new i.Vector2,this._rotateDelta=new i.Vector2,this._panStart=new i.Vector2,this._panEnd=new i.Vector2,this._panDelta=new i.Vector2,this._dollyStart=new i.Vector2,this._dollyEnd=new i.Vector2,this._dollyDelta=new i.Vector2,this._dollyDirection=new i.Vector3,this._mouse=new i.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Yn.bind(this),this._onPointerDown=$n.bind(this),this._onPointerUp=Wn.bind(this),this._onContextMenu=to.bind(this),this._onMouseWheel=Jn.bind(this),this._onKeyDown=Xn.bind(this),this._onTouchStart=Qn.bind(this),this._onTouchMove=eo.bind(this),this._onMouseDown=Kn.bind(this),this._onMouseMove=Zn.bind(this),this._interceptControlDown=no.bind(this),this._interceptControlUp=oo.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(sn),this.update(),this.state=Te.NONE}update(o=null){const c=this.object.position;Ue.copy(c).sub(this.target),Ue.applyQuaternion(this._quat),this._spherical.setFromVector3(Ue),this.autoRotate&&this.state===Te.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 u=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(u)&&isFinite(l)&&(u<-Math.PI?u+=Ze:u>Math.PI&&(u-=Ze),l<-Math.PI?l+=Ze:l>Math.PI&&(l-=Ze),u<=l?this._spherical.theta=Math.max(u,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(u+l)/2?Math.max(u,this._spherical.theta):Math.min(l,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 v=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),d=v!=this._spherical.radius}if(Ue.setFromSpherical(this._spherical),Ue.applyQuaternion(this._quatInverse),c.copy(this.target).add(Ue),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 v=null;if(this.object.isPerspectiveCamera){const p=Ue.length();v=this._clampDistance(p*this._scale);const _=p-v;this.object.position.addScaledVector(this._dollyDirection,_),this.object.updateMatrixWorld(),d=!!_}else if(this.object.isOrthographicCamera){const p=new i.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const _=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),d=_!==this.object.zoom;const k=new i.Vector3(this._mouse.x,this._mouse.y,0);k.unproject(this.object),this.object.position.sub(k).add(p),this.object.updateMatrixWorld(),v=Ue.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;v!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(v).add(this.object.position):(St.origin.copy(this.object.position),St.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(St.direction))<Hn?this.object.lookAt(this.target):(an.setFromNormalAndCoplanarPoint(this.object.up,this.target),St.intersectPlane(an,this.target))))}else if(this.object.isOrthographicCamera){const v=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),v!==this.object.zoom&&(this.object.updateProjectionMatrix(),d=!0)}return this._scale=1,this._performCursorZoom=!1,d||this._lastPosition.distanceToSquared(this.object.position)>Ft||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ft||this._lastTargetPosition.distanceToSquared(this.target)>Ft?(this.dispatchEvent(sn),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?Ze/60*this.autoRotateSpeed*o:Ze/60/60*this.autoRotateSpeed}_getZoomScale(o){const c=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*c)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,c){Ue.setFromMatrixColumn(c,0),Ue.multiplyScalar(-o),this._panOffset.add(Ue)}_panUp(o,c){this.screenSpacePanning===!0?Ue.setFromMatrixColumn(c,1):(Ue.setFromMatrixColumn(c,0),Ue.crossVectors(this.object.up,Ue)),Ue.multiplyScalar(o),this._panOffset.add(Ue)}_pan(o,c){const u=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;Ue.copy(l).sub(this.target);let d=Ue.length();d*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*d/u.clientHeight,this.object.matrix),this._panUp(2*c*d/u.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/u.clientWidth,this.object.matrix),this._panUp(c*(this.object.top-this.object.bottom)/this.object.zoom/u.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,c){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const u=this.domElement.getBoundingClientRect(),l=o-u.left,d=c-u.top,v=u.width,p=u.height;this._mouse.x=l/v*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 c=this.domElement;this._rotateLeft(Ze*this._rotateDelta.x/c.clientHeight),this._rotateUp(Ze*this._rotateDelta.y/c.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 c=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),c=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),c=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),c=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),c=!0;break}c&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._rotateStart.set(u,l)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._panStart.set(u,l)}}_handleTouchStartDolly(o){const c=this._getSecondPointerPosition(o),u=o.pageX-c.x,l=o.pageY-c.y,d=Math.sqrt(u*u+l*l);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 u=this._getSecondPointerPosition(o),l=.5*(o.pageX+u.x),d=.5*(o.pageY+u.y);this._rotateEnd.set(l,d)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const c=this.domElement;this._rotateLeft(Ze*this._rotateDelta.x/c.clientHeight),this._rotateUp(Ze*this._rotateDelta.y/c.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._panEnd.set(u,l)}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 c=this._getSecondPointerPosition(o),u=o.pageX-c.x,l=o.pageY-c.y,d=Math.sqrt(u*u+l*l);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 v=(o.pageX+c.x)*.5,p=(o.pageY+c.y)*.5;this._updateZoomParameters(v,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 c=0;c<this._pointers.length;c++)if(this._pointers[c]==o.pointerId){this._pointers.splice(c,1);return}}_isTrackingPointer(o){for(let c=0;c<this._pointers.length;c++)if(this._pointers[c]==o.pointerId)return!0;return!1}_trackPointer(o){let c=this._pointerPositions[o.pointerId];c===void 0&&(c=new i.Vector2,this._pointerPositions[o.pointerId]=c),c.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const c=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[c]}_customWheelEvent(o){const c=o.deltaMode,u={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(c){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(u.deltaY*=10),u}}function $n(V){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(V.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(V)&&(this._addPointer(V),V.pointerType==="touch"?this._onTouchStart(V):this._onMouseDown(V)))}function Yn(V){this.enabled!==!1&&(V.pointerType==="touch"?this._onTouchMove(V):this._onMouseMove(V))}function Wn(V){switch(this._removePointer(V),this._pointers.length){case 0:this.domElement.releasePointerCapture(V.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(gn),this.state=Te.NONE;break;case 1:const o=this._pointers[0],c=this._pointerPositions[o];this._onTouchStart({pointerId:o,pageX:c.x,pageY:c.y});break}}function Kn(V){let o;switch(V.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 i.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(V),this.state=Te.DOLLY;break;case i.MOUSE.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(V),this.state=Te.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(V),this.state=Te.ROTATE}break;case i.MOUSE.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(V),this.state=Te.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(V),this.state=Te.PAN}break;default:this.state=Te.NONE}this.state!==Te.NONE&&this.dispatchEvent(Ht)}function Zn(V){switch(this.state){case Te.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(V);break;case Te.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(V);break;case Te.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(V);break}}function Jn(V){this.enabled===!1||this.enableZoom===!1||this.state!==Te.NONE||(V.preventDefault(),this.dispatchEvent(Ht),this._handleMouseWheel(this._customWheelEvent(V)),this.dispatchEvent(gn))}function Xn(V){this.enabled!==!1&&this._handleKeyDown(V)}function Qn(V){switch(this._trackPointer(V),this._pointers.length){case 1:switch(this.touches.ONE){case i.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(V),this.state=Te.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(V),this.state=Te.TOUCH_PAN;break;default:this.state=Te.NONE}break;case 2:switch(this.touches.TWO){case i.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(V),this.state=Te.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(V),this.state=Te.TOUCH_DOLLY_ROTATE;break;default:this.state=Te.NONE}break;default:this.state=Te.NONE}this.state!==Te.NONE&&this.dispatchEvent(Ht)}function eo(V){switch(this._trackPointer(V),this.state){case Te.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(V),this.update();break;case Te.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(V),this.update();break;case Te.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(V),this.update();break;case Te.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(V),this.update();break;default:this.state=Te.NONE}}function to(V){this.enabled!==!1&&V.preventDefault()}function no(V){V.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oo(V){V.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function so(V){let o=null,c=null,u=null,l=null,d=null,v=null;const p=e.ref([]),_=e.ref(new i.Vector3),k=e.ref(new i.Vector3),P=()=>{if(!V.value)return;o=new i.Scene,o.background=new i.Color(15790320);const T=V.value;c=new i.PerspectiveCamera(75,T.clientWidth/T.clientHeight,.1,1e4),u=new i.WebGLRenderer({antialias:!0,alpha:!0}),u.setSize(T.clientWidth,T.clientHeight),u.localClippingEnabled=!0,u.shadowMap.enabled=!0,u.shadowMap.type=i.PCFSoftShadowMap,u.toneMapping=i.ACESFilmicToneMapping,u.toneMappingExposure=1,u.outputColorSpace=i.SRGBColorSpace,T.appendChild(u.domElement),l=new qn(c,u.domElement),l.enableDamping=!0,l.dampingFactor=.05,d=new i.Xe(c,u,{container:T,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),d.attachControls(l),F(),j()},F=()=>{const T=new i.AmbientLight(4210752,.6);o.add(T);const x=new i.DirectionalLight(16777215,2);x.position.set(10,10,8),x.castShadow=!0,x.shadow.mapSize.width=2048,x.shadow.mapSize.height=2048,x.shadow.camera.near=.5,x.shadow.camera.far=50,o.add(x);const y=new i.DirectionalLight(16777215,.8);y.position.set(-8,-8,6),o.add(y);const B=new i.DirectionalLight(16777215,.6);B.position.set(0,-15,2),o.add(B);const N=new i.HemisphereLight(16777215,4473924,.8);o.add(N);const S=new i.PointLight(16777215,1,50);S.position.set(15,15,15),o.add(S);const W=new i.PointLight(16777215,.5,50);W.position.set(-15,-15,15),o.add(W)},j=()=>{v=requestAnimationFrame(j),l&&l.update(),u&&o&&c&&u.render(o,c),d&&d.render()},b=T=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(y=>{T[y]&&T[y].dispose&&T[y].dispose()}),T.dispose&&T.dispose()},h=T=>{T.traverse(x=>{x.geometry&&x.geometry.dispose(),x.material&&(Array.isArray(x.material)?x.material.forEach(y=>{b(y)}):b(x.material))})};return{currentModels:p,initialCameraPosition:_,initialTargetPosition:k,initThreeJS:P,handleResize:()=>{if(!V.value||!c||!u||!d)return;const T=V.value,x=T.clientWidth,y=T.clientHeight;c.aspect=x/y,c.updateProjectionMatrix(),u.setSize(x,y),d.update()},fitCameraToAllModels:()=>{if(!c||!l||p.value.length===0)return;const T=new i.Box3;p.value.forEach(O=>{T.expandByObject(O)});const x=T.getSize(new i.Vector3),y=T.getCenter(new i.Vector3),N=Math.max(x.x,x.y,x.z)*.8,S=new i.Vector3(y.x+N,y.y+N,y.z+N),W=y.clone();c.position.copy(S),c.lookAt(W),l.target.copy(W),l.update(),_.value.copy(S),k.value.copy(W)},getThreeJSObjects:()=>({scene:o,camera:c,renderer:u,controls:l,gizmo:d}),clearAllModels:()=>{if(!o)return;p.value.forEach(x=>{o.remove(x),h(x)});const T=[];o.children.forEach(x=>{!x.isLight&&!x.isCamera&&T.push(x)}),T.forEach(x=>{o.remove(x),h(x)}),p.value=[]},cleanup:()=>{v&&cancelAnimationFrame(v),u&&u.dispose(),l&&l.dispose(),d&&d.dispose()}}}function io(V,o){const c=e.ref(!1);let u=null,l=12700,d=new i.Vector3,v=new i.Vector3,p=new i.Vector3,_=0,k=null;const P=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2,F=m=>{const w=new i.Vector3,f=_*1.2,E=new i.Vector3(p.x+f,p.y,p.z),T=new i.Vector3(p.x,p.y+f,p.z),x=new i.Vector3(p.x,p.y-f,p.z);if(m<=.567){const B=m/.567*Math.PI*2;w.x=p.x+Math.cos(B)*f,w.z=p.z+Math.sin(B)*f,w.y=p.y}else if(m<=.724){const y=(m-.567)/.157,B=P(y);w.lerpVectors(E,T,B)}else if(m<=.881){const y=(m-.724)/.157,N=P(y)*Math.PI;w.x=p.x+Math.sin(N)*f,w.y=p.y+Math.cos(N)*f,w.z=p.z}else{const y=(m-.881)/.119,B=P(y);w.lerpVectors(x,d,B)}return w},j=()=>{const{camera:m,controls:w}=V();if(!m||!w)return;u||(u=Date.now());const f=Date.now()-u,E=Math.min(f/l,1);if(E>=1){h();return}const T=F(E);m.position.copy(T),m.lookAt(p),w.target.copy(p),k=requestAnimationFrame(j)},b=()=>{if(o.value.length===0)return;const{camera:m,controls:w}=V();if(!m||!w)return;d.copy(m.position),v.copy(w.target);const f=new i.Box3;o.value.forEach(S=>{f.expandByObject(S)});const E=f.getSize(new i.Vector3);p=f.getCenter(new i.Vector3),_=Math.max(E.x,E.y,E.z)*1.2;const T=new i.Vector3(p.x+_*1.2,p.y,p.z);w.enabled=!1;const x=m.position.clone(),y=1e3,B=Date.now(),N=()=>{const S=Date.now()-B,W=Math.min(S/y,1),O=P(W);m.position.lerpVectors(x,T,O),m.lookAt(p),w.target.copy(p),W<1?requestAnimationFrame(N):(c.value=!0,u=null,j())};N()},h=()=>{c.value=!1,u=null,k&&(cancelAnimationFrame(k),k=null);const{controls:m}=V();m&&(m.enabled=!0,m.target.copy(v))};return{isAnimating:c,toggleAnimation:()=>{if(c.value){c.value=!1,u=null,k&&(cancelAnimationFrame(k),k=null);const{camera:m,controls:w}=V();if(!m||!w)return;w.enabled=!0;const f=m.position.clone(),E=w.target.clone(),T=1500,x=Date.now(),y=()=>{const B=Date.now()-x,N=Math.min(B/T,1),S=P(N);m.position.lerpVectors(f,d,S),w.target.lerpVectors(E,v,S),N<1&&requestAnimationFrame(y)};y()}else b()},startAnimation:b,stopAnimation:h}}function ao(V,o){const c=e.ref(!1),u=e.ref("none");let l=[],d=[],v=new i.Box3,p=new i.Vector3;const _=()=>{l=[new i.Plane(new i.Vector3(1,0,0),0),new i.Plane(new i.Vector3(0,1,0),0),new i.Plane(new i.Vector3(0,0,1),0)]},k=()=>{v.makeEmpty(),o.value.forEach(A=>{v.expandByObject(A)}),p=v.getCenter(new i.Vector3)},P=A=>{const m=v.getSize(new i.Vector3);let w,f,E;A==="x"?(w=new i.PlaneGeometry(m.z*1.2,m.y*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(0,Math.PI/2,0)):A==="y"?(w=new i.PlaneGeometry(m.x*1.2,m.z*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(Math.PI/2,0,0)):A==="z"&&(w=new i.PlaneGeometry(m.x*1.2,m.y*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(0,0,0));const T=new i.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:i.DoubleSide,depthWrite:!1}),x=new i.Mesh(w,T);return x.position.copy(f),x.rotation.copy(E),x},F=()=>{if(j(),b(),u.value==="none")return;k();let A=null;if(u.value==="x"?(l[0].constant=-p.x,A=l[0]):u.value==="y"?(l[1].constant=-p.y,A=l[1]):u.value==="z"&&(l[2].constant=-p.z,A=l[2]),A){o.value.forEach(w=>{w.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(E=>{E.clippingPlanes=[A]}):f.material.clippingPlanes=[A])})});const{scene:m}=V();if(m){const w=P(u.value);m.add(w),d.push(w)}}},j=()=>{o.value.forEach(A=>{A.traverse(m=>{m.isMesh&&m.material&&(Array.isArray(m.material)?m.material.forEach(w=>{w.clippingPlanes=[]}):m.material.clippingPlanes=[])})})},b=()=>{const{scene:A}=V();A&&d.forEach(m=>{A.remove(m),m.geometry.dispose(),m.material.dispose()}),d=[]};return{isClipping:c,activeClippingAxis:u,toggleClipping:()=>{c.value=!c.value,c.value?(_(),o.value.length>0&&k()):(u.value="none",j(),b())},updateClippingPlanes:F,clearClippingPlanes:j,clearClippingMeshes:b}}const ro=/^[og]\s*(.+)?/,lo=/^mtllib /,co=/^usemtl /,uo=/^usemap /,rn=/\s+/,ln=new i.Vector3,It=new i.Vector3,cn=new i.Vector3,dn=new i.Vector3,et=new i.Vector3,Pt=new i.Color;function ho(){const V={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(o,c){if(this.object&&this.object.fromDeclaration===!1){this.object.name=o,this.object.fromDeclaration=c!==!1;return}const u=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:c!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(l,d){const v=this._finalize(!1);v&&(v.inherited||v.groupCount<=0)&&this.materials.splice(v.index,1);const p={index:this.materials.length,name:l||"",mtllib:Array.isArray(d)&&d.length>0?d[d.length-1]:"",smooth:v!==void 0?v.smooth:this.smooth,groupStart:v!==void 0?v.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(_){const k={index:typeof _=="number"?_:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return k.clone=this.clone.bind(k),k}};return this.materials.push(p),p},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(l){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),l&&this.materials.length>1)for(let v=this.materials.length-1;v>=0;v--)this.materials[v].groupCount<=0&&this.materials.splice(v,1);return l&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),d}},u&&u.name&&typeof u.clone=="function"){const l=u.clone(0);l.inherited=!0,this.object.materials.push(l)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/3)*3},parseNormalIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/3)*3},parseUVIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/2)*2},addVertex:function(o,c,u){const l=this.vertices,d=this.object.geometry.vertices;d.push(l[o+0],l[o+1],l[o+2]),d.push(l[c+0],l[c+1],l[c+2]),d.push(l[u+0],l[u+1],l[u+2])},addVertexPoint:function(o){const c=this.vertices;this.object.geometry.vertices.push(c[o+0],c[o+1],c[o+2])},addVertexLine:function(o){const c=this.vertices;this.object.geometry.vertices.push(c[o+0],c[o+1],c[o+2])},addNormal:function(o,c,u){const l=this.normals,d=this.object.geometry.normals;d.push(l[o+0],l[o+1],l[o+2]),d.push(l[c+0],l[c+1],l[c+2]),d.push(l[u+0],l[u+1],l[u+2])},addFaceNormal:function(o,c,u){const l=this.vertices,d=this.object.geometry.normals;ln.fromArray(l,o),It.fromArray(l,c),cn.fromArray(l,u),et.subVectors(cn,It),dn.subVectors(ln,It),et.cross(dn),et.normalize(),d.push(et.x,et.y,et.z),d.push(et.x,et.y,et.z),d.push(et.x,et.y,et.z)},addColor:function(o,c,u){const l=this.colors,d=this.object.geometry.colors;l[o]!==void 0&&d.push(l[o+0],l[o+1],l[o+2]),l[c]!==void 0&&d.push(l[c+0],l[c+1],l[c+2]),l[u]!==void 0&&d.push(l[u+0],l[u+1],l[u+2])},addUV:function(o,c,u){const l=this.uvs,d=this.object.geometry.uvs;d.push(l[o+0],l[o+1]),d.push(l[c+0],l[c+1]),d.push(l[u+0],l[u+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 c=this.uvs;this.object.geometry.uvs.push(c[o+0],c[o+1])},addFace:function(o,c,u,l,d,v,p,_,k){const P=this.vertices.length;let F=this.parseVertexIndex(o,P),j=this.parseVertexIndex(c,P),b=this.parseVertexIndex(u,P);if(this.addVertex(F,j,b),this.addColor(F,j,b),p!==void 0&&p!==""){const h=this.normals.length;F=this.parseNormalIndex(p,h),j=this.parseNormalIndex(_,h),b=this.parseNormalIndex(k,h),this.addNormal(F,j,b)}else this.addFaceNormal(F,j,b);if(l!==void 0&&l!==""){const h=this.uvs.length;F=this.parseUVIndex(l,h),j=this.parseUVIndex(d,h),b=this.parseUVIndex(v,h),this.addUV(F,j,b),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const c=this.vertices.length;for(let u=0,l=o.length;u<l;u++){const d=this.parseVertexIndex(o[u],c);this.addVertexPoint(d),this.addColor(d)}},addLineGeometry:function(o,c){this.object.geometry.type="Line";const u=this.vertices.length,l=this.uvs.length;for(let d=0,v=o.length;d<v;d++)this.addVertexLine(this.parseVertexIndex(o[d],u));for(let d=0,v=c.length;d<v;d++)this.addUVLine(this.parseUVIndex(c[d],l))}};return V.startObject("",!1),V}class jt extends i.Loader{constructor(o){super(o),this.materials=null}load(o,c,u,l){const d=this,v=new i.FileLoader(this.manager);v.setPath(this.path),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(o,function(p){try{c(d.parse(p))}catch(_){l?l(_):console.error(_),d.manager.itemError(o)}},u,l)}setMaterials(o){return this.materials=o,this}parse(o){const c=new ho;o.indexOf(`\r
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ct=require("./index-BnzdBVAZ.cjs"),zt=require("./index-Dmd8Gu9w.cjs"),tt=require("./index-BRGrtqBY.cjs"),i=require("./index-DpFIZqXx.cjs"),pe=require("./menu-sqTDeabF.cjs"),Gn=require("./index-C80LCckV.cjs"),ue=require("./index.vue_vue_type_style_index_0_scoped_62633fa4_lang-fyq9ZrLg.cjs"),_t=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),wt=require("./array-BbLR4QFJ.cjs"),fn=require("./login-CJlmnJXf.cjs"),mt=require("./index-BpPyaNFa.cjs"),mn=require("./index-CanLcekr.cjs"),gt=require("./cloneDeep-CsbXNSYy.cjs"),Gt=require("./index-BpyPhZFL.cjs"),Dt=require("./index-CCBUJLcW.cjs"),sn={type:"change"},Ht={type:"start"},gn={type:"end"},St=new i.Ray,an=new i.Plane,Hn=Math.cos(70*i.MathUtils.DEG2RAD),Ue=new i.Vector3,Ze=2*Math.PI,Te={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Ft=1e-6;class qn extends i.Controls{constructor(o,c=null){super(o,c),this.state=Te.NONE,this.target=new i.Vector3,this.cursor=new i.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.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:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN},this.touches={ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new i.Vector3,this._lastQuaternion=new i.Quaternion,this._lastTargetPosition=new i.Vector3,this._quat=new i.Quaternion().setFromUnitVectors(o.up,new i.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new i.Spherical,this._sphericalDelta=new i.Spherical,this._scale=1,this._panOffset=new i.Vector3,this._rotateStart=new i.Vector2,this._rotateEnd=new i.Vector2,this._rotateDelta=new i.Vector2,this._panStart=new i.Vector2,this._panEnd=new i.Vector2,this._panDelta=new i.Vector2,this._dollyStart=new i.Vector2,this._dollyEnd=new i.Vector2,this._dollyDelta=new i.Vector2,this._dollyDirection=new i.Vector3,this._mouse=new i.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Yn.bind(this),this._onPointerDown=$n.bind(this),this._onPointerUp=Wn.bind(this),this._onContextMenu=to.bind(this),this._onMouseWheel=Jn.bind(this),this._onKeyDown=Xn.bind(this),this._onTouchStart=Qn.bind(this),this._onTouchMove=eo.bind(this),this._onMouseDown=Kn.bind(this),this._onMouseMove=Zn.bind(this),this._interceptControlDown=no.bind(this),this._interceptControlUp=oo.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(sn),this.update(),this.state=Te.NONE}update(o=null){const c=this.object.position;Ue.copy(c).sub(this.target),Ue.applyQuaternion(this._quat),this._spherical.setFromVector3(Ue),this.autoRotate&&this.state===Te.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 u=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(u)&&isFinite(l)&&(u<-Math.PI?u+=Ze:u>Math.PI&&(u-=Ze),l<-Math.PI?l+=Ze:l>Math.PI&&(l-=Ze),u<=l?this._spherical.theta=Math.max(u,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(u+l)/2?Math.max(u,this._spherical.theta):Math.min(l,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 v=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),d=v!=this._spherical.radius}if(Ue.setFromSpherical(this._spherical),Ue.applyQuaternion(this._quatInverse),c.copy(this.target).add(Ue),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 v=null;if(this.object.isPerspectiveCamera){const p=Ue.length();v=this._clampDistance(p*this._scale);const _=p-v;this.object.position.addScaledVector(this._dollyDirection,_),this.object.updateMatrixWorld(),d=!!_}else if(this.object.isOrthographicCamera){const p=new i.Vector3(this._mouse.x,this._mouse.y,0);p.unproject(this.object);const _=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),d=_!==this.object.zoom;const k=new i.Vector3(this._mouse.x,this._mouse.y,0);k.unproject(this.object),this.object.position.sub(k).add(p),this.object.updateMatrixWorld(),v=Ue.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;v!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(v).add(this.object.position):(St.origin.copy(this.object.position),St.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(St.direction))<Hn?this.object.lookAt(this.target):(an.setFromNormalAndCoplanarPoint(this.object.up,this.target),St.intersectPlane(an,this.target))))}else if(this.object.isOrthographicCamera){const v=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),v!==this.object.zoom&&(this.object.updateProjectionMatrix(),d=!0)}return this._scale=1,this._performCursorZoom=!1,d||this._lastPosition.distanceToSquared(this.object.position)>Ft||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Ft||this._lastTargetPosition.distanceToSquared(this.target)>Ft?(this.dispatchEvent(sn),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(o){return o!==null?Ze/60*this.autoRotateSpeed*o:Ze/60/60*this.autoRotateSpeed}_getZoomScale(o){const c=Math.abs(o*.01);return Math.pow(.95,this.zoomSpeed*c)}_rotateLeft(o){this._sphericalDelta.theta-=o}_rotateUp(o){this._sphericalDelta.phi-=o}_panLeft(o,c){Ue.setFromMatrixColumn(c,0),Ue.multiplyScalar(-o),this._panOffset.add(Ue)}_panUp(o,c){this.screenSpacePanning===!0?Ue.setFromMatrixColumn(c,1):(Ue.setFromMatrixColumn(c,0),Ue.crossVectors(this.object.up,Ue)),Ue.multiplyScalar(o),this._panOffset.add(Ue)}_pan(o,c){const u=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;Ue.copy(l).sub(this.target);let d=Ue.length();d*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*o*d/u.clientHeight,this.object.matrix),this._panUp(2*c*d/u.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(o*(this.object.right-this.object.left)/this.object.zoom/u.clientWidth,this.object.matrix),this._panUp(c*(this.object.top-this.object.bottom)/this.object.zoom/u.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,c){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const u=this.domElement.getBoundingClientRect(),l=o-u.left,d=c-u.top,v=u.width,p=u.height;this._mouse.x=l/v*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 c=this.domElement;this._rotateLeft(Ze*this._rotateDelta.x/c.clientHeight),this._rotateUp(Ze*this._rotateDelta.y/c.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 c=!1;switch(o.code){case this.keys.UP:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),c=!0;break;case this.keys.BOTTOM:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateUp(-Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),c=!0;break;case this.keys.LEFT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),c=!0;break;case this.keys.RIGHT:o.ctrlKey||o.metaKey||o.shiftKey?this.enableRotate&&this._rotateLeft(-Ze*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),c=!0;break}c&&(o.preventDefault(),this.update())}_handleTouchStartRotate(o){if(this._pointers.length===1)this._rotateStart.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._rotateStart.set(u,l)}}_handleTouchStartPan(o){if(this._pointers.length===1)this._panStart.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._panStart.set(u,l)}}_handleTouchStartDolly(o){const c=this._getSecondPointerPosition(o),u=o.pageX-c.x,l=o.pageY-c.y,d=Math.sqrt(u*u+l*l);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 u=this._getSecondPointerPosition(o),l=.5*(o.pageX+u.x),d=.5*(o.pageY+u.y);this._rotateEnd.set(l,d)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const c=this.domElement;this._rotateLeft(Ze*this._rotateDelta.x/c.clientHeight),this._rotateUp(Ze*this._rotateDelta.y/c.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(o){if(this._pointers.length===1)this._panEnd.set(o.pageX,o.pageY);else{const c=this._getSecondPointerPosition(o),u=.5*(o.pageX+c.x),l=.5*(o.pageY+c.y);this._panEnd.set(u,l)}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 c=this._getSecondPointerPosition(o),u=o.pageX-c.x,l=o.pageY-c.y,d=Math.sqrt(u*u+l*l);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 v=(o.pageX+c.x)*.5,p=(o.pageY+c.y)*.5;this._updateZoomParameters(v,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 c=0;c<this._pointers.length;c++)if(this._pointers[c]==o.pointerId){this._pointers.splice(c,1);return}}_isTrackingPointer(o){for(let c=0;c<this._pointers.length;c++)if(this._pointers[c]==o.pointerId)return!0;return!1}_trackPointer(o){let c=this._pointerPositions[o.pointerId];c===void 0&&(c=new i.Vector2,this._pointerPositions[o.pointerId]=c),c.set(o.pageX,o.pageY)}_getSecondPointerPosition(o){const c=o.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[c]}_customWheelEvent(o){const c=o.deltaMode,u={clientX:o.clientX,clientY:o.clientY,deltaY:o.deltaY};switch(c){case 1:u.deltaY*=16;break;case 2:u.deltaY*=100;break}return o.ctrlKey&&!this._controlActive&&(u.deltaY*=10),u}}function $n(V){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(V.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(V)&&(this._addPointer(V),V.pointerType==="touch"?this._onTouchStart(V):this._onMouseDown(V)))}function Yn(V){this.enabled!==!1&&(V.pointerType==="touch"?this._onTouchMove(V):this._onMouseMove(V))}function Wn(V){switch(this._removePointer(V),this._pointers.length){case 0:this.domElement.releasePointerCapture(V.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(gn),this.state=Te.NONE;break;case 1:const o=this._pointers[0],c=this._pointerPositions[o];this._onTouchStart({pointerId:o,pageX:c.x,pageY:c.y});break}}function Kn(V){let o;switch(V.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 i.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(V),this.state=Te.DOLLY;break;case i.MOUSE.ROTATE:if(V.ctrlKey||V.metaKey||V.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(V),this.state=Te.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(V),this.state=Te.ROTATE}break;case i.MOUSE.PAN:if(V.ctrlKey||V.metaKey||V.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(V),this.state=Te.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(V),this.state=Te.PAN}break;default:this.state=Te.NONE}this.state!==Te.NONE&&this.dispatchEvent(Ht)}function Zn(V){switch(this.state){case Te.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(V);break;case Te.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(V);break;case Te.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(V);break}}function Jn(V){this.enabled===!1||this.enableZoom===!1||this.state!==Te.NONE||(V.preventDefault(),this.dispatchEvent(Ht),this._handleMouseWheel(this._customWheelEvent(V)),this.dispatchEvent(gn))}function Xn(V){this.enabled!==!1&&this._handleKeyDown(V)}function Qn(V){switch(this._trackPointer(V),this._pointers.length){case 1:switch(this.touches.ONE){case i.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(V),this.state=Te.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(V),this.state=Te.TOUCH_PAN;break;default:this.state=Te.NONE}break;case 2:switch(this.touches.TWO){case i.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(V),this.state=Te.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(V),this.state=Te.TOUCH_DOLLY_ROTATE;break;default:this.state=Te.NONE}break;default:this.state=Te.NONE}this.state!==Te.NONE&&this.dispatchEvent(Ht)}function eo(V){switch(this._trackPointer(V),this.state){case Te.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(V),this.update();break;case Te.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(V),this.update();break;case Te.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(V),this.update();break;case Te.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(V),this.update();break;default:this.state=Te.NONE}}function to(V){this.enabled!==!1&&V.preventDefault()}function no(V){V.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function oo(V){V.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function so(V){let o=null,c=null,u=null,l=null,d=null,v=null;const p=e.ref([]),_=e.ref(new i.Vector3),k=e.ref(new i.Vector3),P=()=>{if(!V.value)return;o=new i.Scene,o.background=new i.Color(15790320);const T=V.value;c=new i.PerspectiveCamera(75,T.clientWidth/T.clientHeight,.1,1e4),u=new i.WebGLRenderer({antialias:!0,alpha:!0}),u.setSize(T.clientWidth,T.clientHeight),u.localClippingEnabled=!0,u.shadowMap.enabled=!0,u.shadowMap.type=i.PCFSoftShadowMap,u.toneMapping=i.ACESFilmicToneMapping,u.toneMappingExposure=1,u.outputColorSpace=i.SRGBColorSpace,T.appendChild(u.domElement),l=new qn(c,u.domElement),l.enableDamping=!0,l.dampingFactor=.05,d=new i.Xe(c,u,{container:T,type:"cube",placement:"bottom-left",offset:{left:350,bottom:22},background:{color:"#D1D1D1"}}),d.attachControls(l),F(),j()},F=()=>{const T=new i.AmbientLight(4210752,.6);o.add(T);const x=new i.DirectionalLight(16777215,2);x.position.set(10,10,8),x.castShadow=!0,x.shadow.mapSize.width=2048,x.shadow.mapSize.height=2048,x.shadow.camera.near=.5,x.shadow.camera.far=50,o.add(x);const y=new i.DirectionalLight(16777215,.8);y.position.set(-8,-8,6),o.add(y);const B=new i.DirectionalLight(16777215,.6);B.position.set(0,-15,2),o.add(B);const N=new i.HemisphereLight(16777215,4473924,.8);o.add(N);const S=new i.PointLight(16777215,1,50);S.position.set(15,15,15),o.add(S);const W=new i.PointLight(16777215,.5,50);W.position.set(-15,-15,15),o.add(W)},j=()=>{v=requestAnimationFrame(j),l&&l.update(),u&&o&&c&&u.render(o,c),d&&d.render()},b=T=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(y=>{T[y]&&T[y].dispose&&T[y].dispose()}),T.dispose&&T.dispose()},h=T=>{T.traverse(x=>{x.geometry&&x.geometry.dispose(),x.material&&(Array.isArray(x.material)?x.material.forEach(y=>{b(y)}):b(x.material))})};return{currentModels:p,initialCameraPosition:_,initialTargetPosition:k,initThreeJS:P,handleResize:()=>{if(!V.value||!c||!u||!d)return;const T=V.value,x=T.clientWidth,y=T.clientHeight;c.aspect=x/y,c.updateProjectionMatrix(),u.setSize(x,y),d.update()},fitCameraToAllModels:()=>{if(!c||!l||p.value.length===0)return;const T=new i.Box3;p.value.forEach(O=>{T.expandByObject(O)});const x=T.getSize(new i.Vector3),y=T.getCenter(new i.Vector3),N=Math.max(x.x,x.y,x.z)*.8,S=new i.Vector3(y.x+N,y.y+N,y.z+N),W=y.clone();c.position.copy(S),c.lookAt(W),l.target.copy(W),l.update(),_.value.copy(S),k.value.copy(W)},getThreeJSObjects:()=>({scene:o,camera:c,renderer:u,controls:l,gizmo:d}),clearAllModels:()=>{if(!o)return;p.value.forEach(x=>{o.remove(x),h(x)});const T=[];o.children.forEach(x=>{!x.isLight&&!x.isCamera&&T.push(x)}),T.forEach(x=>{o.remove(x),h(x)}),p.value=[]},cleanup:()=>{v&&cancelAnimationFrame(v),u&&u.dispose(),l&&l.dispose(),d&&d.dispose()}}}function io(V,o){const c=e.ref(!1);let u=null,l=12700,d=new i.Vector3,v=new i.Vector3,p=new i.Vector3,_=0,k=null;const P=m=>m<.5?4*m*m*m:1-Math.pow(-2*m+2,3)/2,F=m=>{const w=new i.Vector3,f=_*1.2,E=new i.Vector3(p.x+f,p.y,p.z),T=new i.Vector3(p.x,p.y+f,p.z),x=new i.Vector3(p.x,p.y-f,p.z);if(m<=.567){const B=m/.567*Math.PI*2;w.x=p.x+Math.cos(B)*f,w.z=p.z+Math.sin(B)*f,w.y=p.y}else if(m<=.724){const y=(m-.567)/.157,B=P(y);w.lerpVectors(E,T,B)}else if(m<=.881){const y=(m-.724)/.157,N=P(y)*Math.PI;w.x=p.x+Math.sin(N)*f,w.y=p.y+Math.cos(N)*f,w.z=p.z}else{const y=(m-.881)/.119,B=P(y);w.lerpVectors(x,d,B)}return w},j=()=>{const{camera:m,controls:w}=V();if(!m||!w)return;u||(u=Date.now());const f=Date.now()-u,E=Math.min(f/l,1);if(E>=1){h();return}const T=F(E);m.position.copy(T),m.lookAt(p),w.target.copy(p),k=requestAnimationFrame(j)},b=()=>{if(o.value.length===0)return;const{camera:m,controls:w}=V();if(!m||!w)return;d.copy(m.position),v.copy(w.target);const f=new i.Box3;o.value.forEach(S=>{f.expandByObject(S)});const E=f.getSize(new i.Vector3);p=f.getCenter(new i.Vector3),_=Math.max(E.x,E.y,E.z)*1.2;const T=new i.Vector3(p.x+_*1.2,p.y,p.z);w.enabled=!1;const x=m.position.clone(),y=1e3,B=Date.now(),N=()=>{const S=Date.now()-B,W=Math.min(S/y,1),O=P(W);m.position.lerpVectors(x,T,O),m.lookAt(p),w.target.copy(p),W<1?requestAnimationFrame(N):(c.value=!0,u=null,j())};N()},h=()=>{c.value=!1,u=null,k&&(cancelAnimationFrame(k),k=null);const{controls:m}=V();m&&(m.enabled=!0,m.target.copy(v))};return{isAnimating:c,toggleAnimation:()=>{if(c.value){c.value=!1,u=null,k&&(cancelAnimationFrame(k),k=null);const{camera:m,controls:w}=V();if(!m||!w)return;w.enabled=!0;const f=m.position.clone(),E=w.target.clone(),T=1500,x=Date.now(),y=()=>{const B=Date.now()-x,N=Math.min(B/T,1),S=P(N);m.position.lerpVectors(f,d,S),w.target.lerpVectors(E,v,S),N<1&&requestAnimationFrame(y)};y()}else b()},startAnimation:b,stopAnimation:h}}function ao(V,o){const c=e.ref(!1),u=e.ref("none");let l=[],d=[],v=new i.Box3,p=new i.Vector3;const _=()=>{l=[new i.Plane(new i.Vector3(1,0,0),0),new i.Plane(new i.Vector3(0,1,0),0),new i.Plane(new i.Vector3(0,0,1),0)]},k=()=>{v.makeEmpty(),o.value.forEach(A=>{v.expandByObject(A)}),p=v.getCenter(new i.Vector3)},P=A=>{const m=v.getSize(new i.Vector3);let w,f,E;A==="x"?(w=new i.PlaneGeometry(m.z*1.2,m.y*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(0,Math.PI/2,0)):A==="y"?(w=new i.PlaneGeometry(m.x*1.2,m.z*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(Math.PI/2,0,0)):A==="z"&&(w=new i.PlaneGeometry(m.x*1.2,m.y*1.2),f=new i.Vector3(p.x,p.y,p.z),E=new i.Euler(0,0,0));const T=new i.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:i.DoubleSide,depthWrite:!1}),x=new i.Mesh(w,T);return x.position.copy(f),x.rotation.copy(E),x},F=()=>{if(j(),b(),u.value==="none")return;k();let A=null;if(u.value==="x"?(l[0].constant=-p.x,A=l[0]):u.value==="y"?(l[1].constant=-p.y,A=l[1]):u.value==="z"&&(l[2].constant=-p.z,A=l[2]),A){o.value.forEach(w=>{w.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(E=>{E.clippingPlanes=[A]}):f.material.clippingPlanes=[A])})});const{scene:m}=V();if(m){const w=P(u.value);m.add(w),d.push(w)}}},j=()=>{o.value.forEach(A=>{A.traverse(m=>{m.isMesh&&m.material&&(Array.isArray(m.material)?m.material.forEach(w=>{w.clippingPlanes=[]}):m.material.clippingPlanes=[])})})},b=()=>{const{scene:A}=V();A&&d.forEach(m=>{A.remove(m),m.geometry.dispose(),m.material.dispose()}),d=[]};return{isClipping:c,activeClippingAxis:u,toggleClipping:()=>{c.value=!c.value,c.value?(_(),o.value.length>0&&k()):(u.value="none",j(),b())},updateClippingPlanes:F,clearClippingPlanes:j,clearClippingMeshes:b}}const ro=/^[og]\s*(.+)?/,lo=/^mtllib /,co=/^usemtl /,uo=/^usemap /,rn=/\s+/,ln=new i.Vector3,It=new i.Vector3,cn=new i.Vector3,dn=new i.Vector3,et=new i.Vector3,Pt=new i.Color;function ho(){const V={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(o,c){if(this.object&&this.object.fromDeclaration===!1){this.object.name=o,this.object.fromDeclaration=c!==!1;return}const u=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:c!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(l,d){const v=this._finalize(!1);v&&(v.inherited||v.groupCount<=0)&&this.materials.splice(v.index,1);const p={index:this.materials.length,name:l||"",mtllib:Array.isArray(d)&&d.length>0?d[d.length-1]:"",smooth:v!==void 0?v.smooth:this.smooth,groupStart:v!==void 0?v.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(_){const k={index:typeof _=="number"?_:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return k.clone=this.clone.bind(k),k}};return this.materials.push(p),p},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(l){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),l&&this.materials.length>1)for(let v=this.materials.length-1;v>=0;v--)this.materials[v].groupCount<=0&&this.materials.splice(v,1);return l&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),d}},u&&u.name&&typeof u.clone=="function"){const l=u.clone(0);l.inherited=!0,this.object.materials.push(l)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/3)*3},parseNormalIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/3)*3},parseUVIndex:function(o,c){const u=parseInt(o,10);return(u>=0?u-1:u+c/2)*2},addVertex:function(o,c,u){const l=this.vertices,d=this.object.geometry.vertices;d.push(l[o+0],l[o+1],l[o+2]),d.push(l[c+0],l[c+1],l[c+2]),d.push(l[u+0],l[u+1],l[u+2])},addVertexPoint:function(o){const c=this.vertices;this.object.geometry.vertices.push(c[o+0],c[o+1],c[o+2])},addVertexLine:function(o){const c=this.vertices;this.object.geometry.vertices.push(c[o+0],c[o+1],c[o+2])},addNormal:function(o,c,u){const l=this.normals,d=this.object.geometry.normals;d.push(l[o+0],l[o+1],l[o+2]),d.push(l[c+0],l[c+1],l[c+2]),d.push(l[u+0],l[u+1],l[u+2])},addFaceNormal:function(o,c,u){const l=this.vertices,d=this.object.geometry.normals;ln.fromArray(l,o),It.fromArray(l,c),cn.fromArray(l,u),et.subVectors(cn,It),dn.subVectors(ln,It),et.cross(dn),et.normalize(),d.push(et.x,et.y,et.z),d.push(et.x,et.y,et.z),d.push(et.x,et.y,et.z)},addColor:function(o,c,u){const l=this.colors,d=this.object.geometry.colors;l[o]!==void 0&&d.push(l[o+0],l[o+1],l[o+2]),l[c]!==void 0&&d.push(l[c+0],l[c+1],l[c+2]),l[u]!==void 0&&d.push(l[u+0],l[u+1],l[u+2])},addUV:function(o,c,u){const l=this.uvs,d=this.object.geometry.uvs;d.push(l[o+0],l[o+1]),d.push(l[c+0],l[c+1]),d.push(l[u+0],l[u+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 c=this.uvs;this.object.geometry.uvs.push(c[o+0],c[o+1])},addFace:function(o,c,u,l,d,v,p,_,k){const P=this.vertices.length;let F=this.parseVertexIndex(o,P),j=this.parseVertexIndex(c,P),b=this.parseVertexIndex(u,P);if(this.addVertex(F,j,b),this.addColor(F,j,b),p!==void 0&&p!==""){const h=this.normals.length;F=this.parseNormalIndex(p,h),j=this.parseNormalIndex(_,h),b=this.parseNormalIndex(k,h),this.addNormal(F,j,b)}else this.addFaceNormal(F,j,b);if(l!==void 0&&l!==""){const h=this.uvs.length;F=this.parseUVIndex(l,h),j=this.parseUVIndex(d,h),b=this.parseUVIndex(v,h),this.addUV(F,j,b),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(o){this.object.geometry.type="Points";const c=this.vertices.length;for(let u=0,l=o.length;u<l;u++){const d=this.parseVertexIndex(o[u],c);this.addVertexPoint(d),this.addColor(d)}},addLineGeometry:function(o,c){this.object.geometry.type="Line";const u=this.vertices.length,l=this.uvs.length;for(let d=0,v=o.length;d<v;d++)this.addVertexLine(this.parseVertexIndex(o[d],u));for(let d=0,v=c.length;d<v;d++)this.addUVLine(this.parseUVIndex(c[d],l))}};return V.startObject("",!1),V}class jt extends i.Loader{constructor(o){super(o),this.materials=null}load(o,c,u,l){const d=this,v=new i.FileLoader(this.manager);v.setPath(this.path),v.setRequestHeader(this.requestHeader),v.setWithCredentials(this.withCredentials),v.load(o,function(p){try{c(d.parse(p))}catch(_){l?l(_):console.error(_),d.manager.itemError(o)}},u,l)}setMaterials(o){return this.materials=o,this}parse(o){const c=new ho;o.indexOf(`\r
2
2
  `)!==-1&&(o=o.replace(/\r\n/g,`
3
3
  `)),o.indexOf(`\\
4
4
  `)!==-1&&(o=o.replace(/\\\n/g,""));const u=o.split(`
@@ -8,4 +8,4 @@
8
8
  `);for(let w=0,f=m.length;w<f;w++){if(m[w]==="")continue;const E=m[w].split(" ");if(b.x!==void 0&&(d.push(parseFloat(E[b.x])),d.push(parseFloat(E[b.y])),d.push(parseFloat(E[b.z]))),b.rgb!==void 0){const T=l.fields.findIndex(O=>O==="rgb"),x=l.type[T],y=parseFloat(E[b.rgb]);let B=y;if(x==="F"){const O=new Float32Array(1);O[0]=y,B=new Int32Array(O.buffer)[0]}const N=(B>>16&255)/255,S=(B>>8&255)/255,W=(B>>0&255)/255;P.setRGB(N,S,W,i.SRGBColorSpace),p.push(P.r,P.g,P.b)}b.normal_x!==void 0&&(v.push(parseFloat(E[b.normal_x])),v.push(parseFloat(E[b.normal_y])),v.push(parseFloat(E[b.normal_z]))),b.intensity!==void 0&&_.push(parseFloat(E[b.intensity])),b.label!==void 0&&k.push(parseInt(E[b.label]))}}if(l.data==="binary_compressed"){const b=new Uint32Array(o.slice(l.headerLen,l.headerLen+8)),h=b[0],A=b[1],m=c(new Uint8Array(o,l.headerLen+8,h),A),w=new DataView(m.buffer),f=l.offset;for(let E=0;E<l.points;E++){if(f.x!==void 0){const T=l.fields.indexOf("x"),x=l.fields.indexOf("y"),y=l.fields.indexOf("z");d.push(this._getDataView(w,l.points*f.x+l.size[T]*E,l.type[T],l.size[T])),d.push(this._getDataView(w,l.points*f.y+l.size[x]*E,l.type[x],l.size[x])),d.push(this._getDataView(w,l.points*f.z+l.size[y]*E,l.type[y],l.size[y]))}if(f.rgb!==void 0){const T=l.fields.indexOf("rgb"),x=w.getUint8(l.points*f.rgb+l.size[T]*E+2)/255,y=w.getUint8(l.points*f.rgb+l.size[T]*E+1)/255,B=w.getUint8(l.points*f.rgb+l.size[T]*E+0)/255;P.setRGB(x,y,B,i.SRGBColorSpace),p.push(P.r,P.g,P.b)}if(f.normal_x!==void 0){const T=l.fields.indexOf("normal_x"),x=l.fields.indexOf("normal_y"),y=l.fields.indexOf("normal_z");v.push(this._getDataView(w,l.points*f.normal_x+l.size[T]*E,l.type[T],l.size[T])),v.push(this._getDataView(w,l.points*f.normal_y+l.size[x]*E,l.type[x],l.size[x])),v.push(this._getDataView(w,l.points*f.normal_z+l.size[y]*E,l.type[y],l.size[y]))}if(f.intensity!==void 0){const T=l.fields.indexOf("intensity");_.push(this._getDataView(w,l.points*f.intensity+l.size[T]*E,l.type[T],l.size[T]))}if(f.label!==void 0){const T=l.fields.indexOf("label");k.push(w.getInt32(l.points*f.label+l.size[T]*E,this.littleEndian))}}}if(l.data==="binary"){const b=new DataView(o,l.headerLen),h=l.offset;for(let A=0,m=0;A<l.points;A++,m+=l.rowSize){if(h.x!==void 0){const w=l.fields.indexOf("x"),f=l.fields.indexOf("y"),E=l.fields.indexOf("z");d.push(this._getDataView(b,m+h.x,l.type[w],l.size[w])),d.push(this._getDataView(b,m+h.y,l.type[f],l.size[f])),d.push(this._getDataView(b,m+h.z,l.type[E],l.size[E]))}if(h.rgb!==void 0){const w=b.getUint8(m+h.rgb+2)/255,f=b.getUint8(m+h.rgb+1)/255,E=b.getUint8(m+h.rgb+0)/255;P.setRGB(w,f,E,i.SRGBColorSpace),p.push(P.r,P.g,P.b)}if(h.normal_x!==void 0){const w=l.fields.indexOf("normal_x"),f=l.fields.indexOf("normal_y"),E=l.fields.indexOf("normal_z");v.push(this._getDataView(b,m+h.normal_x,l.type[w],l.size[w])),v.push(this._getDataView(b,m+h.normal_y,l.type[f],l.size[f])),v.push(this._getDataView(b,m+h.normal_z,l.type[E],l.size[E]))}if(h.intensity!==void 0){const w=l.fields.indexOf("intensity");_.push(this._getDataView(b,m+h.intensity,l.type[w],l.size[w]))}h.label!==void 0&&k.push(b.getInt32(m+h.label,this.littleEndian))}}const F=new i.BufferGeometry;d.length>0&&F.setAttribute("position",new i.Float32BufferAttribute(d,3)),v.length>0&&F.setAttribute("normal",new i.Float32BufferAttribute(v,3)),p.length>0&&F.setAttribute("color",new i.Float32BufferAttribute(p,3)),_.length>0&&F.setAttribute("intensity",new i.Float32BufferAttribute(_,1)),k.length>0&&F.setAttribute("label",new i.Int32BufferAttribute(k,1)),F.computeBoundingSphere();const j=new i.PointsMaterial({size:.005});return p.length>0&&(j.vertexColors=!0),new i.Points(F,j)}}class un extends i.DataTextureLoader{constructor(o){super(o)}parse(o){function c(g){switch(g.image_type){case j:case A:if(g.colormap_length>256||g.colormap_size!==24||g.colormap_type!==1)throw new Error("THREE.TGALoader: Invalid type colormap data for indexed type.");break;case b:case h:case m:case w:if(g.colormap_type)throw new Error("THREE.TGALoader: Invalid type colormap data for colormap type.");break;case F:throw new Error("THREE.TGALoader: No data.");default:throw new Error("THREE.TGALoader: Invalid type "+g.image_type)}if(g.width<=0||g.height<=0)throw new Error("THREE.TGALoader: Invalid image size.");if(g.pixel_size!==8&&g.pixel_size!==16&&g.pixel_size!==24&&g.pixel_size!==32)throw new Error("THREE.TGALoader: Invalid pixel size "+g.pixel_size)}function u(g,K,oe,ce,ie){let X,R;const L=oe.pixel_size>>3,z=oe.width*oe.height*L;if(K&&(R=ie.subarray(ce,ce+=oe.colormap_length*(oe.colormap_size>>3))),g){X=new Uint8Array(z);let q,D,U,H=0;const he=new Uint8Array(L);for(;H<z;)if(q=ie[ce++],D=(q&127)+1,q&128){for(U=0;U<L;++U)he[U]=ie[ce++];for(U=0;U<D;++U)X.set(he,H+U*L);H+=L*D}else{for(D*=L,U=0;U<D;++U)X[H+U]=ie[ce++];H+=D}}else X=ie.subarray(ce,ce+=K?oe.width*oe.height:z);return{pixel_data:X,palettes:R}}function l(g,K,oe,ce,ie,X,R,L,z){const q=z;let D,U=0,H,he;const ke=W.width;for(he=K;he!==ce;he+=oe)for(H=ie;H!==R;H+=X,U++)D=L[U],g[(H+ke*he)*4+3]=255,g[(H+ke*he)*4+2]=q[D*3+0],g[(H+ke*he)*4+1]=q[D*3+1],g[(H+ke*he)*4+0]=q[D*3+2];return g}function d(g,K,oe,ce,ie,X,R,L){let z,q=0,D,U;const H=W.width;for(U=K;U!==ce;U+=oe)for(D=ie;D!==R;D+=X,q+=2)z=L[q+0]+(L[q+1]<<8),g[(D+H*U)*4+0]=(z&31744)>>7,g[(D+H*U)*4+1]=(z&992)>>2,g[(D+H*U)*4+2]=(z&31)<<3,g[(D+H*U)*4+3]=z&32768?0:255;return g}function v(g,K,oe,ce,ie,X,R,L){let z=0,q,D;const U=W.width;for(D=K;D!==ce;D+=oe)for(q=ie;q!==R;q+=X,z+=3)g[(q+U*D)*4+3]=255,g[(q+U*D)*4+2]=L[z+0],g[(q+U*D)*4+1]=L[z+1],g[(q+U*D)*4+0]=L[z+2];return g}function p(g,K,oe,ce,ie,X,R,L){let z=0,q,D;const U=W.width;for(D=K;D!==ce;D+=oe)for(q=ie;q!==R;q+=X,z+=4)g[(q+U*D)*4+2]=L[z+0],g[(q+U*D)*4+1]=L[z+1],g[(q+U*D)*4+0]=L[z+2],g[(q+U*D)*4+3]=L[z+3];return g}function _(g,K,oe,ce,ie,X,R,L){let z,q=0,D,U;const H=W.width;for(U=K;U!==ce;U+=oe)for(D=ie;D!==R;D+=X,q++)z=L[q],g[(D+H*U)*4+0]=z,g[(D+H*U)*4+1]=z,g[(D+H*U)*4+2]=z,g[(D+H*U)*4+3]=255;return g}function k(g,K,oe,ce,ie,X,R,L){let z=0,q,D;const U=W.width;for(D=K;D!==ce;D+=oe)for(q=ie;q!==R;q+=X,z+=2)g[(q+U*D)*4+0]=L[z+0],g[(q+U*D)*4+1]=L[z+0],g[(q+U*D)*4+2]=L[z+0],g[(q+U*D)*4+3]=L[z+1];return g}function P(g,K,oe,ce,ie){let X,R,L,z,q,D;switch((W.flags&f)>>E){default:case y:X=0,L=1,q=K,R=0,z=1,D=oe;break;case T:X=0,L=1,q=K,R=oe-1,z=-1,D=-1;break;case B:X=K-1,L=-1,q=-1,R=0,z=1,D=oe;break;case x:X=K-1,L=-1,q=-1,R=oe-1,z=-1,D=-1;break}if(ae)switch(W.pixel_size){case 8:_(g,R,z,D,X,L,q,ce);break;case 16:k(g,R,z,D,X,L,q,ce);break;default:throw new Error("THREE.TGALoader: Format not supported.")}else switch(W.pixel_size){case 8:l(g,R,z,D,X,L,q,ce,ie);break;case 16:d(g,R,z,D,X,L,q,ce);break;case 24:v(g,R,z,D,X,L,q,ce);break;case 32:p(g,R,z,D,X,L,q,ce);break;default:throw new Error("THREE.TGALoader: Format not supported.")}return g}const F=0,j=1,b=2,h=3,A=9,m=10,w=11,f=48,E=4,T=0,x=1,y=2,B=3;if(o.length<19)throw new Error("THREE.TGALoader: Not enough data to contain header.");let N=0;const S=new Uint8Array(o),W={id_length:S[N++],colormap_type:S[N++],image_type:S[N++],colormap_index:S[N++]|S[N++]<<8,colormap_length:S[N++]|S[N++]<<8,colormap_size:S[N++],origin:[S[N++]|S[N++]<<8,S[N++]|S[N++]<<8],width:S[N++]|S[N++]<<8,height:S[N++]|S[N++]<<8,pixel_size:S[N++],flags:S[N++]};if(c(W),W.id_length+N>o.length)throw new Error("THREE.TGALoader: No data.");N+=W.id_length;let O=!1,$=!1,ae=!1;switch(W.image_type){case A:O=!0,$=!0;break;case j:$=!0;break;case m:O=!0;break;case b:break;case w:O=!0,ae=!0;break;case h:ae=!0;break}const me=new Uint8Array(W.width*W.height*4),G=u(O,$,W,N,S);return P(me,W.width,W.height,G.pixel_data,G.palettes),{data:me,width:W.width,height:W.height,flipY:!0,generateMipmaps:!0,minFilter:i.LinearMipmapLinearFilter}}}class mo extends i.Loader{load(o,c,u,l){const d=this,v=d.path===""?i.LoaderUtils.extractUrlBase(o):d.path,p=new i.FileLoader(d.manager);p.setPath(d.path),p.setRequestHeader(d.requestHeader),p.setWithCredentials(d.withCredentials),p.load(o,function(_){try{c(d.parse(_,v))}catch(k){l?l(k):console.error(k),d.manager.itemError(o)}},u,l)}parse(o,c){function u(n,t){const a=[],s=n.childNodes;for(let r=0,C=s.length;r<C;r++){const M=s[r];M.nodeName===t&&a.push(M)}return a}function l(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),a=new Array(t.length);for(let s=0,r=t.length;s<r;s++)a[s]=t[s];return a}function d(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),a=new Array(t.length);for(let s=0,r=t.length;s<r;s++)a[s]=parseFloat(t[s]);return a}function v(n){if(n.length===0)return[];const t=n.trim().split(/\s+/),a=new Array(t.length);for(let s=0,r=t.length;s<r;s++)a[s]=parseInt(t[s]);return a}function p(n){return n.substring(1)}function _(){return"three_default_"+Un++}function k(n){return Object.keys(n).length===0}function P(n){return{unit:F(u(n,"unit")[0]),upAxis:j(u(n,"up_axis")[0])}}function F(n){return n!==void 0&&n.hasAttribute("meter")===!0?parseFloat(n.getAttribute("meter")):1}function j(n){return n!==void 0?n.textContent:"Y_UP"}function b(n,t,a,s){const r=u(n,t)[0];if(r!==void 0){const C=u(r,a);for(let M=0;M<C.length;M++)s(C[M])}}function h(n,t){for(const a in n){const s=n[a];s.build=t(n[a])}}function A(n,t){return n.build!==void 0||(n.build=t(n)),n.build}function m(n){const t={sources:{},samplers:{},channels:{}};let a=!1;for(let s=0,r=n.childNodes.length;s<r;s++){const C=n.childNodes[s];if(C.nodeType!==1)continue;let M;switch(C.nodeName){case"source":M=C.getAttribute("id"),t.sources[M]=Ce(C);break;case"sampler":M=C.getAttribute("id"),t.samplers[M]=w(C);break;case"channel":M=C.getAttribute("target"),t.channels[M]=f(C);break;case"animation":m(C),a=!0;break;default:console.log(C)}}a===!1&&(re.animations[n.getAttribute("id")||i.MathUtils.generateUUID()]=t)}function w(n){const t={inputs:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"input":const C=p(r.getAttribute("source")),M=r.getAttribute("semantic");t.inputs[M]=C;break}}return t}function f(n){const t={};let s=n.getAttribute("target").split("/");const r=s.shift();let C=s.shift();const M=C.indexOf("(")!==-1,J=C.indexOf(".")!==-1;if(J)s=C.split("."),C=s.shift(),t.member=s.shift();else if(M){const Y=C.split("(");C=Y.shift();for(let Z=0;Z<Y.length;Z++)Y[Z]=parseInt(Y[Z].replace(/\)/,""));t.indices=Y}return t.id=r,t.sid=C,t.arraySyntax=M,t.memberSyntax=J,t.sampler=p(n.getAttribute("source")),t}function E(n){const t=[],a=n.channels,s=n.samplers,r=n.sources;for(const C in a)if(a.hasOwnProperty(C)){const M=a[C],J=s[M.sampler],Y=J.inputs.INPUT,Z=J.inputs.OUTPUT,te=r[Y],I=r[Z],ee=x(M,te,I);W(ee,t)}return t}function T(n){return A(re.animations[n],E)}function x(n,t,a){const s=re.nodes[n.id],r=xt(s.id),C=s.transforms[n.sid],M=s.matrix.clone().transpose();let J,Y,Z,te,I,ee;const Q={};switch(C){case"matrix":for(Z=0,te=t.array.length;Z<te;Z++)if(J=t.array[Z],Y=Z*a.stride,Q[J]===void 0&&(Q[J]={}),n.arraySyntax===!0){const Le=a.array[Y],ve=n.indices[0]+4*n.indices[1];Q[J][ve]=Le}else for(I=0,ee=a.stride;I<ee;I++)Q[J][I]=a.array[Y+I];break;case"translate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',C);break;case"rotate":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',C);break;case"scale":console.warn('THREE.ColladaLoader: Animation transform type "%s" not yet implemented.',C);break}const se=y(Q,M);return{name:r.uuid,keyframes:se}}function y(n,t){const a=[];for(const r in n)a.push({time:parseFloat(r),value:n[r]});a.sort(s);for(let r=0;r<16;r++)O(a,r,t.elements[r]);return a;function s(r,C){return r.time-C.time}}const B=new i.Vector3,N=new i.Vector3,S=new i.Quaternion;function W(n,t){const a=n.keyframes,s=n.name,r=[],C=[],M=[],J=[];for(let Y=0,Z=a.length;Y<Z;Y++){const te=a[Y],I=te.time,ee=te.value;Qe.fromArray(ee).transpose(),Qe.decompose(B,S,N),r.push(I),C.push(B.x,B.y,B.z),M.push(S.x,S.y,S.z,S.w),J.push(N.x,N.y,N.z)}return C.length>0&&t.push(new i.VectorKeyframeTrack(s+".position",r,C)),M.length>0&&t.push(new i.QuaternionKeyframeTrack(s+".quaternion",r,M)),J.length>0&&t.push(new i.VectorKeyframeTrack(s+".scale",r,J)),t}function O(n,t,a){let s,r=!0,C,M;for(C=0,M=n.length;C<M;C++)s=n[C],s.value[t]===void 0?s.value[t]=null:r=!1;if(r===!0)for(C=0,M=n.length;C<M;C++)s=n[C],s.value[t]=a;else $(n,t)}function $(n,t){let a,s;for(let r=0,C=n.length;r<C;r++){const M=n[r];if(M.value[t]===null){if(a=ae(n,r,t),s=me(n,r,t),a===null){M.value[t]=s.value[t];continue}if(s===null){M.value[t]=a.value[t];continue}G(M,a,s,t)}}}function ae(n,t,a){for(;t>=0;){const s=n[t];if(s.value[a]!==null)return s;t--}return null}function me(n,t,a){for(;t<n.length;){const s=n[t];if(s.value[a]!==null)return s;t++}return null}function G(n,t,a,s){if(a.time-t.time===0){n.value[s]=t.value[s];return}n.value[s]=(n.time-t.time)*(a.value[s]-t.value[s])/(a.time-t.time)+t.value[s]}function g(n){const t={name:n.getAttribute("id")||"default",start:parseFloat(n.getAttribute("start")||0),end:parseFloat(n.getAttribute("end")||0),animations:[]};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"instance_animation":t.animations.push(p(r.getAttribute("url")));break}}re.clips[n.getAttribute("id")]=t}function K(n){const t=[],a=n.name,s=n.end-n.start||-1,r=n.animations;for(let C=0,M=r.length;C<M;C++){const J=T(r[C]);for(let Y=0,Z=J.length;Y<Z;Y++)t.push(J[Y])}return new i.AnimationClip(a,s,t)}function oe(n){return A(re.clips[n],K)}function ce(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"skin":t.id=p(r.getAttribute("source")),t.skin=ie(r);break;case"morph":t.id=p(r.getAttribute("source")),console.warn("THREE.ColladaLoader: Morph target animation not supported yet.");break}}re.controllers[n.getAttribute("id")]=t}function ie(n){const t={sources:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"bind_shape_matrix":t.bindShapeMatrix=d(r.textContent);break;case"source":const C=r.getAttribute("id");t.sources[C]=Ce(r);break;case"joints":t.joints=X(r);break;case"vertex_weights":t.vertexWeights=R(r);break}}return t}function X(n){const t={inputs:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"input":const C=r.getAttribute("semantic"),M=p(r.getAttribute("source"));t.inputs[C]=M;break}}return t}function R(n){const t={inputs:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"input":const C=r.getAttribute("semantic"),M=p(r.getAttribute("source")),J=parseInt(r.getAttribute("offset"));t.inputs[C]={id:M,offset:J};break;case"vcount":t.vcount=v(r.textContent);break;case"v":t.v=v(r.textContent);break}}return t}function L(n){const t={id:n.id},a=re.geometries[t.id];return n.skin!==void 0&&(t.skin=z(n.skin),a.sources.skinIndices=t.skin.indices,a.sources.skinWeights=t.skin.weights),t}function z(n){const a={joints:[],indices:{array:[],stride:4},weights:{array:[],stride:4}},s=n.sources,r=n.vertexWeights,C=r.vcount,M=r.v,J=r.inputs.JOINT.offset,Y=r.inputs.WEIGHT.offset,Z=n.sources[n.joints.inputs.JOINT],te=n.sources[n.joints.inputs.INV_BIND_MATRIX],I=s[r.inputs.WEIGHT.id].array;let ee=0,Q,se,ne;for(Q=0,ne=C.length;Q<ne;Q++){const ve=C[Q],we=[];for(se=0;se<ve;se++){const _e=M[ee+J],lt=M[ee+Y],Ke=I[lt];we.push({index:_e,weight:Ke}),ee+=2}for(we.sort(Le),se=0;se<4;se++){const _e=we[se];_e!==void 0?(a.indices.array.push(_e.index),a.weights.array.push(_e.weight)):(a.indices.array.push(0),a.weights.array.push(0))}}for(n.bindShapeMatrix?a.bindMatrix=new i.Matrix4().fromArray(n.bindShapeMatrix).transpose():a.bindMatrix=new i.Matrix4().identity(),Q=0,ne=Z.array.length;Q<ne;Q++){const ve=Z.array[Q],we=new i.Matrix4().fromArray(te.array,Q*te.stride).transpose();a.joints.push({name:ve,boneInverse:we})}return a;function Le(ve,we){return we.weight-ve.weight}}function q(n){return A(re.controllers[n],L)}function D(n){const t={init_from:u(n,"init_from")[0].textContent};re.images[n.getAttribute("id")]=t}function U(n){return n.build!==void 0?n.build:n.init_from}function H(n){const t=re.images[n];return t!==void 0?A(t,U):(console.warn("THREE.ColladaLoader: Couldn't find image with ID:",n),null)}function he(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"profile_COMMON":t.profile=ke(r);break}}re.effects[n.getAttribute("id")]=t}function ke(n){const t={surfaces:{},samplers:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"newparam":le(r,t);break;case"technique":t.technique=De(r);break;case"extra":t.extra=Je(r);break}}return t}function le(n,t){const a=n.getAttribute("sid");for(let s=0,r=n.childNodes.length;s<r;s++){const C=n.childNodes[s];if(C.nodeType===1)switch(C.nodeName){case"surface":t.surfaces[a]=Ae(C);break;case"sampler2D":t.samplers[a]=Re(C);break}}}function Ae(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"init_from":t.init_from=r.textContent;break}}return t}function Re(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"source":t.source=r.textContent;break}}return t}function De(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"constant":case"lambert":case"blinn":case"phong":t.type=r.nodeName,t.parameters=ze(r);break;case"extra":t.extra=Je(r);break}}return t}function ze(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"emission":case"diffuse":case"specular":case"bump":case"ambient":case"shininess":case"transparency":t[r.nodeName]=Se(r);break;case"transparent":t[r.nodeName]={opaque:r.hasAttribute("opaque")?r.getAttribute("opaque"):"A_ONE",data:Se(r)};break}}return t}function Se(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"color":t[r.nodeName]=d(r.textContent);break;case"float":t[r.nodeName]=parseFloat(r.textContent);break;case"texture":t[r.nodeName]={id:r.getAttribute("texture"),extra:de(r)};break}}return t}function de(n){const t={technique:{}};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"extra":qe(r,t);break}}return t}function qe(n,t){for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"technique":Ye(r,t);break}}}function Ye(n,t){for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"repeatU":case"repeatV":case"offsetU":case"offsetV":t.technique[r.nodeName]=parseFloat(r.textContent);break;case"wrapU":case"wrapV":r.textContent.toUpperCase()==="TRUE"?t.technique[r.nodeName]=1:r.textContent.toUpperCase()==="FALSE"?t.technique[r.nodeName]=0:t.technique[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=nt(r);break}}}function Je(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"technique":t.technique=st(r);break}}return t}function st(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"double_sided":t[r.nodeName]=parseInt(r.textContent);break;case"bump":t[r.nodeName]=nt(r);break}}return t}function nt(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"texture":t[r.nodeName]={id:r.getAttribute("texture"),texcoord:r.getAttribute("texcoord"),extra:de(r)};break}}return t}function We(n){return n}function Me(n){return A(re.effects[n],We)}function Be(n){const t={name:n.getAttribute("name")};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"instance_effect":t.url=p(r.getAttribute("url"));break}}re.materials[n.getAttribute("id")]=t}function Ee(n){let t,a=n.slice((n.lastIndexOf(".")-1>>>0)+2);switch(a=a.toLowerCase(),a){case"tga":t=Rt;break;default:t=tn}return t}function dt(n){const t=Me(n.url),a=t.profile.technique;let s;switch(a.type){case"phong":case"blinn":s=new i.MeshPhongMaterial;break;case"lambert":s=new i.MeshLambertMaterial;break;default:s=new i.MeshBasicMaterial;break}s.name=n.name||"";function r(Y,Z=null){const te=t.profile.samplers[Y.id];let I=null;if(te!==void 0){const ee=t.profile.surfaces[te.source];I=H(ee.init_from)}else console.warn("THREE.ColladaLoader: Undefined sampler. Access image directly (see #12530)."),I=H(Y.id);if(I!==null){const ee=Ee(I);if(ee!==void 0){const Q=ee.load(I),se=Y.extra;if(se!==void 0&&se.technique!==void 0&&k(se.technique)===!1){const ne=se.technique;Q.wrapS=ne.wrapU?i.RepeatWrapping:i.ClampToEdgeWrapping,Q.wrapT=ne.wrapV?i.RepeatWrapping:i.ClampToEdgeWrapping,Q.offset.set(ne.offsetU||0,ne.offsetV||0),Q.repeat.set(ne.repeatU||1,ne.repeatV||1)}else Q.wrapS=i.RepeatWrapping,Q.wrapT=i.RepeatWrapping;return Z!==null&&(Q.colorSpace=Z),Q}else return console.warn("THREE.ColladaLoader: Loader for texture %s not found.",I),null}else return console.warn("THREE.ColladaLoader: Couldn't create texture with ID:",Y.id),null}const C=a.parameters;for(const Y in C){const Z=C[Y];switch(Y){case"diffuse":Z.color&&s.color.fromArray(Z.color),Z.texture&&(s.map=r(Z.texture,i.SRGBColorSpace));break;case"specular":Z.color&&s.specular&&s.specular.fromArray(Z.color),Z.texture&&(s.specularMap=r(Z.texture));break;case"bump":Z.texture&&(s.normalMap=r(Z.texture));break;case"ambient":Z.texture&&(s.lightMap=r(Z.texture,i.SRGBColorSpace));break;case"shininess":Z.float&&s.shininess&&(s.shininess=Z.float);break;case"emission":Z.color&&s.emissive&&s.emissive.fromArray(Z.color),Z.texture&&(s.emissiveMap=r(Z.texture,i.SRGBColorSpace));break}}i.ColorManagement.colorSpaceToWorking(s.color,i.SRGBColorSpace),s.specular&&i.ColorManagement.colorSpaceToWorking(s.specular,i.SRGBColorSpace),s.emissive&&i.ColorManagement.colorSpaceToWorking(s.emissive,i.SRGBColorSpace);let M=C.transparent,J=C.transparency;if(J===void 0&&M&&(J={float:1}),M===void 0&&J&&(M={opaque:"A_ONE",data:{color:[1,1,1,1]}}),M&&J)if(M.data.texture)s.transparent=!0;else{const Y=M.data.color;switch(M.opaque){case"A_ONE":s.opacity=Y[3]*J.float;break;case"RGB_ZERO":s.opacity=1-Y[0]*J.float;break;case"A_ZERO":s.opacity=1-Y[3]*J.float;break;case"RGB_ONE":s.opacity=Y[0]*J.float;break;default:console.warn('THREE.ColladaLoader: Invalid opaque type "%s" of transparent tag.',M.opaque)}s.opacity<1&&(s.transparent=!0)}if(a.extra!==void 0&&a.extra.technique!==void 0){const Y=a.extra.technique;for(const Z in Y){const te=Y[Z];switch(Z){case"double_sided":s.side=te===1?i.DoubleSide:i.FrontSide;break;case"bump":s.normalMap=r(te.texture),s.normalScale=new i.Vector2(1,1);break}}}return s}function Xe(n){return A(re.materials[n],dt)}function Fe(n){const t={name:n.getAttribute("name")};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"optics":t.optics=ge(r);break}}re.cameras[n.getAttribute("id")]=t}function ge(n){for(let t=0;t<n.childNodes.length;t++){const a=n.childNodes[t];switch(a.nodeName){case"technique_common":return $e(a)}}return{}}function $e(n){const t={};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];switch(s.nodeName){case"perspective":case"orthographic":t.technique=s.nodeName,t.parameters=ut(s);break}}return t}function ut(n){const t={};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];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 Ne(n){let t;switch(n.optics.technique){case"perspective":t=new i.PerspectiveCamera(n.optics.parameters.yfov,n.optics.parameters.aspect_ratio,n.optics.parameters.znear,n.optics.parameters.zfar);break;case"orthographic":let a=n.optics.parameters.ymag,s=n.optics.parameters.xmag;const r=n.optics.parameters.aspect_ratio;s=s===void 0?a*r:s,a=a===void 0?s/r:a,s*=.5,a*=.5,t=new i.OrthographicCamera(-s,s,a,-a,n.optics.parameters.znear,n.optics.parameters.zfar);break;default:t=new i.PerspectiveCamera;break}return t.name=n.name||"",t}function it(n){const t=re.cameras[n];return t!==void 0?A(t,Ne):(console.warn("THREE.ColladaLoader: Couldn't find camera with ID:",n),null)}function yt(n){let t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"technique_common":t=bt(r);break}}re.lights[n.getAttribute("id")]=t}function bt(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"directional":case"point":case"spot":case"ambient":t.technique=r.nodeName,t.parameters=Ie(r)}}return t}function Ie(n){const t={};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"color":const C=d(r.textContent);t.color=new i.Color().fromArray(C),i.ColorManagement.colorSpaceToWorking(t.color,i.SRGBColorSpace);break;case"falloff_angle":t.falloffAngle=parseFloat(r.textContent);break;case"quadratic_attenuation":const M=parseFloat(r.textContent);t.distance=M?Math.sqrt(1/M):0;break}}return t}function xe(n){let t;switch(n.technique){case"directional":t=new i.DirectionalLight;break;case"point":t=new i.PointLight;break;case"spot":t=new i.SpotLight;break;case"ambient":t=new i.AmbientLight;break}return n.parameters.color&&t.color.copy(n.parameters.color),n.parameters.distance&&(t.distance=n.parameters.distance),t}function ot(n){const t=re.lights[n];return t!==void 0?A(t,xe):(console.warn("THREE.ColladaLoader: Couldn't find light with ID:",n),null)}function fe(n){const t={name:n.getAttribute("name"),sources:{},vertices:{},primitives:[]},a=u(n,"mesh")[0];if(a!==void 0){for(let s=0;s<a.childNodes.length;s++){const r=a.childNodes[s];if(r.nodeType!==1)continue;const C=r.getAttribute("id");switch(r.nodeName){case"source":t.sources[C]=Ce(r);break;case"vertices":t.vertices=Ge(r);break;case"polygons":console.warn("THREE.ColladaLoader: Unsupported primitive type: ",r.nodeName);break;case"lines":case"linestrips":case"polylist":case"triangles":t.primitives.push(Pe(r));break;default:console.log(r)}}re.geometries[n.getAttribute("id")]=t}}function Ce(n){const t={array:[],stride:3};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"float_array":t.array=d(s.textContent);break;case"Name_array":t.array=l(s.textContent);break;case"technique_common":const r=u(s,"accessor")[0];r!==void 0&&(t.stride=parseInt(r.getAttribute("stride")));break}}return t}function Ge(n){const t={};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];s.nodeType===1&&(t[s.getAttribute("semantic")]=p(s.getAttribute("source")))}return t}function Pe(n){const t={type:n.nodeName,material:n.getAttribute("material"),count:parseInt(n.getAttribute("count")),inputs:{},stride:0,hasUV:!1};for(let a=0,s=n.childNodes.length;a<s;a++){const r=n.childNodes[a];if(r.nodeType===1)switch(r.nodeName){case"input":const C=p(r.getAttribute("source")),M=r.getAttribute("semantic"),J=parseInt(r.getAttribute("offset")),Y=parseInt(r.getAttribute("set")),Z=Y>0?M+Y:M;t.inputs[Z]={id:C,offset:J},t.stride=Math.max(t.stride,J+1),M==="TEXCOORD"&&(t.hasUV=!0);break;case"vcount":t.vcount=v(r.textContent);break;case"p":t.p=v(r.textContent);break}}return t}function be(n){const t={};for(let a=0;a<n.length;a++){const s=n[a];t[s.type]===void 0&&(t[s.type]=[]),t[s.type].push(s)}return t}function je(n){let t=0;for(let a=0,s=n.length;a<s;a++)n[a].hasUV===!0&&t++;t>0&&t<n.length&&(n.uvsNeedsFix=!0)}function Ve(n){const t={},a=n.sources,s=n.vertices,r=n.primitives;if(r.length===0)return{};const C=be(r);for(const M in C){const J=C[M];je(J),t[M]=at(J,a,s)}return t}function at(n,t,a){const s={},r={array:[],stride:0},C={array:[],stride:0},M={array:[],stride:0},J={array:[],stride:0},Y={array:[],stride:0},Z={array:[],stride:4},te={array:[],stride:4},I=new i.BufferGeometry,ee=[];let Q=0;for(let se=0;se<n.length;se++){const ne=n[se],Le=ne.inputs;let ve=0;switch(ne.type){case"lines":case"linestrips":ve=ne.count*2;break;case"triangles":ve=ne.count*3;break;case"polylist":for(let we=0;we<ne.count;we++){const _e=ne.vcount[we];switch(_e){case 3:ve+=3;break;case 4:ve+=6;break;default:ve+=(_e-2)*3;break}}break;default:console.warn("THREE.ColladaLoader: Unknown primitive type:",ne.type)}I.addGroup(Q,ve,se),Q+=ve,ne.material&&ee.push(ne.material);for(const we in Le){const _e=Le[we];switch(we){case"VERTEX":for(const lt in a){const Ke=a[lt];switch(lt){case"POSITION":const Ct=r.array.length;if(He(ne,t[Ke],_e.offset,r.array),r.stride=t[Ke].stride,t.skinWeights&&t.skinIndices&&(He(ne,t.skinIndices,_e.offset,Z.array),He(ne,t.skinWeights,_e.offset,te.array)),ne.hasUV===!1&&n.uvsNeedsFix===!0){const zn=(r.array.length-Ct)/r.stride;for(let on=0;on<zn;on++)M.array.push(0,0)}break;case"NORMAL":He(ne,t[Ke],_e.offset,C.array),C.stride=t[Ke].stride;break;case"COLOR":He(ne,t[Ke],_e.offset,Y.array),Y.stride=t[Ke].stride;break;case"TEXCOORD":He(ne,t[Ke],_e.offset,M.array),M.stride=t[Ke].stride;break;case"TEXCOORD1":He(ne,t[Ke],_e.offset,J.array),M.stride=t[Ke].stride;break;default:console.warn('THREE.ColladaLoader: Semantic "%s" not handled in geometry build process.',lt)}}break;case"NORMAL":He(ne,t[_e.id],_e.offset,C.array),C.stride=t[_e.id].stride;break;case"COLOR":He(ne,t[_e.id],_e.offset,Y.array,!0),Y.stride=t[_e.id].stride;break;case"TEXCOORD":He(ne,t[_e.id],_e.offset,M.array),M.stride=t[_e.id].stride;break;case"TEXCOORD1":He(ne,t[_e.id],_e.offset,J.array),J.stride=t[_e.id].stride;break}}}return r.array.length>0&&I.setAttribute("position",new i.Float32BufferAttribute(r.array,r.stride)),C.array.length>0&&I.setAttribute("normal",new i.Float32BufferAttribute(C.array,C.stride)),Y.array.length>0&&I.setAttribute("color",new i.Float32BufferAttribute(Y.array,Y.stride)),M.array.length>0&&I.setAttribute("uv",new i.Float32BufferAttribute(M.array,M.stride)),J.array.length>0&&I.setAttribute("uv1",new i.Float32BufferAttribute(J.array,J.stride)),Z.array.length>0&&I.setAttribute("skinIndex",new i.Float32BufferAttribute(Z.array,Z.stride)),te.array.length>0&&I.setAttribute("skinWeight",new i.Float32BufferAttribute(te.array,te.stride)),s.data=I,s.type=n[0].type,s.materialKeys=ee,s}function He(n,t,a,s,r=!1){const C=n.p,M=n.stride,J=n.vcount;function Y(I){let ee=C[I+a]*te;const Q=ee+te;for(;ee<Q;ee++)s.push(Z[ee]);if(r){const se=s.length-te-1;Nt.setRGB(s[se+0],s[se+1],s[se+2],i.SRGBColorSpace),s[se+0]=Nt.r,s[se+1]=Nt.g,s[se+2]=Nt.b}}const Z=t.array,te=t.stride;if(n.vcount!==void 0){let I=0;for(let ee=0,Q=J.length;ee<Q;ee++){const se=J[ee];if(se===4){const ne=I+M*0,Le=I+M*1,ve=I+M*2,we=I+M*3;Y(ne),Y(Le),Y(we),Y(Le),Y(ve),Y(we)}else if(se===3){const ne=I+M*0,Le=I+M*1,ve=I+M*2;Y(ne),Y(Le),Y(ve)}else if(se>4)for(let ne=1,Le=se-2;ne<=Le;ne++){const ve=I+M*0,we=I+M*ne,_e=I+M*(ne+1);Y(ve),Y(we),Y(_e)}I+=M*se}}else for(let I=0,ee=C.length;I<ee;I+=M)Y(I)}function ht(n){return A(re.geometries[n],Ve)}function pt(n){const t={name:n.getAttribute("name")||"",joints:{},links:[]};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"technique_common":Tt(s,t);break}}re.kinematicsModels[n.getAttribute("id")]=t}function ft(n){return n.build!==void 0?n.build:n}function rt(n){return A(re.kinematicsModels[n],ft)}function Tt(n,t){for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"joint":t.joints[s.getAttribute("sid")]=bn(s);break;case"link":t.links.push(qt(s));break}}}function bn(n){let t;for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"prismatic":case"revolute":t=wn(s);break}}return t}function wn(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",axis:new i.Vector3,limits:{min:0,max:0},type:n.nodeName,static:!1,zeroPosition:0,middlePosition:0};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"axis":const r=d(s.textContent);t.axis.fromArray(r);break;case"limits":const C=s.getElementsByTagName("max")[0],M=s.getElementsByTagName("min")[0];t.limits.max=parseFloat(C.textContent),t.limits.min=parseFloat(M.textContent);break}}return t.limits.min>=t.limits.max&&(t.static=!0),t.middlePosition=(t.limits.min+t.limits.max)/2,t}function qt(n){const t={sid:n.getAttribute("sid"),name:n.getAttribute("name")||"",attachments:[],transforms:[]};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"attachment_full":t.attachments.push(_n(s));break;case"matrix":case"translate":case"rotate":t.transforms.push($t(s));break}}return t}function _n(n){const t={joint:n.getAttribute("joint").split("/").pop(),transforms:[],links:[]};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"link":t.links.push(qt(s));break;case"matrix":case"translate":case"rotate":t.transforms.push($t(s));break}}return t}function $t(n){const t={type:n.nodeName},a=d(n.textContent);switch(t.type){case"matrix":t.obj=new i.Matrix4,t.obj.fromArray(a).transpose();break;case"translate":t.obj=new i.Vector3,t.obj.fromArray(a);break;case"rotate":t.obj=new i.Vector3,t.obj.fromArray(a),t.angle=i.MathUtils.degToRad(a[3]);break}return t}function kn(n){const t={name:n.getAttribute("name")||"",rigidBodies:{}};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"rigid_body":t.rigidBodies[s.getAttribute("name")]={},xn(s,t.rigidBodies[s.getAttribute("name")]);break}}re.physicsModels[n.getAttribute("id")]=t}function xn(n,t){for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"technique_common":Cn(s,t);break}}}function Cn(n,t){for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];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 vn(n){const t={bindJointAxis:[]};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"bind_joint_axis":t.bindJointAxis.push(En(s));break}}re.kinematicsScenes[p(n.getAttribute("url"))]=t}function En(n){const t={target:n.getAttribute("target").split("/").pop()};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType===1)switch(s.nodeName){case"axis":const r=s.getElementsByTagName("param")[0];t.axis=r.textContent;const C=t.axis.split("inst_").pop().split("axis")[0];t.jointIndex=C.substring(0,C.length-1);break}}return t}function Tn(n){return n.build!==void 0?n.build:n}function Nn(n){return A(re.kinematicsScenes[n],Tn)}function An(){const n=Object.keys(re.kinematicsModels)[0],t=Object.keys(re.kinematicsScenes)[0],a=Object.keys(re.visualScenes)[0];if(n===void 0||t===void 0)return;const s=rt(n),r=Nn(t),C=Xt(a),M=r.bindJointAxis,J={};for(let te=0,I=M.length;te<I;te++){const ee=M[te],Q=Oe.querySelector('[sid="'+ee.target+'"]');if(Q){const se=Q.parentElement;Y(ee.jointIndex,se)}}function Y(te,I){const ee=I.getAttribute("name"),Q=s.joints[te];C.traverse(function(se){se.name===ee&&(J[te]={object:se,transforms:Mn(I),joint:Q,position:Q.zeroPosition})})}const Z=new i.Matrix4;nn={joints:s&&s.joints,getJointValue:function(te){const I=J[te];if(I)return I.position;console.warn("THREE.ColladaLoader: Joint "+te+" doesn't exist.")},setJointValue:function(te,I){const ee=J[te];if(ee){const Q=ee.joint;if(I>Q.limits.max||I<Q.limits.min)console.warn("THREE.ColladaLoader: Joint "+te+" value "+I+" 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 se=ee.object,ne=Q.axis,Le=ee.transforms;Qe.identity();for(let ve=0;ve<Le.length;ve++){const we=Le[ve];if(we.sid&&we.sid.indexOf(te)!==-1)switch(Q.type){case"revolute":Qe.multiply(Z.makeRotationAxis(ne,i.MathUtils.degToRad(I)));break;case"prismatic":Qe.multiply(Z.makeTranslation(ne.x*I,ne.y*I,ne.z*I));break;default:console.warn("THREE.ColladaLoader: Unknown joint type: "+Q.type);break}else switch(we.type){case"matrix":Qe.multiply(we.obj);break;case"translate":Qe.multiply(Z.makeTranslation(we.obj.x,we.obj.y,we.obj.z));break;case"scale":Qe.scale(we.obj);break;case"rotate":Qe.multiply(Z.makeRotationAxis(we.obj,we.angle));break}}se.matrix.copy(Qe),se.matrix.decompose(se.position,se.quaternion,se.scale),J[te].position=I}}else console.log("THREE.ColladaLoader: "+te+" does not exist.")}}}function Mn(n){const t=[],a=Oe.querySelector('[id="'+n.id+'"]');for(let s=0;s<a.childNodes.length;s++){const r=a.childNodes[s];if(r.nodeType!==1)continue;let C,M;switch(r.nodeName){case"matrix":C=d(r.textContent);const J=new i.Matrix4().fromArray(C).transpose();t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:J});break;case"translate":case"scale":C=d(r.textContent),M=new i.Vector3().fromArray(C),t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:M});break;case"rotate":C=d(r.textContent),M=new i.Vector3().fromArray(C);const Y=i.MathUtils.degToRad(C[3]);t.push({sid:r.getAttribute("sid"),type:r.nodeName,obj:M,angle:Y});break}}return t}function Sn(n){const t=n.getElementsByTagName("node");for(let a=0;a<t.length;a++){const s=t[a];s.hasAttribute("id")===!1&&s.setAttribute("id",_())}}const Qe=new i.Matrix4,kt=new i.Vector3;function Bt(n){const t={name:n.getAttribute("name")||"",type:n.getAttribute("type"),id:n.getAttribute("id"),sid:n.getAttribute("sid"),matrix:new i.Matrix4,nodes:[],instanceCameras:[],instanceControllers:[],instanceLights:[],instanceGeometries:[],instanceNodes:[],transforms:{}};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];if(s.nodeType!==1)continue;let r;switch(s.nodeName){case"node":t.nodes.push(s.getAttribute("id")),Bt(s);break;case"instance_camera":t.instanceCameras.push(p(s.getAttribute("url")));break;case"instance_controller":t.instanceControllers.push(Yt(s));break;case"instance_light":t.instanceLights.push(p(s.getAttribute("url")));break;case"instance_geometry":t.instanceGeometries.push(Yt(s));break;case"instance_node":t.instanceNodes.push(p(s.getAttribute("url")));break;case"matrix":r=d(s.textContent),t.matrix.multiply(Qe.fromArray(r).transpose()),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"translate":r=d(s.textContent),kt.fromArray(r),t.matrix.multiply(Qe.makeTranslation(kt.x,kt.y,kt.z)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"rotate":r=d(s.textContent);const C=i.MathUtils.degToRad(r[3]);t.matrix.multiply(Qe.makeRotationAxis(kt.fromArray(r),C)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"scale":r=d(s.textContent),t.matrix.scale(kt.fromArray(r)),t.transforms[s.getAttribute("sid")]=s.nodeName;break;case"extra":break;default:console.log(s)}}return Zt(t.id)?console.warn("THREE.ColladaLoader: There is already a node with ID %s. Exclude current node from further processing.",t.id):re.nodes[t.id]=t,t}function Yt(n){const t={id:p(n.getAttribute("url")),materials:{},skeletons:[]};for(let a=0;a<n.childNodes.length;a++){const s=n.childNodes[a];switch(s.nodeName){case"bind_material":const r=s.getElementsByTagName("instance_material");for(let C=0;C<r.length;C++){const M=r[C],J=M.getAttribute("symbol"),Y=M.getAttribute("target");t.materials[J]=p(Y)}break;case"skeleton":t.skeletons.push(p(s.textContent));break}}return t}function Pn(n,t){const a=[],s=[];let r,C,M;for(r=0;r<n.length;r++){const Z=n[r];let te;if(Zt(Z))te=xt(Z),Wt(te,t,a);else if(Dn(Z)){const ee=re.visualScenes[Z].children;for(let Q=0;Q<ee.length;Q++){const se=ee[Q];if(se.type==="JOINT"){const ne=xt(se.id);Wt(ne,t,a)}}}else console.error("THREE.ColladaLoader: Unable to find root bone of skeleton with ID:",Z)}for(r=0;r<t.length;r++)for(C=0;C<a.length;C++)if(M=a[C],M.bone.name===t[r].name){s[r]=M,M.processed=!0;break}for(r=0;r<a.length;r++)M=a[r],M.processed===!1&&(s.push(M),M.processed=!0);const J=[],Y=[];for(r=0;r<s.length;r++)M=s[r],J.push(M.bone),Y.push(M.boneInverse);return new i.Skeleton(J,Y)}function Wt(n,t,a){n.traverse(function(s){if(s.isBone===!0){let r;for(let C=0;C<t.length;C++){const M=t[C];if(M.name===s.name){r=M.boneInverse;break}}r===void 0&&(r=new i.Matrix4),a.push({bone:s,boneInverse:r,processed:!1})}})}function Ln(n){const t=[],a=n.matrix,s=n.nodes,r=n.type,C=n.instanceCameras,M=n.instanceControllers,J=n.instanceLights,Y=n.instanceGeometries,Z=n.instanceNodes;for(let I=0,ee=s.length;I<ee;I++)t.push(xt(s[I]));for(let I=0,ee=C.length;I<ee;I++){const Q=it(C[I]);Q!==null&&t.push(Q.clone())}for(let I=0,ee=M.length;I<ee;I++){const Q=M[I],se=q(Q.id),ne=ht(se.id),Le=Kt(ne,Q.materials),ve=Q.skeletons,we=se.skin.joints,_e=Pn(ve,we);for(let lt=0,Ke=Le.length;lt<Ke;lt++){const Ct=Le[lt];Ct.isSkinnedMesh&&(Ct.bind(_e,se.skin.bindMatrix),Ct.normalizeSkinWeights()),t.push(Ct)}}for(let I=0,ee=J.length;I<ee;I++){const Q=ot(J[I]);Q!==null&&t.push(Q.clone())}for(let I=0,ee=Y.length;I<ee;I++){const Q=Y[I],se=ht(Q.id),ne=Kt(se,Q.materials);for(let Le=0,ve=ne.length;Le<ve;Le++)t.push(ne[Le])}for(let I=0,ee=Z.length;I<ee;I++)t.push(xt(Z[I]).clone());let te;if(s.length===0&&t.length===1)te=t[0];else{te=r==="JOINT"?new i.Bone:new i.Group;for(let I=0;I<t.length;I++)te.add(t[I])}return te.name=r==="JOINT"?n.sid:n.name,te.matrix.copy(a),te.matrix.decompose(te.position,te.quaternion,te.scale),te}const Bn=new i.MeshBasicMaterial({name:i.Loader.DEFAULT_MATERIAL_NAME,color:16711935});function Vn(n,t){const a=[];for(let s=0,r=n.length;s<r;s++){const C=t[n[s]];C===void 0?(console.warn("THREE.ColladaLoader: Material with key %s not found. Apply fallback material.",n[s]),a.push(Bn)):a.push(Xe(C))}return a}function Kt(n,t){const a=[];for(const s in n){const r=n[s],C=Vn(r.materialKeys,t);if(C.length===0&&(s==="lines"||s==="linestrips"?C.push(new i.LineBasicMaterial):C.push(new i.MeshPhongMaterial)),s==="lines"||s==="linestrips")for(let Z=0,te=C.length;Z<te;Z++){const I=C[Z];if(I.isMeshPhongMaterial===!0||I.isMeshLambertMaterial===!0){const ee=new i.LineBasicMaterial;ee.color.copy(I.color),ee.opacity=I.opacity,ee.transparent=I.transparent,C[Z]=ee}}const M=r.data.attributes.skinIndex!==void 0,J=C.length===1?C[0]:C;let Y;switch(s){case"lines":Y=new i.LineSegments(r.data,J);break;case"linestrips":Y=new i.Line(r.data,J);break;case"triangles":case"polylist":M?Y=new i.SkinnedMesh(r.data,J):Y=new i.Mesh(r.data,J);break}a.push(Y)}return a}function Zt(n){return re.nodes[n]!==void 0}function xt(n){return A(re.nodes[n],Ln)}function Rn(n){const t={name:n.getAttribute("name"),children:[]};Sn(n);const a=u(n,"node");for(let s=0;s<a.length;s++)t.children.push(Bt(a[s]));re.visualScenes[n.getAttribute("id")]=t}function Jt(n){const t=new i.Group;t.name=n.name;const a=n.children;for(let s=0;s<a.length;s++){const r=a[s];t.add(xt(r.id))}return t}function Dn(n){return re.visualScenes[n]!==void 0}function Xt(n){return A(re.visualScenes[n],Jt)}function Fn(n){const t=u(n,"instance_visual_scene")[0];return Xt(p(t.getAttribute("url")))}function In(){const n=re.clips;if(k(n)===!0){if(k(re.animations)===!1){const t=[];for(const a in re.animations){const s=T(a);for(let r=0,C=s.length;r<C;r++)t.push(s[r])}At.push(new i.AnimationClip("default",-1,t))}}else for(const t in n)At.push(oe(t))}function jn(n){let t="";const a=[n];for(;a.length;){const s=a.shift();s.nodeType===Node.TEXT_NODE?t+=s.textContent:(t+=`
9
9
  `,a.push(...s.childNodes))}return t.trim()}if(o.length===0)return{scene:new i.Scene};const Qt=new DOMParser().parseFromString(o,"application/xml"),Oe=u(Qt,"COLLADA")[0],Vt=Qt.getElementsByTagName("parsererror")[0];if(Vt!==void 0){const n=u(Vt,"div")[0];let t;return n?t=n.textContent:t=jn(Vt),console.error(`THREE.ColladaLoader: Failed to parse collada file.
10
10
  `,t),null}const On=Oe.getAttribute("version");console.debug("THREE.ColladaLoader: File version",On);const en=P(u(Oe,"asset")[0]),tn=new i.TextureLoader(this.manager);tn.setPath(this.resourcePath||c).setCrossOrigin(this.crossOrigin);let Rt;un&&(Rt=new un(this.manager),Rt.setPath(this.resourcePath||c));const Nt=new i.Color,At=[];let nn={},Un=0;const re={animations:{},clips:{},controllers:{},images:{},effects:{},materials:{},cameras:{},lights:{},geometries:{},nodes:{},visualScenes:{},kinematicsModels:{},physicsModels:{},kinematicsScenes:{}};b(Oe,"library_animations","animation",m),b(Oe,"library_animation_clips","animation_clip",g),b(Oe,"library_controllers","controller",ce),b(Oe,"library_images","image",D),b(Oe,"library_effects","effect",he),b(Oe,"library_materials","material",Be),b(Oe,"library_cameras","camera",Fe),b(Oe,"library_lights","light",yt),b(Oe,"library_geometries","geometry",fe),b(Oe,"library_nodes","node",Bt),b(Oe,"library_visual_scenes","visual_scene",Rn),b(Oe,"library_kinematics_models","kinematics_model",pt),b(Oe,"library_physics_models","physics_model",kn),b(Oe,"scene","instance_kinematics_scene",vn),h(re.animations,E),h(re.clips,K),h(re.controllers,L),h(re.images,U),h(re.effects,We),h(re.materials,dt),h(re.cameras,Ne),h(re.lights,xe),h(re.geometries,Ve),h(re.visualScenes,Jt),In(),An();const Mt=Fn(u(Oe,"scene")[0]);return Mt.animations=At,en.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."),Mt.rotation.set(-Math.PI/2,0,0)),Mt.scale.multiplyScalar(en.unit),{get animations(){return console.warn("THREE.ColladaLoader: Please access animations over scene.animations now."),At},kinematics:nn,library:re,scene:Mt}}}const Ut=new i.Quaternion,hn=new i.Euler;function vt(V){return V?V.trim().split(/\s+/g).map(o=>parseFloat(o)):[0,0,0]}function pn(V,o,c=!1){c||V.rotation.set(0,0,0),hn.set(o[0],o[1],o[2],"ZYX"),Ut.setFromEuler(hn),Ut.multiply(V.quaternion),V.quaternion.copy(Ut)}class go{constructor(o){this.manager=o||i.DefaultLoadingManager,this.loadMeshCb=this.defaultMeshLoader.bind(this),this.parseVisual=!0,this.parseCollision=!1,this.packages="",this.workingPath="",this.fetchOptions={}}loadAsync(o){return new Promise((c,u)=>{this.load(o,c,null,u)})}load(o,c,u,l){const d=this.manager,v=i.LoaderUtils.extractUrlBase(o),p=this.manager.resolveURL(o);d.itemStart(p),fetch(p,this.fetchOptions).then(_=>{if(_.ok)return u&&u(null),_.text();throw new Error(`URDFLoader: Failed to load url '${p}' with error code ${_.status} : ${_.statusText}.`)}).then(_=>{const k=this.parse(_,this.workingPath||v);c(k),d.itemEnd(p)}).catch(_=>{l?l(_):console.error("URDFLoader: Error loading file.",_),d.itemError(p),d.itemEnd(p)})}parse(o,c=this.workingPath){const u=this.packages,l=this.loadMeshCb,d=this.parseVisual,v=this.parseCollision,p=this.manager,_={},k={},P={};function F(f){if(!/^package:\/\//.test(f))return c?c+f:f;const[E,T]=f.replace(/^package:\/\//,"").split(/\/(.+)/);if(typeof u=="string")return u.endsWith(E)?u+"/"+T:u+"/"+E+"/"+T;if(u instanceof Function)return u(E)+"/"+T;if(typeof u=="object")return E in u?u[E]+"/"+T:(console.error(`URDFLoader : ${E} not found in provided package list.`),null)}function j(f){let E;f instanceof Document?E=[...f.children]:f instanceof Element?E=[f]:E=[...new DOMParser().parseFromString(f,"text/xml").children];const T=E.filter(x=>x.nodeName==="robot").pop();return b(T)}function b(f){const E=[...f.children],T=E.filter(O=>O.nodeName.toLowerCase()==="link"),x=E.filter(O=>O.nodeName.toLowerCase()==="joint"),y=E.filter(O=>O.nodeName.toLowerCase()==="material"),B=new i.URDFRobot;B.robotName=f.getAttribute("name"),B.urdfRobotNode=f,y.forEach(O=>{const $=O.getAttribute("name");P[$]=m(O)});const N={},S={};T.forEach(O=>{const $=O.getAttribute("name"),ae=f.querySelector(`child[link="${$}"]`)===null;_[$]=A(O,N,S,ae?B:null)}),x.forEach(O=>{const $=O.getAttribute("name");k[$]=h(O)}),B.joints=k,B.links=_,B.colliders=S,B.visual=N;const W=Object.values(k);return W.forEach(O=>{O instanceof i.URDFMimicJoint&&k[O.mimicJoint].mimicJoints.push(O)}),W.forEach(O=>{const $=new Set,ae=me=>{if($.has(me))throw new Error("URDFLoader: Detected an infinite loop of mimic joints.");$.add(me),me.mimicJoints.forEach(G=>{ae(G)})};ae(O)}),B.frames={...S,...N,..._,...k},B}function h(f){const E=[...f.children],T=f.getAttribute("type");let x;const y=E.find($=>$.nodeName.toLowerCase()==="mimic");y?(x=new i.URDFMimicJoint,x.mimicJoint=y.getAttribute("joint"),x.multiplier=parseFloat(y.getAttribute("multiplier")||1),x.offset=parseFloat(y.getAttribute("offset")||0)):x=new i.URDFJoint,x.urdfNode=f,x.name=f.getAttribute("name"),x.urdfName=x.name,x.jointType=T;let B=null,N=null,S=[0,0,0],W=[0,0,0];E.forEach($=>{const ae=$.nodeName.toLowerCase();ae==="origin"?(S=vt($.getAttribute("xyz")),W=vt($.getAttribute("rpy"))):ae==="child"?N=_[$.getAttribute("link")]:ae==="parent"?B=_[$.getAttribute("link")]:ae==="limit"&&(x.limit.lower=parseFloat($.getAttribute("lower")||x.limit.lower),x.limit.upper=parseFloat($.getAttribute("upper")||x.limit.upper))}),B.add(x),x.add(N),pn(x,W),x.position.set(S[0],S[1],S[2]);const O=E.filter($=>$.nodeName.toLowerCase()==="axis")[0];if(O){const $=O.getAttribute("xyz").split(/\s+/g).map(ae=>parseFloat(ae));x.axis=new i.Vector3($[0],$[1],$[2]),x.axis.normalize()}return x}function A(f,E,T,x=null){x===null&&(x=new i.URDFLink);const y=[...f.children];return x.name=f.getAttribute("name"),x.urdfName=x.name,x.urdfNode=f,d&&y.filter(N=>N.nodeName.toLowerCase()==="visual").forEach(N=>{const S=w(N,P);if(x.add(S),N.hasAttribute("name")){const W=N.getAttribute("name");S.name=W,S.urdfName=W,E[W]=S}}),v&&y.filter(N=>N.nodeName.toLowerCase()==="collision").forEach(N=>{const S=w(N);if(x.add(S),N.hasAttribute("name")){const W=N.getAttribute("name");S.name=W,S.urdfName=W,T[W]=S}}),x}function m(f){const E=[...f.children],T=new i.MeshPhongMaterial;return T.name=f.getAttribute("name")||"",E.forEach(x=>{const y=x.nodeName.toLowerCase();if(y==="color"){const B=x.getAttribute("rgba").split(/\s/g).map(N=>parseFloat(N));T.color.setRGB(B[0],B[1],B[2]),T.opacity=B[3],T.transparent=B[3]<1,T.depthWrite=!T.transparent}else if(y==="texture"){const B=x.getAttribute("filename");if(B){const N=new i.TextureLoader(p),S=F(B);T.map=N.load(S),T.map.colorSpace=i.SRGBColorSpace}}}),T}function w(f,E={}){const T=f.nodeName.toLowerCase()==="collision",x=[...f.children];let y=null;const B=x.filter(S=>S.nodeName.toLowerCase()==="material")[0];if(B){const S=B.getAttribute("name");S&&S in E?y=E[S]:y=m(B)}else y=new i.MeshPhongMaterial;const N=T?new i.URDFCollider:new i.URDFVisual;return N.urdfNode=f,x.forEach(S=>{const W=S.nodeName.toLowerCase();if(W==="geometry"){const O=S.children[0].nodeName.toLowerCase();if(O==="mesh"){const $=S.children[0].getAttribute("filename"),ae=F($);if(ae!==null){const me=S.children[0].getAttribute("scale");if(me){const G=vt(me);N.scale.set(G[0],G[1],G[2])}l(ae,p,(G,g)=>{g?console.error("URDFLoader: Error loading mesh.",g):G&&(G instanceof i.Mesh&&(G.material=y),G.position.set(0,0,0),G.quaternion.identity(),N.add(G))})}}else if(O==="box"){const $=new i.Mesh;$.geometry=new i.BoxGeometry(1,1,1),$.material=y;const ae=vt(S.children[0].getAttribute("size"));$.scale.set(ae[0],ae[1],ae[2]),N.add($)}else if(O==="sphere"){const $=new i.Mesh;$.geometry=new i.SphereGeometry(1,30,30),$.material=y;const ae=parseFloat(S.children[0].getAttribute("radius"))||0;$.scale.set(ae,ae,ae),N.add($)}else if(O==="cylinder"){const $=new i.Mesh;$.geometry=new i.CylinderGeometry(1,1,1,30),$.material=y;const ae=parseFloat(S.children[0].getAttribute("radius"))||0,me=parseFloat(S.children[0].getAttribute("length"))||0;$.scale.set(ae,me,ae),$.rotation.set(Math.PI/2,0,0),N.add($)}}else if(W==="origin"){const O=vt(S.getAttribute("xyz")),$=vt(S.getAttribute("rpy"));N.position.set(O[0],O[1],O[2]),N.rotation.set(0,0,0),pn(N,$)}}),N}return j(o)}defaultMeshLoader(o,c,u){/\.stl$/i.test(o)?new Lt(c).load(o,d=>{const v=new i.Mesh(d,new i.MeshPhongMaterial);u(v)}):/\.dae$/i.test(o)?new mo(c).load(o,d=>u(d.scene)):console.warn(`URDFLoader: Could not load model at ${o}.
11
- No loader available`)}}function yo(V,o,c,u,l){const d=async j=>{try{const b=await Gt.downloadAvatarApi({url:j});if(b.status!==200)throw new Error(`下载失败: ${b.status}`);return b.data}catch(b){throw console.error("addModelFromUrl失败:",b),b}},v=j=>new Promise((b,h)=>{const A=new FileReader;A.onload=m=>{try{const w=m.target.result,E=new Ot().parse(w);E.preload(),b(E)}catch(w){h(w)}},A.onerror=()=>{h(new Error("MTL文件读取失败"))},A.readAsText(j)}),p=async j=>{const b={materials:{},create:function(h){return this.materials[h]?this.materials[h]:(console.warn(`Material '${h}' not found, using default material`),new i.MeshPhongMaterial({color:8947848,side:i.DoubleSide}))},getAsArray:function(){const h=[];for(const A in this.materials)h.push(this.materials[A]);return h},preload:function(){for(const h in this.materials)this.materials[h].map&&(this.materials[h].map.needsUpdate=!0)}};for(const h of j){const A=await v(h);Object.assign(b.materials,A.materials)}return b.preload(),b},_=async(j,b=[])=>new Promise((h,A)=>{const m=new FileReader;m.onload=async w=>{try{const f=w.target.result;let E=null;b&&b.length>0&&(b.length===1?E=await v(b[0]):E=await p(b));const T=new jt;E&&T.setMaterials(E);const x=T.parse(f);E||x.traverse(y=>{y.isMesh&&(y.material=new i.MeshPhongMaterial({color:8947848,side:i.DoubleSide}))}),h(x)}catch(f){A(f)}},m.onerror=()=>{A(new Error("OBJ文件读取失败"))},m.readAsText(j)}),k=async j=>{var b;try{c.value=!0;const{scene:h}=V();if(!h)throw new Error("Scene not initialized");l();const A=[];for(let m=0;m<j.length;m++){const w=j[m];u.value=`正在加载模型 ${m+1}/${j.length}...`;const f=await d(w.objUrl),E=((b=w.objUrl)==null?void 0:b.split("/").pop())||`model_${m}.obj`,T=new File([f],E,{type:f.type});let x=[];if(w.mtlUrls){const B=Array.isArray(w.mtlUrls)?w.mtlUrls:[w.mtlUrls];for(let N=0;N<B.length;N++){const S=B[N],W=await d(S),O=(S==null?void 0:S.split("/").pop())||`material_${m}_${N}.mtl`,$=new File([W],O,{type:W.type});x.push($)}}const y=await _(T,x);h.add(y),o.value.push(y),A.push(y)}return c.value=!1,A}catch(h){throw console.error("加载模型失败:",h),c.value=!1,h}},P=async(j,b,h=[],A=[])=>{let m;const w=j.toLowerCase();switch(w){case".txt":case".cpt":case".obj":const f=await b.text();if(w===".txt"||w===".cpt"){const g=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,oe=[...f.matchAll(g)].map(X=>({x:parseFloat(X[1]),y:parseFloat(X[2]),z:parseFloat(X[3])})),ce=new i.BufferGeometry,ie=oe.flatMap(X=>[X.x,X.y,X.z]);if(ce.setAttribute("position",new i.Float32BufferAttribute(ie,3)),w===".txt"){const X=new i.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});m=new i.Points(ce,X)}else if(w===".cpt"){const X=new i.LineBasicMaterial({color:"#5B5C99",linewidth:100});m=new i.Line(ce,X)}}else if(w===".obj"){const g=new jt;if(h&&h.length>0){const K=new Ot;for(const oe of h){const ce=await oe.text(),ie=K.parse(ce);ie.preload(),g.setMaterials(ie);break}}m=g.parse(f),(!h||h.length===0)&&m.traverse(K=>{K.isMesh&&(K.material=new i.MeshPhongMaterial({color:"#B3B3D4"})),K instanceof i.Mesh&&(K.material.side=i.DoubleSide)})}break;case".stl":const E=await b.arrayBuffer(),x=new Lt().parse(E),y=new i.MeshPhongMaterial({color:"#B3B3D4",side:i.DoubleSide});m=new i.Mesh(x,y);break;case".nc":const B=["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"],N={"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)"},S=new i.Group,W=B.map(g=>new Promise((K,oe)=>{new Lt().load(`/model/${g}`,ie=>{const X=new i.MeshPhongMaterial({color:N[g]||"#B3B3D4",side:i.DoubleSide}),R=new i.Mesh(ie,X);K(R)},void 0,oe)}));try{(await Promise.all(W)).forEach(K=>S.add(K)),m=S}catch(g){throw console.error("加载NC文件对应的STL文件失败:",g),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const O=new fo,$=new i.Group;try{const g=await new Promise((oe,ce)=>{O.load("/model/final.pcd",ie=>{const X=new Float32Array(ie.geometry.attributes.position.count*3);for(let R=0;R<ie.geometry.attributes.position.count;R++)X[R*3]=1,X[R*3+1]=0,X[R*3+2]=0;ie.geometry.setAttribute("color",new i.BufferAttribute(X,3)),ie.material.vertexColors=!0,ie.scale.set(.3,.3,.3),oe(ie)},void 0,ce)}),K=await new Promise((oe,ce)=>{O.load("/model/target.pcd",ie=>{const X=new Float32Array(ie.geometry.attributes.position.count*3);for(let R=0;R<ie.geometry.attributes.position.count;R++)X[R*3]=0,X[R*3+1]=1,X[R*3+2]=0;ie.geometry.setAttribute("color",new i.BufferAttribute(X,3)),ie.material.vertexColors=!0,ie.scale.set(.3,.3,.3),oe(ie)},void 0,ce)});$.add(g),$.add(K),m=$}catch(g){throw console.error("PCD文件加载失败:",g),new Error("无法加载PCD文件")}break;case".urdf":const ae=await b.text(),me=new go,G=new Map;A.forEach(g=>{G.set(g.name,g.blob)}),me.loadMeshCb=async(g,K,oe,ce,ie)=>{const X=g.split("/").pop(),R=G.get(X);if(!R){ie(new Error(`找不到文件: ${X}`));return}const L=X.split(".").pop().toLowerCase();switch(L){case"stl":const z=await R.arrayBuffer(),D=new Lt(K).parse(z),U=new i.Mesh(D,new i.MeshPhongMaterial);oe(U);break;case"obj":const H=await R.text(),he=new jt(K),ke=X.replace(".obj",".mtl"),le=G.get(ke);if(le){const Re=await le.text(),ze=new Ot(K).parse(Re);ze.preload(),he.setMaterials(ze)}const Ae=he.parse(H);oe(Ae);break;default:ie(new Error(`不支持的文件格式: ${L}`))}},m=me.parse(ae);break;default:throw new Error(`不支持的文件格式: ${j}`)}return m};return{addModelsFromUrls:k,loadModelByDefaultPath:async j=>{console.log(j);try{c.value=!0,u.value="正在加载模型...";const{scene:b}=V();if(!b)throw new Error("Scene not initialized");l(),await new Promise(A=>setTimeout(A,100));const h=[];for(let A=0;A<j.length;A++){const m=j[A],w=await P(m.suffix,m.blob,m.mtlBlobs||[],m.meshFiles||[]);b.add(w),o.value.push(w),h.push(w)}return c.value=!1,u.value="",h}catch(b){throw console.error("加载模型失败:",b),c.value=!1,u.value="",b}}}}const bo={class:"obj-viewer-container"},wo={class:"floating-controls"},_o=["disabled"],ko=["disabled","title"],xo={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Co={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},vo=["disabled"],Eo=["title"],To={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"},Ao={key:0,class:"clipping-panel"},Mo={class:"panel-content"},So={class:"radio-group"},Po={class:"radio-label"},Lo={class:"radio-label"},Bo={class:"radio-label"},Vo={class:"radio-label"},Ro={key:1,class:"loading-overlay"},Do={__name:"threeModel",setup(V,{expose:o}){const c=e.ref(null),u=e.ref(!1),l=e.ref(""),d=e.ref(!1),v=e.ref(!1),{currentModels:p,initialCameraPosition:_,initialTargetPosition:k,initThreeJS:P,handleResize:F,fitCameraToAllModels:j,getThreeJSObjects:b,clearAllModels:h,cleanup:A}=so(c),{isAnimating:m,toggleAnimation:w,stopAnimation:f}=io(b,p),{isClipping:E,activeClippingAxis:T,toggleClipping:x,updateClippingPlanes:y}=ao(b,p),{addModelsFromUrls:B,loadModelByDefaultPath:N}=yo(b,p,u,l,h),S=()=>{if(v.value||p.value.length===0)return;v.value=!0,m.value&&f();const{camera:G,controls:g}=b();if(!G||!g)return;g.enabled=!0;const K=L=>L<.5?4*L*L*L:1-Math.pow(-2*L+2,3)/2,oe=G.position.clone(),ce=g.target.clone(),ie=1500,X=Date.now(),R=()=>{const L=Date.now()-X,z=Math.min(L/ie,1),q=K(z);G.position.lerpVectors(oe,_.value,q),g.target.lerpVectors(ce,k.value,q),z<1?requestAnimationFrame(R):v.value=!1};R()},W=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{d.value=!1,e.nextTick(()=>{F()})}).catch(G=>{console.error("无法退出全屏:",G)}):c.value.requestFullscreen().then(()=>{d.value=!0,e.nextTick(()=>{F()})}).catch(G=>{console.error("无法进入全屏:",G)})},O=()=>{d.value=!!document.fullscreenElement,d.value||e.nextTick(()=>{F()})},$=async(G,g)=>{try{m.value&&f(),E.value&&x();const K=await g(G);return j(),K}catch(K){throw console.error("加载模型失败:",K),K}},ae=async G=>$(G,B),me=async G=>$(G,N);return e.onMounted(async()=>{await e.nextTick(),P(),window.addEventListener("resize",F),document.addEventListener("fullscreenchange",O)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",F),document.removeEventListener("fullscreenchange",O),m.value&&f(),A()}),o({addModelsFromUrls:ae,loadModelByDefaultPath:me}),(G,g)=>(e.openBlock(),e.createElementBlock("div",bo,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:c,class:"threejs-container"},null,512),e.createElementVNode("div",wo,[e.createElementVNode("button",{onClick:S,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:u.value||e.unref(p).length===0||v.value,title:"重置"},g[10]||(g[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,_o),e.createElementVNode("button",{onClick:g[0]||(g[0]=(...K)=>e.unref(w)&&e.unref(w)(...K)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(m)}]),disabled:u.value||e.unref(p).length===0,title:e.unref(m)?"停止动画":"动画视图"},[e.unref(m)?(e.openBlock(),e.createElementBlock("svg",Co,g[12]||(g[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",xo,g[11]||(g[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,ko),e.createElementVNode("button",{onClick:g[1]||(g[1]=(...K)=>e.unref(x)&&e.unref(x)(...K)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(E)}]),disabled:u.value||e.unref(p).length===0,title:"剖面视图"},g[13]||(g[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,vo),e.createElementVNode("button",{onClick:W,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:d.value?"退出全屏":"全屏"},[d.value?(e.openBlock(),e.createElementBlock("svg",No,g[15]||(g[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",To,g[14]||(g[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,Eo)]),e.unref(E)?(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("div",Mo,[e.createElementVNode("div",So,[e.createElementVNode("label",Po,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":g[2]||(g[2]=K=>e.isRef(T)?T.value=K:null),onChange:g[3]||(g[3]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[16]||(g[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":g[4]||(g[4]=K=>e.isRef(T)?T.value=K:null),onChange:g[5]||(g[5]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[17]||(g[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Bo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":g[6]||(g[6]=K=>e.isRef(T)?T.value=K:null),onChange:g[7]||(g[7]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[18]||(g[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Vo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":g[8]||(g[8]=K=>e.isRef(T)?T.value=K:null),onChange:g[9]||(g[9]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[19]||(g[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",Ro,[g[20]||(g[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(l.value),1)])):e.createCommentVNode("",!0)]))}},Fo=_t._export_sfc(Do,[["__scopeId","data-v-fa098b89"]]),Io={class:"bread-content"},jo=["onClick"],Oo={key:0,class:"split-title"},Uo={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(V,{emit:o}){const c=V,u=e.ref([]),l=o;e.onMounted(()=>{u.value=c==null?void 0:c.breadArray}),e.watch(()=>c==null?void 0:c.breadArray,()=>{u.value=c==null?void 0:c.breadArray},{deep:!0,immediate:!0});const d=v=>{l("click",v)};return(v,p)=>(e.openBlock(),e.createElementBlock("div",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,k)=>{var P;return e.openBlock(),e.createElementBlock("div",{key:k,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:F=>d(_),style:e.normalizeStyle({opacity:((P=u.value)==null?void 0:P.length)-1===k?"0.7":"1"})},e.toDisplayString(_.value),13,jo),k!==u.value.length-1&&Array.isArray(u.value)?(e.openBlock(),e.createElementBlock("div",Oo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},yn=_t._export_sfc(Uo,[["__scopeId","data-v-ded7e2bd"]]),zo={class:"item-menu-content"},Go={class:"item-left-content"},Ho={key:0,class:"page-icon"},qo={class:"avatar"},$o={style:{display:"flex"}},Yo={class:"select-icon"},Wo={key:0,class:"model-operate",style:{width:"0px"}},Ko={class:"model-select"},Zo={class:"model-fill"},Jo={key:1,class:"show-main-content"},Xo={class:"show-content"},Qo={class:"item-view-group"},es={class:"show-item-content"},ts={class:"item-view-group"},ns={key:2,class:"show-main-content"},os={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(V,{emit:o}){const c=fn.useLoginState(),{loginUserInfo:u,cryptoInfo:l}=pe.storeToRefs(c);e.onMounted(()=>{mn.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const d=i.useModelComp(tt.pinia);i.useFormToTableComp(tt.pinia),e.ref(!0);const v=pe.useMenuState();e.ref(!0);const{itemData:p,isEdit:_,isRefreshCurStructure:k,curStructureCompIds:P}=pe.storeToRefs(d),F=i.useUnit(tt.pinia),{activeMenuPath:j,menus:b,importLoading:h}=pe.storeToRefs(v),{selectIndex:A,selectTitle:m}=pe.storeToRefs(F);return e.ref([]),e.ref(!1),(w,f)=>{const E=e.resolveComponent("el-aside"),T=e.resolveComponent("el-button"),x=e.resolveComponent("el-avatar"),y=e.resolveComponent("el-header"),B=e.resolveComponent("router-view"),N=e.resolveComponent("el-main"),S=e.resolveComponent("el-container"),W=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(S,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(_)==="view"?(e.openBlock(),e.createBlock(E,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(S,null,{default:e.withCtx(()=>[e.createVNode(y,null,{default:e.withCtx(()=>{var O;return[e.createElementVNode("div",zo,[e.createElementVNode("div",Go,[e.unref(_)==="edit"?(e.openBlock(),e.createElementBlock("div",Ho,[e.createVNode(T,{text:"",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>f[2]||(f[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(T,{text:"",onClick:f[0]||(f[0]=$=>{var ae,me;return e.unref(ue.clickSavePage)((me=(ae=e.unref(m))==null?void 0:ae.map(G=>G.value))==null?void 0:me.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[f[3]||(f[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(yn,{key:e.unref(m),breadArray:e.unref(m),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",qo,[e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:f[1]||(f[1]=(...$)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...$))},[e.createElementVNode("div",$o,[e.createVNode(mt.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),f[4]||(f[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Yo,[e.renderSlot(w.$slots,"default",{},void 0,!0)]),e.createVNode(x,{size:35,src:(O=e.unref(u))==null?void 0:O.avatarUrl},{default:e.withCtx(()=>{var $;return[e.createTextVNode(e.toDisplayString((($=e.unref(u))==null?void 0:$.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(N,null,{default:e.withCtx(()=>{var O,$,ae,me;return[e.unref(_)==="edit"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Ko,[e.createVNode(ct.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:w.innerWidth},[e.createVNode(ct.modelShow)])),e.createElementVNode("div",Zo,[e.createVNode(ct.modelFill)])])):w.$route.path==="/"&&((O=e.unref(ue.showItems))==null?void 0:O.length)>0&&e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",Jo,[e.createElementVNode("div",Xo,[($=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))!=null&&$.find(G=>G.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:w.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ae=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:ae.filter(G=>G.comp==="FormTop"),(G,g)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:g},[e.createElementVNode("div",Qo,e.toDisplayString(G.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(G.comp)),{itemData:G==null?void 0:G.compData,childItemData:G==null?void 0:G.itemChildData,key:(G==null?void 0:G.id)??g,onChange:e.unref(ue.onChange),index:(G==null?void 0:G.id)??g,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((me=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:me.filter(G=>G.comp!=="FormTop"),(G,g)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:g},[e.createElementVNode("div",ts,e.toDisplayString(G.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(G.comp)),{itemData:G==null?void 0:G.compData,childItemData:G==null?void 0:G.itemChildData,key:(G==null?void 0:G.id)??g,onChange:e.unref(ue.onChange),index:(G==null?void 0:G.id)??g,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",ns,[e.createVNode(B)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[W,e.unref(h)]])}}},ss=_t._export_sfc(os,[["__scopeId","data-v-d2611062"]]);function is(V,o,c,u,l,d){const v=e.resolveComponent("svg-icon"),p=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(p,{mode:V.mode,menuList:V.renderMenuList,onClickMenu:V.clickMenu,onOpenMenu:V.openMenu,onCloseMenu:V.closeMenu},{title:e.withCtx(({menu:_})=>[e.createVNode(v,{name:_.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(_.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const as=_t._export_sfc(ue._sfc_main,[["render",is],["__scopeId","data-v-e003bdbb"]]),ye=[{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"}],Et=[{key:"型线生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources/sampling_points_20.cpt"},{key:"曲面生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources/output.obj"},{key:"叶片生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources/output_TwoSections_completed.obj"},{key:"轨迹规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources/complete_data.txt"},{key:"加工规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources/NC_BC.NC"},{key:"产品检测",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/source.pcd,http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/target.pcd"},{key:"参数筛选训练方法",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources/fitness_iteration.png"}],rs={class:"structure-buttons"},ls={class:"structure-paths"},cs={class:"client-header-user"},ds={class:"select-icon"},us={class:"model-select"},hs={class:"model-show"},ps={class:"model-fill"},fs={class:"client-header-logo"},ms={class:"client-header-menu"},gs={class:"client-header-user"},ys={style:{display:"flex"}},bs={class:"select-icon"},ws={class:"client-main-content"},_s={key:0,class:"item-view-group"},ks={key:0,class:"calculator"},xs={key:1,class:"calculator"},Cs={class:"router-aside"},vs=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(V){const o=i.useUnit(tt.pinia),c=e.ref(0),u=e.ref(!1),{selectTitle:l}=pe.storeToRefs(o),d=e.ref(!1),v=e.ref(!1),p=e.ref(!1),_=i.useTableComp(tt.pinia),k=e.ref(!1),{tableShowThree:P}=pe.storeToRefs(_),F=fn.useLoginState(),{loginUserInfo:j}=pe.storeToRefs(F),b=i.useModelComp(tt.pinia),{isEdit:h}=pe.storeToRefs(b),A=pe.useMenuState(tt.pinia),m=Gn.useFormComp(tt.pinia),{objUrl:w,blobUrls:f}=pe.storeToRefs(m),E=e.ref(null),T=e.ref(!0),x=e.ref(!1),{importLoading:y,activeMenuPath:B,platName:N}=pe.storeToRefs(A),S=e.ref(!1);e.watch(()=>B.value,async R=>{R&&(S.value=!0),Et!=null&&Et.find(L=>{var z;return(L==null?void 0:L.key)===((z=R==null?void 0:R.split("/"))==null?void 0:z[(R==null?void 0:R.split("/").length)-1])})?k.value=!0:k.value=!1},{immediate:!0});const W=async()=>{var U,H,he,ke,le;x.value=!0;const R=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken");let L=((he=(H=(U=Et==null?void 0:Et.find(Ae=>{var Re,De,ze;return(Ae==null?void 0:Ae.key)===((ze=(Re=B.value)==null?void 0:Re.split("/"))==null?void 0:ze[((De=B.value)==null?void 0:De.split("/").length)-1])}))==null?void 0:U.value)==null?void 0:H.split(","))==null?void 0:he[0])??"";const z=await pe.axios.post(L,null,{responseType:"blob",headers:{Authorization:R,"Content-Type":"application/json"}}),q=new Blob([z.data],{type:"application/octet-stream;charset=UTF-8"});let D={suffix:"."+((le=L==null?void 0:L.split("."))==null?void 0:le[((ke=L==null?void 0:L.split("."))==null?void 0:ke.length)-1]),blob:q,mtlBlobs:[]};x.value=!1,E.value.loadModelByDefaultPath([D])},O=async R=>{var q,D,U,H,he,ke,le;const L=(q=R==null?void 0:R.split("/"))==null?void 0:q[0],z=await pe.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:L}});return((D=z==null?void 0:z.data)==null?void 0:D.type)==="success"?((le=(ke=(he=(H=(U=z==null?void 0:z.data)==null?void 0:U.result)==null?void 0:H[0])==null?void 0:he.value)==null?void 0:ke.tableData)==null?void 0:le.隐藏三维显示)!==!0:!0};e.watch(()=>ue.showItems.value,()=>{var R,L,z,q,D;if(((R=ue.showItems.value)==null?void 0:R.length)===2&&((L=ue.showItems.value)!=null&&L.find(U=>(U==null?void 0:U.name)==="输入"))&&((z=ue.showItems.value)!=null&&z.find(U=>(U==null?void 0:U.name)==="输出"))){const U=(q=ue.showItems.value)==null?void 0:q.find(H=>(H==null?void 0:H.name)==="输出");v.value=((D=U==null?void 0:U.comp)==null?void 0:D.toUpperCase())==="FORM",d.value=!0}else d.value=!1,v.value=!1},{deep:!0,immediate:!0}),e.watch(()=>B.value,async()=>{B.value&&(T.value=await O(B.value))},{deep:!0,immediate:!0}),e.watch(()=>[w.value,E.value],()=>{var R;((R=w.value)==null?void 0:R.length)>0&&E.value&&E.value.addModelsFromUrls(w.value)},{immediate:!0,deep:!0}),e.watch(()=>f==null?void 0:f.value,async()=>{var R,L,z,q;if(f!=null&&f.value&&((R=f==null?void 0:f.value)==null?void 0:R.length)>0&&!k&&!((L=ue.showItems.value)!=null&&L.find(D=>(D==null?void 0:D.name)==="输入")&&((z=ue.showItems.value)!=null&&z.find(D=>(D==null?void 0:D.name)==="输出")))){let D=[];const U=await((q=gt.cloneDeep(f==null?void 0:f.value))==null?void 0:q.map(async H=>{var Re,De,ze,Se,de,qe,Ye,Je,st,nt;let he,ke;const le=(De=(Re=H==null?void 0:H.blob)==null?void 0:Re.split("undefined,"))==null?void 0:De[1];let Ae=le==null?void 0:le.split(",");if((Ae==null?void 0:Ae.length)>1){let We=await(Ae==null?void 0:Ae.map(async Me=>{var Ee,dt,Xe,Fe,ge,$e;he=await pe.axios.get(Me,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Be=[];if(((Ee=H==null?void 0:H.mtlBlobs)==null?void 0:Ee.length)>0){let ut=await((dt=H==null?void 0:H.mtlBlobs)==null?void 0:dt.map(async Ne=>{let it=await pe.axios.get(Ne,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Be.push(new Blob([it.data],{type:"application/octet-stream;charset=UTF-8"})),it}));await Promise.all(ut)}return((Fe=Me==null?void 0:Me.split("."))==null?void 0:Fe[((Xe=Me==null?void 0:Me.split("."))==null?void 0:Xe.length)-1])!=="undefined"&&D.push({suffix:"."+(($e=Me==null?void 0:Me.split("."))==null?void 0:$e[((ge=Me==null?void 0:Me.split("."))==null?void 0:ge.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Be}),he}));await Promise.all(We)}else if(!(le!=null&&le.includes("https://"))&&!(le!=null&&le.includes("http://"))){he=await Gt.downloadAvatarApi({url:le});let We=[];if(((ze=H==null?void 0:H.mtlBlobs)==null?void 0:ze.length)>0){let Me=await((Se=H==null?void 0:H.mtlBlobs)==null?void 0:Se.map(async Be=>{let Ee=await Gt.downloadAvatarApi({url:Be});return We.push(new Blob([Ee.data],{type:"application/octet-stream;charset=UTF-8"})),Ee}));await Promise.all(Me)}ke={suffix:"."+((qe=le==null?void 0:le.split("."))==null?void 0:qe[((de=le==null?void 0:le.split("."))==null?void 0:de.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:We}}else{he=await pe.axios.get(le,{responseType:"blob",headers:{"Content-Type":"application/json"}});let We=[];if(((Ye=H==null?void 0:H.mtlBlobs)==null?void 0:Ye.length)>0){let Me=await((Je=H==null?void 0:H.mtlBlobs)==null?void 0:Je.map(async Be=>{let Ee=await pe.axios.get(Be,{responseType:"blob",headers:{"Content-Type":"application/json"}});return We.push(new Blob([Ee.data],{type:"application/octet-stream;charset=UTF-8"})),Ee}));await Promise.all(Me)}ke={suffix:"."+((nt=le==null?void 0:le.split("."))==null?void 0:nt[((st=le==null?void 0:le.split("."))==null?void 0:st.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:We}}ke&&D.push(ke)}));await Promise.all(U),E.value.loadModelByDefaultPath(D)}},{immediate:!0,deep:!0}),e.watch(()=>P.value,async()=>{var L,z,q,D;if(P.value!==""&&P.value){let U=(L=B.value)==null?void 0:L.split("/"),H=U[(U==null?void 0:U.length)-2];const ke=(((z=ye==null?void 0:ye.find(De=>(De==null?void 0:De.key)===H))==null?void 0:z.download)??"")+"/"+P.value,le=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ae=await pe.axios.post(ke,null,{responseType:"blob",headers:{Authorization:le,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var R=new Blob([Ae.data],{type:"application/octet-stream;charset=UTF-8"});const Re=[{suffix:"."+((D=(q=P.value)==null?void 0:q.split("."))==null?void 0:D[1]),blob:R,mtlBlobs:[]}];E.value.loadModelByDefaultPath(Re)}},{deep:!0,immediate:!0});const $=async()=>{var he,ke,le,Ae,Re,De,ze,Se,de,qe,Ye,Je,st,nt,We,Me,Be;u.value=!0;let R=(he=B.value)==null?void 0:he.split("/"),L=R[(R==null?void 0:R.length)-2];const z=((ke=ye==null?void 0:ye.find(Ee=>(Ee==null?void 0:Ee.key)===L))==null?void 0:ke.value)??"";let q="";const D=await pe.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((le=D==null?void 0:D.data)==null?void 0:le.code)===200&&(q=`Bearer ${(Re=(Ae=D.data)==null?void 0:Ae.result)==null?void 0:Re.accessToken}`,sessionStorage.setItem("magicToken",q));const U=q===""?"123456":q,H=await pe.axios.post(z,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((De=H==null?void 0:H.data)==null?void 0:De.type)==="success"&&i.IsJson((Se=(ze=H==null?void 0:H.data)==null?void 0:ze.result)==null?void 0:Se.result)){const Ee=(st=(Je=(Ye=JSON.parse((qe=(de=H==null?void 0:H.data)==null?void 0:de.result)==null?void 0:qe.result))==null?void 0:Ye.lines_file_paths)==null?void 0:Je[0])==null?void 0:st.split("\\"),Xe=(((nt=ye==null?void 0:ye.find(ge=>(ge==null?void 0:ge.key)===L))==null?void 0:nt.resources)??"")+"/"+(((Ee==null?void 0:Ee[(Ee==null?void 0:Ee.length)-2])==="inputResources"?"outputResources":Ee==null?void 0:Ee[(Ee==null?void 0:Ee.length)-2])??"outputResources"),Fe=await pe.axios.post(Xe,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=Fe==null?void 0:Fe.data)==null?void 0:We.type)==="success"){const ge=(Me=Fe==null?void 0:Fe.data)==null?void 0:Me.result,$e=ue.showItems.value,ut=await((Be=gt.cloneDeep($e))==null?void 0:Be.map(async Ne=>{var it,yt,bt,Ie,xe,ot;if((Ne==null?void 0:Ne.name)==="输出"){if((Ne==null?void 0:Ne.comp)==="Table")Ne.compData=(it=Ne==null?void 0:Ne.compData)==null?void 0:it.map(fe=>{var Ce,Ge;return(fe==null?void 0:fe.key)==="tableContents"&&(fe.contents=(Ge=(Ce=fe==null?void 0:fe.contents)==null?void 0:Ce.map(Pe=>(Pe=Pe==null?void 0:Pe.map((be,je)=>{var Ve,at,He;return typeof be=="string"&&je>1?((Ve=fe==null?void 0:fe.contents)==null?void 0:Ve.length)>1?be=((at=ge==null?void 0:ge[je-1])!=null&&at.includes("input")?be:ge==null?void 0:ge[je-1])??be:be=ge==null?void 0:ge[0]:be=((He=ge==null?void 0:ge[je-1])!=null&&He.includes("input")?be:ge==null?void 0:ge[je-1])??be,be}),Pe)))==null?void 0:Ge.filter((Pe,be)=>be<=(ge==null?void 0:ge.length)-1)),fe});else if((Ne==null?void 0:Ne.comp)==="Form"){let fe="";if(ge==null||ge.forEach(Ce=>{fe=fe===""?fe+Ce:fe+","+Ce}),Ne.compData=(yt=Ne==null?void 0:Ne.compData)==null?void 0:yt.map(Ce=>{var Ge;return(Ce==null?void 0:Ce.key)==="formContent"&&(Ce.contents=(Ge=Ce.contents)==null?void 0:Ge.map(Pe=>(Pe.value=fe,Pe))),Ce}),(bt=fe==null?void 0:fe.split(","))!=null&&bt.find(Ce=>Ce.includes(".obj"))){let Ce={};Ce.suffix=".obj";const Ge=[];let Pe=await((xe=(Ie=fe==null?void 0:fe.split(","))==null?void 0:Ie.filter(be=>be.includes(".obj")||be.includes(".mtl")))==null?void 0:xe.map(async be=>{var Ve,at;if(be.includes(".obj")){const ht=(((Ve=ye==null?void 0:ye.find(rt=>(rt==null?void 0:rt.key)===L))==null?void 0:Ve.download)??"")+"/"+be,pt=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ft=await pe.axios.post(ht,null,{responseType:"blob",headers:{Authorization:pt,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var je=new Blob([ft.data],{type:"application/octet-stream;charset=UTF-8"});Ce.blob=je}else if(be.includes(".mtl")){const ht=(((at=ye==null?void 0:ye.find(Tt=>(Tt==null?void 0:Tt.key)===L))==null?void 0:at.download)??"")+"/"+be,pt=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ft=await pe.axios.post(ht,null,{responseType:"blob",headers:{Authorization:pt,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var je=new Blob([ft.data],{type:"application/octet-stream;charset=UTF-8"});Ge.push(je)}}));await Promise.all(Pe),Ce.mtlBlobs=Ge,E.value.loadModelByDefaultPath([Ce])}else{const Ce=[];let Ge=await((ot=fe==null?void 0:fe.split(","))==null?void 0:ot.map(async Pe=>{var pt,ft;let be={};be.suffix="."+((pt=Pe==null?void 0:Pe.split("."))==null?void 0:pt[1]);const Ve=(((ft=ye==null?void 0:ye.find(rt=>(rt==null?void 0:rt.key)===L))==null?void 0:ft.download)??"")+"/"+Pe,at=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),He=await pe.axios.post(Ve,null,{responseType:"blob",headers:{Authorization:at,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var ht=new Blob([He.data],{type:"application/octet-stream;charset=UTF-8"});be.blob=ht,Ce.push(be)}));await Promise.all(Ge),E.value.loadModelByDefaultPath(Ce)}}}return Ne}));ue.showItems.value=await Promise.all(ut)}}c.value++,u.value=!1},ae=e.ref(""),me=e.ref("open"),G=e.ref("open"),g=e.ref(!1),K=()=>{const R=document.getElementById("menuCollapse");me.value==="open"?(R.style.width="18.75rem",R.style.height="96%",R.style.overflow="auto"):(R.style.width="50px",R.style.height="50px",R.style.overflow="hidden")},oe=()=>{const R=document.getElementById("operateCollapse");G.value==="open"?(R.style.width="25rem",R.style.height="96%",R.style.overflow="auto"):(R.style.width="50px",R.style.height="50px",R.style.overflow="hidden")},ce=()=>{g.value=!g.value;const R=document.getElementById("operateCollapse"),L=document.getElementById("menuCollapse");g.value?(L.style.width="18.75rem",R.style.width="calc(100% - 24rem)"):R.style.width="400px"},ie=R=>{const L=URL.createObjectURL(R),z=document.createElement("a");z.href=L,z.download="file.txt",document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(L),p.value=!1},X=async()=>{var he,ke,le,Ae,Re,De,ze,Se,de,qe,Ye,Je,st,nt,We,Me;p.value=!0;let R=(he=B.value)==null?void 0:he.split("/"),L=R[(R==null?void 0:R.length)-2];const z=((ke=ye==null?void 0:ye.find(Be=>(Be==null?void 0:Be.key)===L))==null?void 0:ke.value)??"";let q="";const D=await pe.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});if(((le=D==null?void 0:D.data)==null?void 0:le.code)===200)q=`Bearer ${(Re=(Ae=D.data)==null?void 0:Ae.result)==null?void 0:Re.accessToken}`,sessionStorage.setItem("magicToken",q);else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了");const U=q===""?"123456":q,H=await pe.axios.post(z,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((De=H==null?void 0:H.data)==null?void 0:De.code)===200){if(i.IsJson((Se=(ze=H==null?void 0:H.data)==null?void 0:ze.result)==null?void 0:Se.result)){const Be=(st=(Je=(Ye=JSON.parse((qe=(de=H==null?void 0:H.data)==null?void 0:de.result)==null?void 0:qe.result))==null?void 0:Ye.lines_file_paths)==null?void 0:Je[0])==null?void 0:st.split("\\"),dt=(((nt=ye==null?void 0:ye.find(Fe=>(Fe==null?void 0:Fe.key)===L))==null?void 0:nt.resources)??"")+"/"+((Be==null?void 0:Be[(Be==null?void 0:Be.length)-2])??"outputResources"),Xe=await pe.axios.post(dt,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=Xe==null?void 0:Xe.data)==null?void 0:We.code)===200){const Fe=(Me=Xe==null?void 0:Xe.data)==null?void 0:Me.result,ge=gt.cloneDeep(ue.showItems.value);ge==null||ge.map(async $e=>{var ut,Ne,it,yt,bt;if(($e==null?void 0:$e.name)==="输出"&&($e==null?void 0:$e.comp)==="Form"){let Ie="";Fe==null||Fe.forEach(xe=>{Ie=Ie===""?Ie+xe:Ie+","+xe}),$e.compData=(ut=$e==null?void 0:$e.compData)==null?void 0:ut.map(xe=>{var ot;return(xe==null?void 0:xe.key)==="formContent"&&(xe.contents=(ot=xe.contents)==null?void 0:ot.map(fe=>(fe.value=Ie,fe))),xe}),(Ne=Ie==null?void 0:Ie.split(","))!=null&&Ne.find(xe=>xe.includes(".obj"))?(yt=(it=Ie==null?void 0:Ie.split(","))==null?void 0:it.filter(xe=>xe.includes(".obj")||xe.includes(".mtl")))==null||yt.map(async xe=>{var ot,fe;if(xe.includes(".obj")){const Ge=(((ot=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:ot.download)??"")+"/"+xe,Pe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await pe.axios.post(Ge,null,{responseType:"blob",headers:{Authorization:Pe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});ie(je)}else if(xe.includes(".mtl")){const Ge=(((fe=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:fe.download)??"")+"/"+xe,Pe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await pe.axios.post(Ge,null,{responseType:"blob",headers:{Authorization:Pe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});ie(je)}}):(bt=Ie==null?void 0:Ie.split(","))==null||bt.map(async xe=>{var be,je;""+((be=xe==null?void 0:xe.split("."))==null?void 0:be[1]);const fe=(((je=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:je.download)??"")+"/"+xe,Ce=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ge=await pe.axios.post(fe,null,{responseType:"blob",headers:{Authorization:Ce,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let Pe=new Blob([Ge.data],{type:"application/octet-stream;charset=UTF-8"});ie(Pe)})}})}else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了")}}else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了")};return(R,L)=>{const z=e.resolveComponent("el-button"),q=e.resolveComponent("el-avatar"),D=e.resolveComponent("el-header"),U=e.resolveComponent("el-container"),H=e.resolveComponent("el-icon"),he=e.resolveComponent("el-input"),ke=e.resolveComponent("el-aside"),le=e.resolveComponent("el-collapse-item"),Ae=e.resolveComponent("el-collapse"),Re=e.resolveComponent("el-main"),De=e.resolveComponent("router-view"),ze=e.resolveDirective("loading");return e.unref(h)==="edit"?(e.openBlock(),e.createBlock(U,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(D,{class:"client-structure-header"},{default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",rs,[e.createVNode(z,{class:"select-icon",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>L[6]||(L[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(z,{class:"select-icon",onClick:L[0]||(L[0]=de=>{var qe,Ye;return e.unref(ue.clickSavePage)((Ye=(qe=e.unref(l))==null?void 0:qe.map(Je=>Je.value))==null?void 0:Ye.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[L[7]||(L[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",ls,[(e.openBlock(),e.createBlock(yn,{key:e.unref(l),breadArray:e.unref(l),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",cs,[e.createElementVNode("div",ds,[e.renderSlot(R.$slots,"default",{},void 0,!0)]),e.createVNode(q,{size:35,src:(Se=e.unref(j))==null?void 0:Se.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(j))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(h)==="edit"?(e.openBlock(),e.createBlock(U,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",us,[e.createVNode(ct.modelSelect)]),e.createElementVNode("div",hs,[e.createVNode(ct.modelShow)]),e.createElementVNode("div",ps,[e.createVNode(ct.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(U,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(D,{class:"client-header"},{default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",fs,[e.createVNode(mt.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(N)===""?"CPMPIP":e.unref(N)),1)]),e.createElementVNode("div",ms,[e.createVNode(as,{mode:"horizontal"})]),e.createElementVNode("div",gs,[e.createVNode(he,{modelValue:ae.value,"onUpdate:modelValue":L[1]||(L[1]=de=>ae.value=de),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode(H,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(mn.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(h)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:L[2]||(L[2]=(...de)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...de))},[e.createElementVNode("div",ys,[e.createVNode(mt.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),L[8]||(L[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",bs,[e.renderSlot(R.$slots,"default",{},void 0,!0)]),e.createVNode(q,{size:35,src:(Se=e.unref(j))==null?void 0:Se.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(j))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(U,{class:"client-body"},{default:e.withCtx(()=>[R.$route.path==="/"?(e.openBlock(),e.createBlock(Re,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(Ae,{modelValue:me.value,"onUpdate:modelValue":L[3]||(L[3]=Se=>me.value=Se),accordion:"",class:"client-aside",id:"menuCollapse",onChange:K},{default:e.withCtx(()=>[e.createVNode(le,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:me.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(ke,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",ws,[e.createVNode(Fo,{isShow:S.value,windowConfig:V.windowConfig,ref_key:"threeModelRef",ref:E},null,8,["isShow","windowConfig"])]),e.createVNode(Ae,{modelValue:G.value,"onUpdate:modelValue":L[5]||(L[5]=Se=>G.value=Se),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:oe},{default:e.withCtx(()=>[e.createVNode(le,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:G.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",null,[e.createVNode(mt.SvgIcon,{class:"fold-icon",name:g.value?"Right":"Left",onClick:ce},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Se=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:Se.filter(de=>de.comp!=="FormTop"),(de,qe)=>{var Ye;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:qe},[((Ye=de==null?void 0:de.comp)==null?void 0:Ye.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",_s,e.toDisplayString(de.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(de.comp)),{compName:de.name,itemData:de==null?void 0:de.compData,childItemData:de==null?void 0:de.itemChildData,key:(de==null?void 0:de.id)??qe,onChange:e.unref(ue.onChange),index:(de==null?void 0:de.id)??qe,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),d.value?(e.openBlock(),e.createElementBlock("div",ks,[v.value?(e.openBlock(),e.createBlock(Dt._sfc_main,{key:0,class:"calculator-content",onClickTrigger:X,loading:p.value,modelValue:"预览"},null,8,["loading"])):e.createCommentVNode("",!0),e.createVNode(Dt._sfc_main,{class:"calculator-content",onClickTrigger:L[4]||(L[4]=de=>$()),loading:u.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",xs,[e.createVNode(Dt._sfc_main,{class:"calculator-content",modelValue:"执行方法",onClickTrigger:W,loading:x.value},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(Re,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",Cs,[e.createVNode(ke,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})]),e.createVNode(Re,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(De)]),_:1})]),_:1}))]),_:1})]),_:3})),[[ze,e.unref(y)]])}}}),Es=_t._export_sfc(vs,[["__scopeId","data-v-1406ae2d"]]),Ts={class:"system-wrap"},Ns={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(V){const o=i.useModelComp(tt.pinia),c=i.useUnit(tt.pinia),u=pe.useMenuState();e.ref(!1);const l=e.ref(!0),d=V,v=e.computed(()=>(d==null?void 0:d.platform)==="browser"?[{name:"--ssbutton-theme-color",value:"#fff"},{name:"--ssbutton-theme-bg",value:"var(--ssComponent-primary-color)"}]:[{name:"--ssbutton-theme-color",value:"#323333"},{name:"--ssbutton-theme-bg",value:"#72B02D"}]),p=_=>{const k=document.documentElement;_==null||_.forEach(P=>{k.style.setProperty(P.name,P.value)})};return e.watch(()=>d.platform,(_,k)=>{_&&p(v.value)},{immediate:!0}),e.watch(()=>[d==null?void 0:d.content,d==null?void 0:d.jsonContents],async()=>{var P,F,j,b;if(((P=d==null?void 0:d.jsonContents)==null?void 0:P.length)>0){o.setOriginalData(d==null?void 0:d.jsonContents);return}if(!(d!=null&&d.content)||((F=d==null?void 0:d.content)==null?void 0:F.length)===0)return;l.value=!0,u.setImportLoading(!0);let _=[],k=[];c.setSelectTitle([]),c.setSelectIndex(""),c.setSelectMenu(""),(b=(j=d==null?void 0:d.content)==null?void 0:j.filter(h=>h!==""))==null||b.forEach(h=>{wt.isExpandStringToJson(h)?k.push(wt.expandStringToJson(h)):wt.expandNewStringToJson(h)?k.push(wt.expandNewStringToJson(h)):wt.expandContentStringToJson(h)?k.push(wt.expandContentStringToJson(h)):k.push(ue.expandToNewContents(h))}),_=k==null?void 0:k[0],await ue.savePageDataAsync(_),await i.loadingSystemType(),o.setOriginalData(_),u.setImportLoading(!1)},{deep:!0,immediate:!0}),(_,k)=>(e.openBlock(),e.createElementBlock("div",Ts,[V.platform==="browser"?(e.openBlock(),e.createBlock(ss,{key:0},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Es,{key:1,windowConfig:V.windowConfig},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},As=_t._export_sfc(Ns,[["__scopeId","data-v-136f5a47"]]),Ms={class:"add-model-content"},Ss={key:0,class:"model-operate"},Ps={class:"model-select"},Ls={class:"model-fill"},Bs={key:1,class:"model-view"},Vs={key:0,class:"model-import-data"},Rs={__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(V,{emit:o}){const c=V,u=o,l=e.ref([]),d=e.ref([]),v=e.ref([]),p=e.ref(0),_=i.useModelComp(tt.pinia),k=pe.useMenuState(tt.pinia),{itemData:P,originalData:F}=pe.storeToRefs(_),{activeMenuPath:j,platform:b}=pe.storeToRefs(k),h=e.ref(null),A=e.ref(0),m=e.ref([]);e.ref("");const w=e.ref(0),f=y=>{u("contentChange",y)},E=y=>{var N;const B=(N=gt.cloneDeep(y==null?void 0:y.wholeValue))==null?void 0:N.map(S=>{var W;return(S==null?void 0:S.comp)==="Form"&&(S.compData=(W=S.compData)==null?void 0:W.map(O=>((O==null?void 0:O.key)==="formContent"&&(O.contents=wt.arrayToNumberArray(O==null?void 0:O.contents)),O))),S});u("change",{originalContents:F.value,currentContents:y==null?void 0:y.wholeValue,editContent:y==null?void 0:y.editValue,arrayToContents:B})};e.watch(()=>d.value,()=>{w.value===d.value.length&&d.value.length!==0&&(l.value=d.value)},{deep:!0,immediate:!0});const T=()=>{h.value.click()},x=async y=>{const B=y.target.files;if(!B)return;new FileReader,l.value=[],d.value=[],w.value=B.length;const N=Array.from(B).map(async S=>await new Promise(W=>{const O=new FileReader;O.onload=$=>{try{d.value.push($.target.result),A.value++}catch(ae){console.error("解析失败:",ae);return}},O.onerror=()=>W(`读取 ${S.name} 失败`),O.readAsText(S),y.target.value="",h.value=null}));await Promise.all(N)};return e.watch(()=>[c==null?void 0:c.content,c==null?void 0:c.jsonContents],async()=>{await i.loadingSystemType(),l.value=c.content,v.value=c==null?void 0:c.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>A.value,()=>{var y;((y=m.value)==null?void 0:y.length)!==0&&(_.setOriginalData(m.value),_.setItemData(m.value))},{deep:!0,immediate:!0}),(y,B)=>{const N=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Ms,[(c==null?void 0:c.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Ps,[e.createVNode(ct.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(ct.modelShow)])),e.createElementVNode("div",Ls,[e.createVNode(ct.modelFill)])])):e.createCommentVNode("",!0),(c==null?void 0:c.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Bs,[(e.openBlock(),e.createBlock(As,{platform:e.unref(b),content:l.value,onChange:E,jsonContents:v.value,onContentChange:f,key:p.value},{default:e.withCtx(()=>{var S;return[((S=c==null?void 0:c.jsonContents)==null?void 0:S.length)===0&&(c!=null&&c.showButton)?(e.openBlock(),e.createElementBlock("div",Vs,[e.createElementVNode("div",{class:"import-button",onClick:T},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:h,accept:".txt, .inm",onChange:x,style:{display:"none"},multiple:""},null,544),e.createVNode(N,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),B[0]||(B[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Ds=_t._export_sfc(Rs,[["__scopeId","data-v-62633fa4"]]);exports.default=Ds;
11
+ No loader available`)}}function yo(V,o,c,u,l){const d=async j=>{try{const b=await Gt.downloadAvatarApi({url:j});if(b.status!==200)throw new Error(`下载失败: ${b.status}`);return b.data}catch(b){throw console.error("addModelFromUrl失败:",b),b}},v=j=>new Promise((b,h)=>{const A=new FileReader;A.onload=m=>{try{const w=m.target.result,E=new Ot().parse(w);E.preload(),b(E)}catch(w){h(w)}},A.onerror=()=>{h(new Error("MTL文件读取失败"))},A.readAsText(j)}),p=async j=>{const b={materials:{},create:function(h){return this.materials[h]?this.materials[h]:(console.warn(`Material '${h}' not found, using default material`),new i.MeshPhongMaterial({color:8947848,side:i.DoubleSide}))},getAsArray:function(){const h=[];for(const A in this.materials)h.push(this.materials[A]);return h},preload:function(){for(const h in this.materials)this.materials[h].map&&(this.materials[h].map.needsUpdate=!0)}};for(const h of j){const A=await v(h);Object.assign(b.materials,A.materials)}return b.preload(),b},_=async(j,b=[])=>new Promise((h,A)=>{const m=new FileReader;m.onload=async w=>{try{const f=w.target.result;let E=null;b&&b.length>0&&(b.length===1?E=await v(b[0]):E=await p(b));const T=new jt;E&&T.setMaterials(E);const x=T.parse(f);E||x.traverse(y=>{y.isMesh&&(y.material=new i.MeshPhongMaterial({color:8947848,side:i.DoubleSide}))}),h(x)}catch(f){A(f)}},m.onerror=()=>{A(new Error("OBJ文件读取失败"))},m.readAsText(j)}),k=async j=>{var b;try{c.value=!0;const{scene:h}=V();if(!h)throw new Error("Scene not initialized");l();const A=[];for(let m=0;m<j.length;m++){const w=j[m];u.value=`正在加载模型 ${m+1}/${j.length}...`;const f=await d(w.objUrl),E=((b=w.objUrl)==null?void 0:b.split("/").pop())||`model_${m}.obj`,T=new File([f],E,{type:f.type});let x=[];if(w.mtlUrls){const B=Array.isArray(w.mtlUrls)?w.mtlUrls:[w.mtlUrls];for(let N=0;N<B.length;N++){const S=B[N],W=await d(S),O=(S==null?void 0:S.split("/").pop())||`material_${m}_${N}.mtl`,$=new File([W],O,{type:W.type});x.push($)}}const y=await _(T,x);h.add(y),o.value.push(y),A.push(y)}return c.value=!1,A}catch(h){throw console.error("加载模型失败:",h),c.value=!1,h}},P=async(j,b,h=[],A=[])=>{let m;const w=j.toLowerCase();switch(w){case".txt":case".cpt":case".obj":const f=await b.text();if(w===".txt"||w===".cpt"){const g=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,oe=[...f.matchAll(g)].map(X=>({x:parseFloat(X[1]),y:parseFloat(X[2]),z:parseFloat(X[3])})),ce=new i.BufferGeometry,ie=oe.flatMap(X=>[X.x,X.y,X.z]);if(ce.setAttribute("position",new i.Float32BufferAttribute(ie,3)),w===".txt"){const X=new i.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});m=new i.Points(ce,X)}else if(w===".cpt"){const X=new i.LineBasicMaterial({color:"#5B5C99",linewidth:100});m=new i.Line(ce,X)}}else if(w===".obj"){const g=new jt;if(h&&h.length>0){const K=new Ot;for(const oe of h){const ce=await oe.text(),ie=K.parse(ce);ie.preload(),g.setMaterials(ie);break}}m=g.parse(f),(!h||h.length===0)&&m.traverse(K=>{K.isMesh&&(K.material=new i.MeshPhongMaterial({color:"#B3B3D4"})),K instanceof i.Mesh&&(K.material.side=i.DoubleSide)})}break;case".stl":const E=await b.arrayBuffer(),x=new Lt().parse(E),y=new i.MeshPhongMaterial({color:"#B3B3D4",side:i.DoubleSide});m=new i.Mesh(x,y);break;case".nc":const B=["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"],N={"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)"},S=new i.Group,W=B.map(g=>new Promise((K,oe)=>{new Lt().load(`/model/${g}`,ie=>{const X=new i.MeshPhongMaterial({color:N[g]||"#B3B3D4",side:i.DoubleSide}),R=new i.Mesh(ie,X);K(R)},void 0,oe)}));try{(await Promise.all(W)).forEach(K=>S.add(K)),m=S}catch(g){throw console.error("加载NC文件对应的STL文件失败:",g),new Error("无法加载.NC文件对应的STL文件")}break;case".pcd":const O=new fo,$=new i.Group;try{const g=await new Promise((oe,ce)=>{O.load("/model/final.pcd",ie=>{const X=new Float32Array(ie.geometry.attributes.position.count*3);for(let R=0;R<ie.geometry.attributes.position.count;R++)X[R*3]=1,X[R*3+1]=0,X[R*3+2]=0;ie.geometry.setAttribute("color",new i.BufferAttribute(X,3)),ie.material.vertexColors=!0,ie.scale.set(.3,.3,.3),oe(ie)},void 0,ce)}),K=await new Promise((oe,ce)=>{O.load("/model/target.pcd",ie=>{const X=new Float32Array(ie.geometry.attributes.position.count*3);for(let R=0;R<ie.geometry.attributes.position.count;R++)X[R*3]=0,X[R*3+1]=1,X[R*3+2]=0;ie.geometry.setAttribute("color",new i.BufferAttribute(X,3)),ie.material.vertexColors=!0,ie.scale.set(.3,.3,.3),oe(ie)},void 0,ce)});$.add(g),$.add(K),m=$}catch(g){throw console.error("PCD文件加载失败:",g),new Error("无法加载PCD文件")}break;case".urdf":const ae=await b.text(),me=new go,G=new Map;A.forEach(g=>{G.set(g.name,g.blob)}),me.loadMeshCb=async(g,K,oe,ce,ie)=>{const X=g.split("/").pop(),R=G.get(X);if(!R){ie(new Error(`找不到文件: ${X}`));return}const L=X.split(".").pop().toLowerCase();switch(L){case"stl":const z=await R.arrayBuffer(),D=new Lt(K).parse(z),U=new i.Mesh(D,new i.MeshPhongMaterial);oe(U);break;case"obj":const H=await R.text(),he=new jt(K),ke=X.replace(".obj",".mtl"),le=G.get(ke);if(le){const Re=await le.text(),ze=new Ot(K).parse(Re);ze.preload(),he.setMaterials(ze)}const Ae=he.parse(H);oe(Ae);break;default:ie(new Error(`不支持的文件格式: ${L}`))}},m=me.parse(ae);break;default:throw new Error(`不支持的文件格式: ${j}`)}return m};return{addModelsFromUrls:k,loadModelByDefaultPath:async j=>{console.log(j);try{c.value=!0,u.value="正在加载模型...";const{scene:b}=V();if(!b)throw new Error("Scene not initialized");l(),await new Promise(A=>setTimeout(A,100));const h=[];for(let A=0;A<j.length;A++){const m=j[A],w=await P(m.suffix,m.blob,m.mtlBlobs||[],m.meshFiles||[]);b.add(w),o.value.push(w),h.push(w)}return c.value=!1,u.value="",h}catch(b){throw console.error("加载模型失败:",b),c.value=!1,u.value="",b}}}}const bo={class:"obj-viewer-container"},wo={class:"floating-controls"},_o=["disabled"],ko=["disabled","title"],xo={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Co={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},vo=["disabled"],Eo=["title"],To={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"},Ao={key:0,class:"clipping-panel"},Mo={class:"panel-content"},So={class:"radio-group"},Po={class:"radio-label"},Lo={class:"radio-label"},Bo={class:"radio-label"},Vo={class:"radio-label"},Ro={key:1,class:"loading-overlay"},Do={__name:"threeModel",setup(V,{expose:o}){const c=e.ref(null),u=e.ref(!1),l=e.ref(""),d=e.ref(!1),v=e.ref(!1),{currentModels:p,initialCameraPosition:_,initialTargetPosition:k,initThreeJS:P,handleResize:F,fitCameraToAllModels:j,getThreeJSObjects:b,clearAllModels:h,cleanup:A}=so(c),{isAnimating:m,toggleAnimation:w,stopAnimation:f}=io(b,p),{isClipping:E,activeClippingAxis:T,toggleClipping:x,updateClippingPlanes:y}=ao(b,p),{addModelsFromUrls:B,loadModelByDefaultPath:N}=yo(b,p,u,l,h),S=()=>{if(v.value||p.value.length===0)return;v.value=!0,m.value&&f();const{camera:G,controls:g}=b();if(!G||!g)return;g.enabled=!0;const K=L=>L<.5?4*L*L*L:1-Math.pow(-2*L+2,3)/2,oe=G.position.clone(),ce=g.target.clone(),ie=1500,X=Date.now(),R=()=>{const L=Date.now()-X,z=Math.min(L/ie,1),q=K(z);G.position.lerpVectors(oe,_.value,q),g.target.lerpVectors(ce,k.value,q),z<1?requestAnimationFrame(R):v.value=!1};R()},W=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{d.value=!1,e.nextTick(()=>{F()})}).catch(G=>{console.error("无法退出全屏:",G)}):c.value.requestFullscreen().then(()=>{d.value=!0,e.nextTick(()=>{F()})}).catch(G=>{console.error("无法进入全屏:",G)})},O=()=>{d.value=!!document.fullscreenElement,d.value||e.nextTick(()=>{F()})},$=async(G,g)=>{try{m.value&&f(),E.value&&x();const K=await g(G);return j(),K}catch(K){throw console.error("加载模型失败:",K),K}},ae=async G=>$(G,B),me=async G=>$(G,N);return e.onMounted(async()=>{await e.nextTick(),P(),window.addEventListener("resize",F),document.addEventListener("fullscreenchange",O)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",F),document.removeEventListener("fullscreenchange",O),m.value&&f(),A()}),o({addModelsFromUrls:ae,loadModelByDefaultPath:me}),(G,g)=>(e.openBlock(),e.createElementBlock("div",bo,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:c,class:"threejs-container"},null,512),e.createElementVNode("div",wo,[e.createElementVNode("button",{onClick:S,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:u.value||e.unref(p).length===0||v.value,title:"重置"},g[10]||(g[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,_o),e.createElementVNode("button",{onClick:g[0]||(g[0]=(...K)=>e.unref(w)&&e.unref(w)(...K)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(m)}]),disabled:u.value||e.unref(p).length===0,title:e.unref(m)?"停止动画":"动画视图"},[e.unref(m)?(e.openBlock(),e.createElementBlock("svg",Co,g[12]||(g[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",xo,g[11]||(g[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,ko),e.createElementVNode("button",{onClick:g[1]||(g[1]=(...K)=>e.unref(x)&&e.unref(x)(...K)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(E)}]),disabled:u.value||e.unref(p).length===0,title:"剖面视图"},g[13]||(g[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,vo),e.createElementVNode("button",{onClick:W,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:d.value?"退出全屏":"全屏"},[d.value?(e.openBlock(),e.createElementBlock("svg",No,g[15]||(g[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",To,g[14]||(g[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,Eo)]),e.unref(E)?(e.openBlock(),e.createElementBlock("div",Ao,[e.createElementVNode("div",Mo,[e.createElementVNode("div",So,[e.createElementVNode("label",Po,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":g[2]||(g[2]=K=>e.isRef(T)?T.value=K:null),onChange:g[3]||(g[3]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[16]||(g[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Lo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":g[4]||(g[4]=K=>e.isRef(T)?T.value=K:null),onChange:g[5]||(g[5]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[17]||(g[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Bo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":g[6]||(g[6]=K=>e.isRef(T)?T.value=K:null),onChange:g[7]||(g[7]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[18]||(g[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Vo,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":g[8]||(g[8]=K=>e.isRef(T)?T.value=K:null),onChange:g[9]||(g[9]=(...K)=>e.unref(y)&&e.unref(y)(...K))},null,544),[[e.vModelRadio,e.unref(T)]]),g[19]||(g[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",Ro,[g[20]||(g[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(l.value),1)])):e.createCommentVNode("",!0)]))}},Fo=_t._export_sfc(Do,[["__scopeId","data-v-fa098b89"]]),Io={class:"bread-content"},jo=["onClick"],Oo={key:0,class:"split-title"},Uo={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(V,{emit:o}){const c=V,u=e.ref([]),l=o;e.onMounted(()=>{u.value=c==null?void 0:c.breadArray}),e.watch(()=>c==null?void 0:c.breadArray,()=>{u.value=c==null?void 0:c.breadArray},{deep:!0,immediate:!0});const d=v=>{l("click",v)};return(v,p)=>(e.openBlock(),e.createElementBlock("div",Io,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,(_,k)=>{var P;return e.openBlock(),e.createElementBlock("div",{key:k,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:F=>d(_),style:e.normalizeStyle({opacity:((P=u.value)==null?void 0:P.length)-1===k?"0.7":"1"})},e.toDisplayString(_.value),13,jo),k!==u.value.length-1&&Array.isArray(u.value)?(e.openBlock(),e.createElementBlock("div",Oo,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},yn=_t._export_sfc(Uo,[["__scopeId","data-v-ded7e2bd"]]),zo={class:"item-menu-content"},Go={class:"item-left-content"},Ho={key:0,class:"page-icon"},qo={class:"avatar"},$o={style:{display:"flex"}},Yo={class:"select-icon"},Wo={key:0,class:"model-operate",style:{width:"0px"}},Ko={class:"model-select"},Zo={class:"model-fill"},Jo={key:1,class:"show-main-content"},Xo={class:"show-content"},Qo={class:"item-view-group"},es={class:"show-item-content"},ts={class:"item-view-group"},ns={key:2,class:"show-main-content"},os={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(V,{emit:o}){const c=fn.useLoginState(),{loginUserInfo:u,cryptoInfo:l}=pe.storeToRefs(c);e.onMounted(()=>{mn.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const d=i.useModelComp(tt.pinia);i.useFormToTableComp(tt.pinia),e.ref(!0);const v=pe.useMenuState();e.ref(!0);const{itemData:p,isEdit:_,isRefreshCurStructure:k,curStructureCompIds:P}=pe.storeToRefs(d),F=i.useUnit(tt.pinia),{activeMenuPath:j,menus:b,importLoading:h}=pe.storeToRefs(v),{selectIndex:A,selectTitle:m}=pe.storeToRefs(F);return e.ref([]),e.ref(!1),(w,f)=>{const E=e.resolveComponent("el-aside"),T=e.resolveComponent("el-button"),x=e.resolveComponent("el-avatar"),y=e.resolveComponent("el-header"),B=e.resolveComponent("router-view"),N=e.resolveComponent("el-main"),S=e.resolveComponent("el-container"),W=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(S,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(_)==="view"?(e.openBlock(),e.createBlock(E,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(S,null,{default:e.withCtx(()=>[e.createVNode(y,null,{default:e.withCtx(()=>{var O;return[e.createElementVNode("div",zo,[e.createElementVNode("div",Go,[e.unref(_)==="edit"?(e.openBlock(),e.createElementBlock("div",Ho,[e.createVNode(T,{text:"",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>f[2]||(f[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(T,{text:"",onClick:f[0]||(f[0]=$=>{var ae,me;return e.unref(ue.clickSavePage)((me=(ae=e.unref(m))==null?void 0:ae.map(G=>G.value))==null?void 0:me.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[f[3]||(f[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(yn,{key:e.unref(m),breadArray:e.unref(m),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",qo,[e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:f[1]||(f[1]=(...$)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...$))},[e.createElementVNode("div",$o,[e.createVNode(mt.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),f[4]||(f[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Yo,[e.renderSlot(w.$slots,"default",{},void 0,!0)]),e.createVNode(x,{size:35,src:(O=e.unref(u))==null?void 0:O.avatarUrl},{default:e.withCtx(()=>{var $;return[e.createTextVNode(e.toDisplayString((($=e.unref(u))==null?void 0:$.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(N,null,{default:e.withCtx(()=>{var O,$,ae,me;return[e.unref(_)==="edit"?(e.openBlock(),e.createElementBlock("div",Wo,[e.createElementVNode("div",Ko,[e.createVNode(ct.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:w.innerWidth},[e.createVNode(ct.modelShow)])),e.createElementVNode("div",Zo,[e.createVNode(ct.modelFill)])])):w.$route.path==="/"&&((O=e.unref(ue.showItems))==null?void 0:O.length)>0&&e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",Jo,[e.createElementVNode("div",Xo,[($=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))!=null&&$.find(G=>G.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:w.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ae=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:ae.filter(G=>G.comp==="FormTop"),(G,g)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:g},[e.createElementVNode("div",Qo,e.toDisplayString(G.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(G.comp)),{itemData:G==null?void 0:G.compData,childItemData:G==null?void 0:G.itemChildData,key:(G==null?void 0:G.id)??g,onChange:e.unref(ue.onChange),index:(G==null?void 0:G.id)??g,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",es,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((me=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:me.filter(G=>G.comp!=="FormTop"),(G,g)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:g},[e.createElementVNode("div",ts,e.toDisplayString(G.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(G.comp)),{itemData:G==null?void 0:G.compData,childItemData:G==null?void 0:G.itemChildData,key:(G==null?void 0:G.id)??g,onChange:e.unref(ue.onChange),index:(G==null?void 0:G.id)??g,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(_)==="view"?(e.openBlock(),e.createElementBlock("div",ns,[e.createVNode(B)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[W,e.unref(h)]])}}},ss=_t._export_sfc(os,[["__scopeId","data-v-d2611062"]]);function is(V,o,c,u,l,d){const v=e.resolveComponent("svg-icon"),p=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(p,{mode:V.mode,menuList:V.renderMenuList,onClickMenu:V.clickMenu,onOpenMenu:V.openMenu,onCloseMenu:V.closeMenu},{title:e.withCtx(({menu:_})=>[e.createVNode(v,{name:_.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(_.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const as=_t._export_sfc(ue._sfc_main,[["render",is],["__scopeId","data-v-e003bdbb"]]),ye=[{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"}],Et=[{key:"型线生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources/sampling_points_20.cpt"},{key:"曲面生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources/output.obj"},{key:"叶片生成",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources/output_TwoSections_completed.obj"},{key:"轨迹规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources/complete_data.txt"},{key:"加工规划",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources/NC_BC.NC"},{key:"产品检测",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/source.pcd,http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35459977498949/outputResources/target.pcd"},{key:"参数筛选训练方法",value:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources/fitness_iteration.png"}],rs={class:"structure-buttons"},ls={class:"structure-paths"},cs={class:"client-header-user"},ds={class:"select-icon"},us={class:"model-select"},hs={class:"model-show"},ps={class:"model-fill"},fs={class:"client-header-logo"},ms={class:"client-header-menu"},gs={class:"client-header-user"},ys={style:{display:"flex"}},bs={class:"select-icon"},ws={class:"client-main-content"},_s={key:0,class:"item-view-group"},ks={key:0,class:"calculator"},xs={key:1,class:"calculator"},Cs={class:"router-aside"},vs=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(V){const o=i.useUnit(tt.pinia),c=e.ref(0),u=e.ref(!1),{selectTitle:l}=pe.storeToRefs(o),d=e.ref(!1),v=e.ref(!1),p=e.ref(!1),_=i.useTableComp(tt.pinia),k=e.ref(!1),{tableShowThree:P}=pe.storeToRefs(_),F=fn.useLoginState(),{loginUserInfo:j}=pe.storeToRefs(F),b=i.useModelComp(tt.pinia),{isEdit:h}=pe.storeToRefs(b),A=pe.useMenuState(tt.pinia),m=Gn.useFormComp(tt.pinia),{objUrl:w,blobUrls:f}=pe.storeToRefs(m),E=e.ref(null),T=e.ref(!0),x=e.ref(!1),{importLoading:y,activeMenuPath:B,platName:N}=pe.storeToRefs(A),S=e.ref(!1);e.watch(()=>B.value,async R=>{R&&(S.value=!0),Et!=null&&Et.find(L=>{var z;return(L==null?void 0:L.key)===((z=R==null?void 0:R.split("/"))==null?void 0:z[(R==null?void 0:R.split("/").length)-1])})?k.value=!0:k.value=!1},{immediate:!0});const W=async()=>{var U,H,he,ke,le;x.value=!0;const R=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken");let L=((he=(H=(U=Et==null?void 0:Et.find(Ae=>{var Re,De,ze;return(Ae==null?void 0:Ae.key)===((ze=(Re=B.value)==null?void 0:Re.split("/"))==null?void 0:ze[((De=B.value)==null?void 0:De.split("/").length)-1])}))==null?void 0:U.value)==null?void 0:H.split(","))==null?void 0:he[0])??"";const z=await pe.axios.post(L,null,{responseType:"blob",headers:{Authorization:R,"Content-Type":"application/json"}}),q=new Blob([z.data],{type:"application/octet-stream;charset=UTF-8"});let D={suffix:"."+((le=L==null?void 0:L.split("."))==null?void 0:le[((ke=L==null?void 0:L.split("."))==null?void 0:ke.length)-1]),blob:q,mtlBlobs:[]};x.value=!1,E.value.loadModelByDefaultPath([D])},O=async R=>{var q,D,U,H,he,ke,le;const L=(q=R==null?void 0:R.split("/"))==null?void 0:q[0],z=await pe.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:L}});return((D=z==null?void 0:z.data)==null?void 0:D.type)==="success"?((le=(ke=(he=(H=(U=z==null?void 0:z.data)==null?void 0:U.result)==null?void 0:H[0])==null?void 0:he.value)==null?void 0:ke.tableData)==null?void 0:le.隐藏三维显示)!==!0:!0};e.watch(()=>ue.showItems.value,()=>{var R,L,z,q,D;if(((R=ue.showItems.value)==null?void 0:R.length)===2&&((L=ue.showItems.value)!=null&&L.find(U=>(U==null?void 0:U.name)==="输入"))&&((z=ue.showItems.value)!=null&&z.find(U=>(U==null?void 0:U.name)==="输出"))){const U=(q=ue.showItems.value)==null?void 0:q.find(H=>(H==null?void 0:H.name)==="输出");v.value=((D=U==null?void 0:U.comp)==null?void 0:D.toUpperCase())==="FORM",d.value=!0}else d.value=!1,v.value=!1},{deep:!0,immediate:!0}),e.watch(()=>B.value,async()=>{B.value&&(T.value=await O(B.value))},{deep:!0,immediate:!0}),e.watch(()=>[w.value,E.value],()=>{var R;((R=w.value)==null?void 0:R.length)>0&&E.value&&E.value.addModelsFromUrls(w.value)},{immediate:!0,deep:!0}),e.watch(()=>f==null?void 0:f.value,async()=>{var R,L,z,q;if(f!=null&&f.value&&((R=f==null?void 0:f.value)==null?void 0:R.length)>0&&!k.value&&!((L=ue.showItems.value)!=null&&L.find(D=>(D==null?void 0:D.name)==="输入")&&((z=ue.showItems.value)!=null&&z.find(D=>(D==null?void 0:D.name)==="输出")))){let D=[];const U=await((q=gt.cloneDeep(f==null?void 0:f.value))==null?void 0:q.map(async H=>{var Re,De,ze,Se,de,qe,Ye,Je,st,nt;let he,ke;const le=(De=(Re=H==null?void 0:H.blob)==null?void 0:Re.split("undefined,"))==null?void 0:De[1];let Ae=le==null?void 0:le.split(",");if((Ae==null?void 0:Ae.length)>1){let We=await(Ae==null?void 0:Ae.map(async Me=>{var Ee,dt,Xe,Fe,ge,$e;he=await pe.axios.get(Me,{responseType:"blob",headers:{"Content-Type":"application/json"}});let Be=[];if(((Ee=H==null?void 0:H.mtlBlobs)==null?void 0:Ee.length)>0){let ut=await((dt=H==null?void 0:H.mtlBlobs)==null?void 0:dt.map(async Ne=>{let it=await pe.axios.get(Ne,{responseType:"blob",headers:{"Content-Type":"application/json"}});return Be.push(new Blob([it.data],{type:"application/octet-stream;charset=UTF-8"})),it}));await Promise.all(ut)}return((Fe=Me==null?void 0:Me.split("."))==null?void 0:Fe[((Xe=Me==null?void 0:Me.split("."))==null?void 0:Xe.length)-1])!=="undefined"&&D.push({suffix:"."+(($e=Me==null?void 0:Me.split("."))==null?void 0:$e[((ge=Me==null?void 0:Me.split("."))==null?void 0:ge.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:Be}),he}));await Promise.all(We)}else if(!(le!=null&&le.includes("https://"))&&!(le!=null&&le.includes("http://"))){he=await Gt.downloadAvatarApi({url:le});let We=[];if(((ze=H==null?void 0:H.mtlBlobs)==null?void 0:ze.length)>0){let Me=await((Se=H==null?void 0:H.mtlBlobs)==null?void 0:Se.map(async Be=>{let Ee=await Gt.downloadAvatarApi({url:Be});return We.push(new Blob([Ee.data],{type:"application/octet-stream;charset=UTF-8"})),Ee}));await Promise.all(Me)}ke={suffix:"."+((qe=le==null?void 0:le.split("."))==null?void 0:qe[((de=le==null?void 0:le.split("."))==null?void 0:de.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:We}}else{he=await pe.axios.get(le,{responseType:"blob",headers:{"Content-Type":"application/json"}});let We=[];if(((Ye=H==null?void 0:H.mtlBlobs)==null?void 0:Ye.length)>0){let Me=await((Je=H==null?void 0:H.mtlBlobs)==null?void 0:Je.map(async Be=>{let Ee=await pe.axios.get(Be,{responseType:"blob",headers:{"Content-Type":"application/json"}});return We.push(new Blob([Ee.data],{type:"application/octet-stream;charset=UTF-8"})),Ee}));await Promise.all(Me)}ke={suffix:"."+((nt=le==null?void 0:le.split("."))==null?void 0:nt[((st=le==null?void 0:le.split("."))==null?void 0:st.length)-1]),blob:new Blob([he.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:We}}ke&&D.push(ke)}));await Promise.all(U),E.value.loadModelByDefaultPath(D)}},{immediate:!0,deep:!0}),e.watch(()=>P.value,async()=>{var L,z,q,D;if(P.value!==""&&P.value){let U=(L=B.value)==null?void 0:L.split("/"),H=U[(U==null?void 0:U.length)-2];const ke=(((z=ye==null?void 0:ye.find(De=>(De==null?void 0:De.key)===H))==null?void 0:z.download)??"")+"/"+P.value,le=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ae=await pe.axios.post(ke,null,{responseType:"blob",headers:{Authorization:le,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var R=new Blob([Ae.data],{type:"application/octet-stream;charset=UTF-8"});const Re=[{suffix:"."+((D=(q=P.value)==null?void 0:q.split("."))==null?void 0:D[1]),blob:R,mtlBlobs:[]}];E.value.loadModelByDefaultPath(Re)}},{deep:!0,immediate:!0});const $=async()=>{var he,ke,le,Ae,Re,De,ze,Se,de,qe,Ye,Je,st,nt,We,Me,Be;u.value=!0;let R=(he=B.value)==null?void 0:he.split("/"),L=R[(R==null?void 0:R.length)-2];const z=((ke=ye==null?void 0:ye.find(Ee=>(Ee==null?void 0:Ee.key)===L))==null?void 0:ke.value)??"";let q="";const D=await pe.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((le=D==null?void 0:D.data)==null?void 0:le.code)===200&&(q=`Bearer ${(Re=(Ae=D.data)==null?void 0:Ae.result)==null?void 0:Re.accessToken}`,sessionStorage.setItem("magicToken",q));const U=q===""?"123456":q,H=await pe.axios.post(z,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((De=H==null?void 0:H.data)==null?void 0:De.type)==="success"&&i.IsJson((Se=(ze=H==null?void 0:H.data)==null?void 0:ze.result)==null?void 0:Se.result)){const Ee=(st=(Je=(Ye=JSON.parse((qe=(de=H==null?void 0:H.data)==null?void 0:de.result)==null?void 0:qe.result))==null?void 0:Ye.lines_file_paths)==null?void 0:Je[0])==null?void 0:st.split("\\"),Xe=(((nt=ye==null?void 0:ye.find(ge=>(ge==null?void 0:ge.key)===L))==null?void 0:nt.resources)??"")+"/"+(((Ee==null?void 0:Ee[(Ee==null?void 0:Ee.length)-2])==="inputResources"?"outputResources":Ee==null?void 0:Ee[(Ee==null?void 0:Ee.length)-2])??"outputResources"),Fe=await pe.axios.post(Xe,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=Fe==null?void 0:Fe.data)==null?void 0:We.type)==="success"){const ge=(Me=Fe==null?void 0:Fe.data)==null?void 0:Me.result,$e=ue.showItems.value,ut=await((Be=gt.cloneDeep($e))==null?void 0:Be.map(async Ne=>{var it,yt,bt,Ie,xe,ot;if((Ne==null?void 0:Ne.name)==="输出"){if((Ne==null?void 0:Ne.comp)==="Table")Ne.compData=(it=Ne==null?void 0:Ne.compData)==null?void 0:it.map(fe=>{var Ce,Ge;return(fe==null?void 0:fe.key)==="tableContents"&&(fe.contents=(Ge=(Ce=fe==null?void 0:fe.contents)==null?void 0:Ce.map(Pe=>(Pe=Pe==null?void 0:Pe.map((be,je)=>{var Ve,at,He;return typeof be=="string"&&je>1?((Ve=fe==null?void 0:fe.contents)==null?void 0:Ve.length)>1?be=((at=ge==null?void 0:ge[je-1])!=null&&at.includes("input")?be:ge==null?void 0:ge[je-1])??be:be=ge==null?void 0:ge[0]:be=((He=ge==null?void 0:ge[je-1])!=null&&He.includes("input")?be:ge==null?void 0:ge[je-1])??be,be}),Pe)))==null?void 0:Ge.filter((Pe,be)=>be<=(ge==null?void 0:ge.length)-1)),fe});else if((Ne==null?void 0:Ne.comp)==="Form"){let fe="";if(ge==null||ge.forEach(Ce=>{fe=fe===""?fe+Ce:fe+","+Ce}),Ne.compData=(yt=Ne==null?void 0:Ne.compData)==null?void 0:yt.map(Ce=>{var Ge;return(Ce==null?void 0:Ce.key)==="formContent"&&(Ce.contents=(Ge=Ce.contents)==null?void 0:Ge.map(Pe=>(Pe.value=fe,Pe))),Ce}),(bt=fe==null?void 0:fe.split(","))!=null&&bt.find(Ce=>Ce.includes(".obj"))){let Ce={};Ce.suffix=".obj";const Ge=[];let Pe=await((xe=(Ie=fe==null?void 0:fe.split(","))==null?void 0:Ie.filter(be=>be.includes(".obj")||be.includes(".mtl")))==null?void 0:xe.map(async be=>{var Ve,at;if(be.includes(".obj")){const ht=(((Ve=ye==null?void 0:ye.find(rt=>(rt==null?void 0:rt.key)===L))==null?void 0:Ve.download)??"")+"/"+be,pt=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ft=await pe.axios.post(ht,null,{responseType:"blob",headers:{Authorization:pt,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var je=new Blob([ft.data],{type:"application/octet-stream;charset=UTF-8"});Ce.blob=je}else if(be.includes(".mtl")){const ht=(((at=ye==null?void 0:ye.find(Tt=>(Tt==null?void 0:Tt.key)===L))==null?void 0:at.download)??"")+"/"+be,pt=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ft=await pe.axios.post(ht,null,{responseType:"blob",headers:{Authorization:pt,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var je=new Blob([ft.data],{type:"application/octet-stream;charset=UTF-8"});Ge.push(je)}}));await Promise.all(Pe),Ce.mtlBlobs=Ge,E.value.loadModelByDefaultPath([Ce])}else{const Ce=[];let Ge=await((ot=fe==null?void 0:fe.split(","))==null?void 0:ot.map(async Pe=>{var pt,ft;let be={};be.suffix="."+((pt=Pe==null?void 0:Pe.split("."))==null?void 0:pt[1]);const Ve=(((ft=ye==null?void 0:ye.find(rt=>(rt==null?void 0:rt.key)===L))==null?void 0:ft.download)??"")+"/"+Pe,at=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),He=await pe.axios.post(Ve,null,{responseType:"blob",headers:{Authorization:at,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var ht=new Blob([He.data],{type:"application/octet-stream;charset=UTF-8"});be.blob=ht,Ce.push(be)}));await Promise.all(Ge),E.value.loadModelByDefaultPath(Ce)}}}return Ne}));ue.showItems.value=await Promise.all(ut)}}c.value++,u.value=!1},ae=e.ref(""),me=e.ref("open"),G=e.ref("open"),g=e.ref(!1),K=()=>{const R=document.getElementById("menuCollapse");me.value==="open"?(R.style.width="18.75rem",R.style.height="96%",R.style.overflow="auto"):(R.style.width="50px",R.style.height="50px",R.style.overflow="hidden")},oe=()=>{const R=document.getElementById("operateCollapse");G.value==="open"?(R.style.width="25rem",R.style.height="96%",R.style.overflow="auto"):(R.style.width="50px",R.style.height="50px",R.style.overflow="hidden")},ce=()=>{g.value=!g.value;const R=document.getElementById("operateCollapse"),L=document.getElementById("menuCollapse");g.value?(L.style.width="18.75rem",R.style.width="calc(100% - 24rem)"):R.style.width="400px"},ie=R=>{const L=URL.createObjectURL(R),z=document.createElement("a");z.href=L,z.download="file.txt",document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(L),p.value=!1},X=async()=>{var he,ke,le,Ae,Re,De,ze,Se,de,qe,Ye,Je,st,nt,We,Me;p.value=!0;let R=(he=B.value)==null?void 0:he.split("/"),L=R[(R==null?void 0:R.length)-2];const z=((ke=ye==null?void 0:ye.find(Be=>(Be==null?void 0:Be.key)===L))==null?void 0:ke.value)??"";let q="";const D=await pe.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});if(((le=D==null?void 0:D.data)==null?void 0:le.code)===200)q=`Bearer ${(Re=(Ae=D.data)==null?void 0:Ae.result)==null?void 0:Re.accessToken}`,sessionStorage.setItem("magicToken",q);else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了");const U=q===""?"123456":q,H=await pe.axios.post(z,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((De=H==null?void 0:H.data)==null?void 0:De.code)===200){if(i.IsJson((Se=(ze=H==null?void 0:H.data)==null?void 0:ze.result)==null?void 0:Se.result)){const Be=(st=(Je=(Ye=JSON.parse((qe=(de=H==null?void 0:H.data)==null?void 0:de.result)==null?void 0:qe.result))==null?void 0:Ye.lines_file_paths)==null?void 0:Je[0])==null?void 0:st.split("\\"),dt=(((nt=ye==null?void 0:ye.find(Fe=>(Fe==null?void 0:Fe.key)===L))==null?void 0:nt.resources)??"")+"/"+((Be==null?void 0:Be[(Be==null?void 0:Be.length)-2])??"outputResources"),Xe=await pe.axios.post(dt,null,{headers:{Authorization:U,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((We=Xe==null?void 0:Xe.data)==null?void 0:We.code)===200){const Fe=(Me=Xe==null?void 0:Xe.data)==null?void 0:Me.result,ge=gt.cloneDeep(ue.showItems.value);ge==null||ge.map(async $e=>{var ut,Ne,it,yt,bt;if(($e==null?void 0:$e.name)==="输出"&&($e==null?void 0:$e.comp)==="Form"){let Ie="";Fe==null||Fe.forEach(xe=>{Ie=Ie===""?Ie+xe:Ie+","+xe}),$e.compData=(ut=$e==null?void 0:$e.compData)==null?void 0:ut.map(xe=>{var ot;return(xe==null?void 0:xe.key)==="formContent"&&(xe.contents=(ot=xe.contents)==null?void 0:ot.map(fe=>(fe.value=Ie,fe))),xe}),(Ne=Ie==null?void 0:Ie.split(","))!=null&&Ne.find(xe=>xe.includes(".obj"))?(yt=(it=Ie==null?void 0:Ie.split(","))==null?void 0:it.filter(xe=>xe.includes(".obj")||xe.includes(".mtl")))==null||yt.map(async xe=>{var ot,fe;if(xe.includes(".obj")){const Ge=(((ot=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:ot.download)??"")+"/"+xe,Pe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await pe.axios.post(Ge,null,{responseType:"blob",headers:{Authorization:Pe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});ie(je)}else if(xe.includes(".mtl")){const Ge=(((fe=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:fe.download)??"")+"/"+xe,Pe=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await pe.axios.post(Ge,null,{responseType:"blob",headers:{Authorization:Pe,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let je=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});ie(je)}}):(bt=Ie==null?void 0:Ie.split(","))==null||bt.map(async xe=>{var be,je;""+((be=xe==null?void 0:xe.split("."))==null?void 0:be[1]);const fe=(((je=ye==null?void 0:ye.find(Ve=>(Ve==null?void 0:Ve.key)===L))==null?void 0:je.download)??"")+"/"+xe,Ce=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ge=await pe.axios.post(fe,null,{responseType:"blob",headers:{Authorization:Ce,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});let Pe=new Blob([Ge.data],{type:"application/octet-stream;charset=UTF-8"});ie(Pe)})}})}else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了")}}else throw pe.ElMessage.error("响应出错了"),new Error("响应出错了")};return(R,L)=>{const z=e.resolveComponent("el-button"),q=e.resolveComponent("el-avatar"),D=e.resolveComponent("el-header"),U=e.resolveComponent("el-container"),H=e.resolveComponent("el-icon"),he=e.resolveComponent("el-input"),ke=e.resolveComponent("el-aside"),le=e.resolveComponent("el-collapse-item"),Ae=e.resolveComponent("el-collapse"),Re=e.resolveComponent("el-main"),De=e.resolveComponent("router-view"),ze=e.resolveDirective("loading");return e.unref(h)==="edit"?(e.openBlock(),e.createBlock(U,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(D,{class:"client-structure-header"},{default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",rs,[e.createVNode(z,{class:"select-icon",onClick:e.unref(ue.onBack)},{default:e.withCtx(()=>L[6]||(L[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(z,{class:"select-icon",onClick:L[0]||(L[0]=de=>{var qe,Ye;return e.unref(ue.clickSavePage)((Ye=(qe=e.unref(l))==null?void 0:qe.map(Je=>Je.value))==null?void 0:Ye.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[L[7]||(L[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",ls,[(e.openBlock(),e.createBlock(yn,{key:e.unref(l),breadArray:e.unref(l),onClick:e.unref(ue.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",cs,[e.createElementVNode("div",ds,[e.renderSlot(R.$slots,"default",{},void 0,!0)]),e.createVNode(q,{size:35,src:(Se=e.unref(j))==null?void 0:Se.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(j))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(h)==="edit"?(e.openBlock(),e.createBlock(U,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",us,[e.createVNode(ct.modelSelect)]),e.createElementVNode("div",hs,[e.createVNode(ct.modelShow)]),e.createElementVNode("div",ps,[e.createVNode(ct.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(U,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(D,{class:"client-header"},{default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",fs,[e.createVNode(mt.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(N)===""?"CPMPIP":e.unref(N)),1)]),e.createElementVNode("div",ms,[e.createVNode(as,{mode:"horizontal"})]),e.createElementVNode("div",gs,[e.createVNode(he,{modelValue:ae.value,"onUpdate:modelValue":L[1]||(L[1]=de=>ae.value=de),clearable:"",placeholder:"搜索",style:{width:"130px"}},{prefix:e.withCtx(()=>[e.createVNode(H,{class:"el-input__icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(mn.search_default))]),_:1})]),_:1},8,["modelValue"]),e.unref(h)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:L[2]||(L[2]=(...de)=>e.unref(ue.onSelectFixContent)&&e.unref(ue.onSelectFixContent)(...de))},[e.createElementVNode("div",ys,[e.createVNode(mt.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),L[8]||(L[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",bs,[e.renderSlot(R.$slots,"default",{},void 0,!0)]),e.createVNode(q,{size:35,src:(Se=e.unref(j))==null?void 0:Se.avatarUrl},{default:e.withCtx(()=>{var de;return[e.createTextVNode(e.toDisplayString(((de=e.unref(j))==null?void 0:de.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(U,{class:"client-body"},{default:e.withCtx(()=>[R.$route.path==="/"?(e.openBlock(),e.createBlock(Re,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(Ae,{modelValue:me.value,"onUpdate:modelValue":L[3]||(L[3]=Se=>me.value=Se),accordion:"",class:"client-aside",id:"menuCollapse",onChange:K},{default:e.withCtx(()=>[e.createVNode(le,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:me.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(ke,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",ws,[e.createVNode(Fo,{isShow:S.value,windowConfig:V.windowConfig,ref_key:"threeModelRef",ref:E},null,8,["isShow","windowConfig"])]),e.createVNode(Ae,{modelValue:G.value,"onUpdate:modelValue":L[5]||(L[5]=Se=>G.value=Se),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:oe},{default:e.withCtx(()=>[e.createVNode(le,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(mt.SvgIcon,{name:G.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var Se;return[e.createElementVNode("div",null,[e.createVNode(mt.SvgIcon,{class:"fold-icon",name:g.value?"Right":"Left",onClick:ce},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Se=e.unref(gt.cloneDeep)(e.unref(ue.showItems)))==null?void 0:Se.filter(de=>de.comp!=="FormTop"),(de,qe)=>{var Ye;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:qe},[((Ye=de==null?void 0:de.comp)==null?void 0:Ye.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",_s,e.toDisplayString(de.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(ue.getComponents)(de.comp)),{compName:de.name,itemData:de==null?void 0:de.compData,childItemData:de==null?void 0:de.itemChildData,key:(de==null?void 0:de.id)??qe,onChange:e.unref(ue.onChange),index:(de==null?void 0:de.id)??qe,onContentChange:e.unref(ue.onContentChange),onPageChange:e.unref(ue.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),d.value?(e.openBlock(),e.createElementBlock("div",ks,[v.value?(e.openBlock(),e.createBlock(Dt._sfc_main,{key:0,class:"calculator-content",onClickTrigger:X,loading:p.value,modelValue:"预览"},null,8,["loading"])):e.createCommentVNode("",!0),e.createVNode(Dt._sfc_main,{class:"calculator-content",onClickTrigger:L[4]||(L[4]=de=>$()),loading:u.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0),k.value?(e.openBlock(),e.createElementBlock("div",xs,[e.createVNode(Dt._sfc_main,{class:"calculator-content",modelValue:"执行方法",onClickTrigger:W,loading:x.value},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(Re,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",Cs,[e.createVNode(ke,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(zt.default,{mode:"vertical"})]),_:1})]),e.createVNode(Re,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(De)]),_:1})]),_:1}))]),_:1})]),_:3})),[[ze,e.unref(y)]])}}}),Es=_t._export_sfc(vs,[["__scopeId","data-v-590e6be7"]]),Ts={class:"system-wrap"},Ns={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(V){const o=i.useModelComp(tt.pinia),c=i.useUnit(tt.pinia),u=pe.useMenuState();e.ref(!1);const l=e.ref(!0),d=V,v=e.computed(()=>(d==null?void 0:d.platform)==="browser"?[{name:"--ssbutton-theme-color",value:"#fff"},{name:"--ssbutton-theme-bg",value:"var(--ssComponent-primary-color)"}]:[{name:"--ssbutton-theme-color",value:"#323333"},{name:"--ssbutton-theme-bg",value:"#72B02D"}]),p=_=>{const k=document.documentElement;_==null||_.forEach(P=>{k.style.setProperty(P.name,P.value)})};return e.watch(()=>d.platform,(_,k)=>{_&&p(v.value)},{immediate:!0}),e.watch(()=>[d==null?void 0:d.content,d==null?void 0:d.jsonContents],async()=>{var P,F,j,b;if(((P=d==null?void 0:d.jsonContents)==null?void 0:P.length)>0){o.setOriginalData(d==null?void 0:d.jsonContents);return}if(!(d!=null&&d.content)||((F=d==null?void 0:d.content)==null?void 0:F.length)===0)return;l.value=!0,u.setImportLoading(!0);let _=[],k=[];c.setSelectTitle([]),c.setSelectIndex(""),c.setSelectMenu(""),(b=(j=d==null?void 0:d.content)==null?void 0:j.filter(h=>h!==""))==null||b.forEach(h=>{wt.isExpandStringToJson(h)?k.push(wt.expandStringToJson(h)):wt.expandNewStringToJson(h)?k.push(wt.expandNewStringToJson(h)):wt.expandContentStringToJson(h)?k.push(wt.expandContentStringToJson(h)):k.push(ue.expandToNewContents(h))}),_=k==null?void 0:k[0],await ue.savePageDataAsync(_),await i.loadingSystemType(),o.setOriginalData(_),u.setImportLoading(!1)},{deep:!0,immediate:!0}),(_,k)=>(e.openBlock(),e.createElementBlock("div",Ts,[V.platform==="browser"?(e.openBlock(),e.createBlock(ss,{key:0},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Es,{key:1,windowConfig:V.windowConfig},{default:e.withCtx(()=>[e.renderSlot(_.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},As=_t._export_sfc(Ns,[["__scopeId","data-v-136f5a47"]]),Ms={class:"add-model-content"},Ss={key:0,class:"model-operate"},Ps={class:"model-select"},Ls={class:"model-fill"},Bs={key:1,class:"model-view"},Vs={key:0,class:"model-import-data"},Rs={__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(V,{emit:o}){const c=V,u=o,l=e.ref([]),d=e.ref([]),v=e.ref([]),p=e.ref(0),_=i.useModelComp(tt.pinia),k=pe.useMenuState(tt.pinia),{itemData:P,originalData:F}=pe.storeToRefs(_),{activeMenuPath:j,platform:b}=pe.storeToRefs(k),h=e.ref(null),A=e.ref(0),m=e.ref([]);e.ref("");const w=e.ref(0),f=y=>{u("contentChange",y)},E=y=>{var N;const B=(N=gt.cloneDeep(y==null?void 0:y.wholeValue))==null?void 0:N.map(S=>{var W;return(S==null?void 0:S.comp)==="Form"&&(S.compData=(W=S.compData)==null?void 0:W.map(O=>((O==null?void 0:O.key)==="formContent"&&(O.contents=wt.arrayToNumberArray(O==null?void 0:O.contents)),O))),S});u("change",{originalContents:F.value,currentContents:y==null?void 0:y.wholeValue,editContent:y==null?void 0:y.editValue,arrayToContents:B})};e.watch(()=>d.value,()=>{w.value===d.value.length&&d.value.length!==0&&(l.value=d.value)},{deep:!0,immediate:!0});const T=()=>{h.value.click()},x=async y=>{const B=y.target.files;if(!B)return;new FileReader,l.value=[],d.value=[],w.value=B.length;const N=Array.from(B).map(async S=>await new Promise(W=>{const O=new FileReader;O.onload=$=>{try{d.value.push($.target.result),A.value++}catch(ae){console.error("解析失败:",ae);return}},O.onerror=()=>W(`读取 ${S.name} 失败`),O.readAsText(S),y.target.value="",h.value=null}));await Promise.all(N)};return e.watch(()=>[c==null?void 0:c.content,c==null?void 0:c.jsonContents],async()=>{await i.loadingSystemType(),l.value=c.content,v.value=c==null?void 0:c.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>A.value,()=>{var y;((y=m.value)==null?void 0:y.length)!==0&&(_.setOriginalData(m.value),_.setItemData(m.value))},{deep:!0,immediate:!0}),(y,B)=>{const N=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",Ms,[(c==null?void 0:c.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Ss,[e.createElementVNode("div",Ps,[e.createVNode(ct.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:p.value},[e.createVNode(ct.modelShow)])),e.createElementVNode("div",Ls,[e.createVNode(ct.modelFill)])])):e.createCommentVNode("",!0),(c==null?void 0:c.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Bs,[(e.openBlock(),e.createBlock(As,{platform:e.unref(b),content:l.value,onChange:E,jsonContents:v.value,onContentChange:f,key:p.value},{default:e.withCtx(()=>{var S;return[((S=c==null?void 0:c.jsonContents)==null?void 0:S.length)===0&&(c!=null&&c.showButton)?(e.openBlock(),e.createElementBlock("div",Vs,[e.createElementVNode("div",{class:"import-button",onClick:T},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:h,accept:".txt, .inm",onChange:x,style:{display:"none"},multiple:""},null,544),e.createVNode(N,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),B[0]||(B[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Ds=_t._export_sfc(Rs,[["__scopeId","data-v-62633fa4"]]);exports.default=Ds;