const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CDrXokXW.js","./index-DWyDLubb.js","./index-CyHPbdIk.css"])))=>i.map(i=>d[i]);
import{R as P,aa as I,y as M,w as a,a as R,T as V,a5 as g,u as o,W as x,af as A,x as u}from"./index-DWyDLubb.js";import{d as O}from"./i18n-Dnhn5Rxr.js";var E=x("<canvas></canvas>");function S(h,r){P(r,!0);let d,w=g(()=>r.value.url),l,n=o(void 0),s=o(void 0),f=o(!1);I(()=>((async()=>(d=await A(()=>import("./index-CDrXokXW.js").then(t=>t.cx),__vite__mapDeps([0,1,2]),import.meta.url),d.CreateViewerForCanvas(l,{clearColor:r.clear_color,useRightHandedSystem:!0,animationAutoPlay:!0,cameraAutoOrbit:{enabled:!1},onInitialized:t=>{u(s,t,!0)}}).then(t=>{u(n,t,!0),u(f,!0)})))(),()=>{a(n)?.dispose()})),M(()=>{a(f)&&b(a(w))});function c(e,t){a(s)&&(a(s).scene.forcePointsCloud=e,a(s).scene.forceWireframe=t)}function b(e){a(n)&&(e?a(n).loadModel(e,{pluginOptions:{obj:{importVertexColors:!0}}}).then(()=>{r.display_mode==="point_cloud"?c(!0,!1):r.display_mode==="wireframe"?c(!1,!0):m(r.camera_position,r.zoom_speed,r.pan_speed)}):a(n).resetModel())}function m(e,t,y){if(!a(s))return;const i=a(s).camera;e[0]!==null&&(i.alpha=e[0]*Math.PI/180),e[1]!==null&&(i.beta=e[1]*Math.PI/180),e[2]!==null&&(i.radius=e[2]),i.lowerRadiusLimit=.1;const v=()=>{i.wheelPrecision=250/(i.radius*t),i.panningSensibility=1e4*y/i.radius};v(),i.onAfterCheckInputsObservable.add(v)}function p(){a(s)&&a(n)&&a(n).resetCamera()}var C={update_camera:m,reset_camera_position:p},_=E();return O(_,e=>l=e,()=>l),R(h,_),V(C)}export{S as default};
