leiting-bim 2.1.147 → 2.1.149

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.
@@ -95,7 +95,7 @@
95
95
  from { transform: rotate(0deg); }
96
96
  to { transform: rotate(360deg); }
97
97
  }
98
- `;rn=document.createElement("style"),rn.textContent=i,document.head.appendChild(rn)}function ay(){if(sl)return;ry(),ye=document.createElement("div"),ye.className="tech-alert-wrapper",(Ts||document.body).appendChild(ye);const e={setup(){return()=>be.visible?c.h(ge.Alert,{class:`tech-alert tech-alert-${be.type}`,message:be.title,description:be.description,showIcon:be.showIcon,closable:be.closable,onClose:()=>{be.visible=!1}},{icon:()=>be.type==="loading"?c.h($t.LoadingOutlined):be.type==="success"?c.h($t.CheckCircleOutlined):be.type==="error"?c.h($t.CloseCircleOutlined):be.type==="warning"?c.h($t.ExclamationCircleOutlined):c.h($t.InfoCircleOutlined)}):null}};nl=c.createVNode(e),c.render(nl,ye),sl=!0}function mi(i){ay(),Ss&&clearTimeout(Ss),be.type=i.type||"info",be.title=i.title||"",be.description=i.description||"",be.closable=i.closable??!1,be.showIcon=i.showIcon??!0,be.visible=!0;const e=i.container||Ts;ye&&(e?(ye.parentNode!==e&&e.appendChild(ye),ye.style.position="absolute",ye.style.top="20px",ye.style.left="50%",ye.style.transform="translateX(-50%)"):(ye.parentNode!==document.body&&document.body.appendChild(ye),ye.style.position="fixed",ye.style.top="20px",ye.style.left="50%",ye.style.transform="translateX(-50%)"));const t=i.duration??(be.type==="loading"?0:3);t>0&&(Ss=setTimeout(()=>{be.visible=!1},t*1e3))}const fe={setContainer:i=>{Ts=i,ye&&i&&ye.parentNode!==i&&(i.appendChild(ye),ye.style.position="absolute")},info:(i,e,t,n)=>mi({type:"info",title:i,description:e,duration:t,container:n}),success:(i,e,t,n)=>mi({type:"success",title:i,description:e,duration:t,container:n}),error:(i,e,t,n)=>mi({type:"error",title:i,description:e,duration:t,container:n}),warning:(i,e,t,n)=>mi({type:"warning",title:i,description:e,duration:t,container:n}),loading:(i,e,t)=>mi({type:"loading",title:i,description:e,duration:0,container:t}),close:()=>{be.visible=!1}};class ly{cesium;viewer;events=new Hi;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const n=this.cesium.Color.fromCssColorString(e);n?(this.viewer.scene.backgroundColor=n,this.viewer.scene.globe.baseColor=n):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),n=new Promise((s,o)=>setTimeout(()=>o(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,n])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(n){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",n),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const n=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),n.enableZoomInertia=!0,n.minimumZoomDistance=1,n.maximumZoomDistance=1e6,n.enableTilt=!1,n.enableLook=!1,n.enableCollisionDetection=!1,n.inertiaSpin=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const s=()=>{const o=this.viewer.camera,r=e.Math.EPSILON3,l=0,a=e.Math.toRadians(-90),d=0,h=Math.abs(o.heading-l);((h>Math.PI?Math.abs(h-2*Math.PI):h)>r||Math.abs(o.pitch-a)>r||Math.abs(o.roll-d)>r)&&o.setView({orientation:{heading:l,pitch:o.pitch,roll:d}})};this._removeCameraLockListener=this.viewer.scene.postRender.addEventListener(s),this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const n=Date.now();this.lastBaseMapRequestId=n;const s=this.viewer.imageryLayers,o=[];if(e==="tianditu"){const r=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",l=t?.layerType||"img_w",a=l.split("_"),d=a[0]||"img",h=a[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const p=f?`${f}_${h}`:"";o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${l}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&p&&o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${p}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const r=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const l=this.cesium.ArcGisMapServerImageryProvider.fromUrl(r,{enablePickFeatures:!1}),a=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([l,a]);o.push(d)}else o.push(new this.cesium.ArcGisMapServerImageryProvider({url:r,enablePickFeatures:!1}))}catch(l){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",l),o.push(new this.cesium.UrlTemplateImageryProvider({url:`${r}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==n){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),o.forEach(r=>s.addImageryProvider(r))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),o=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const n=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=n}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,n=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,o=e.contrast!==void 0?e.contrast:1,r=e.saturation!==void 0?e.saturation:1,l=t.scene.primitives,a=l.length,d=!!n.CustomShader;for(let h=0;h<a;++h){const f=l.get(h);if(f instanceof n.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",o),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",r);else{const p=new n.CustomShader({uniforms:{u_brightness:{type:n.UniformType.FLOAT,value:s},u_contrast:{type:n.UniformType.FLOAT,value:o},u_saturation:{type:n.UniformType.FLOAT,value:r}},fragmentShaderText:`
98
+ `;rn=document.createElement("style"),rn.textContent=i,document.head.appendChild(rn)}function ay(){if(sl)return;ry(),ye=document.createElement("div"),ye.className="tech-alert-wrapper",(Ts||document.body).appendChild(ye);const e={setup(){return()=>be.visible?c.h(ge.Alert,{class:`tech-alert tech-alert-${be.type}`,message:be.title,description:be.description,showIcon:be.showIcon,closable:be.closable,onClose:()=>{be.visible=!1}},{icon:()=>be.type==="loading"?c.h($t.LoadingOutlined):be.type==="success"?c.h($t.CheckCircleOutlined):be.type==="error"?c.h($t.CloseCircleOutlined):be.type==="warning"?c.h($t.ExclamationCircleOutlined):c.h($t.InfoCircleOutlined)}):null}};nl=c.createVNode(e),c.render(nl,ye),sl=!0}function mi(i){ay(),Ss&&clearTimeout(Ss),be.type=i.type||"info",be.title=i.title||"",be.description=i.description||"",be.closable=i.closable??!1,be.showIcon=i.showIcon??!0,be.visible=!0;const e=i.container||Ts;ye&&(e?(ye.parentNode!==e&&e.appendChild(ye),ye.style.position="absolute",ye.style.top="20px",ye.style.left="50%",ye.style.transform="translateX(-50%)"):(ye.parentNode!==document.body&&document.body.appendChild(ye),ye.style.position="fixed",ye.style.top="20px",ye.style.left="50%",ye.style.transform="translateX(-50%)"));const t=i.duration??(be.type==="loading"?0:3);t>0&&(Ss=setTimeout(()=>{be.visible=!1},t*1e3))}const fe={setContainer:i=>{Ts=i,ye&&i&&ye.parentNode!==i&&(i.appendChild(ye),ye.style.position="absolute")},info:(i,e,t,n)=>mi({type:"info",title:i,description:e,duration:t,container:n}),success:(i,e,t,n)=>mi({type:"success",title:i,description:e,duration:t,container:n}),error:(i,e,t,n)=>mi({type:"error",title:i,description:e,duration:t,container:n}),warning:(i,e,t,n)=>mi({type:"warning",title:i,description:e,duration:t,container:n}),loading:(i,e,t)=>mi({type:"loading",title:i,description:e,duration:0,container:t}),close:()=>{be.visible=!1}};class ly{cesium;viewer;events=new Hi;lastBaseMapRequestId=0;_removeCameraLockListener=null;currentMode="3d";defaultMapBound={minLon:-180,maxLon:180,minLat:-90,maxLat:90};constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}get is2d(){return this.currentMode==="2d"}setGlobeEnvironmentVisible(e){if(this.is2d){this.viewer.scene.globe.show=e,this.viewer.scene.globe.showGroundAtmosphere=!1,this.viewer.scene.skyAtmosphere.show=!1,this.viewer.scene.sun.show=!1,this.viewer.scene.moon.show=!1,this.viewer.scene.skyBox.show=!1;return}const{scene:t}=this.viewer;t.globe&&(t.globe.show=e,t.globe.showGroundAtmosphere=e,e||(t.globe.depthTestAgainstTerrain=!1)),t.skyAtmosphere&&(t.skyAtmosphere.show=e),t.sun&&(t.sun.show=e),t.moon&&(t.moon.show=e),t.skyBox&&(t.skyBox.show=e)}setGlobeColor(e){const t=this.cesium.Color.fromCssColorString(e);t&&(this.viewer.scene.backgroundColor=t,this.viewer.scene.globe.baseColor=t)}setBackgroundColor(e){const t=this.viewer.container;t&&(t.style.background=e);try{const n=this.cesium.Color.fromCssColorString(e);n?(this.viewer.scene.backgroundColor=n,this.viewer.scene.globe.baseColor=n):(this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT)}catch{this.viewer.scene.backgroundColor=this.cesium.Color.TRANSPARENT,this.viewer.scene.globe.baseColor=this.cesium.Color.TRANSPARENT}}async setTerrainEnable(e){if(!(this.is2d&&e))if(e)try{const t=this.cesium.ArcGISTiledElevationTerrainProvider.fromUrl("https://elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer"),n=new Promise((s,o)=>setTimeout(()=>o(new Error("ArcGIS Terrain request timed out")),5e3));this.viewer.terrainProvider=await Promise.race([t,n])}catch(t){console.warn("Failed to load ArcGIS terrain (or timed out), trying Cesium World Terrain...",t);try{this.cesium.Terrain&&this.cesium.Terrain.fromWorldTerrain?this.viewer.terrainProvider=await this.cesium.Terrain.fromWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0}):this.viewer.terrainProvider=this.cesium.createWorldTerrain({requestWaterMask:!0,requestVertexNormals:!0})}catch(n){console.error("Failed to enable terrain (both ArcGIS and Ion failed):",n),this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}}else this.viewer.terrainProvider=new this.cesium.EllipsoidTerrainProvider}setDepthTestEnable(e){if(!this.viewer.scene.globe.show){this.viewer.scene.globe.depthTestAgainstTerrain=!1;return}this.viewer.scene.globe.depthTestAgainstTerrain=e}setCadMode(e){this.currentMode!==e&&(this.currentMode=e,this.is2d?this._enable2DMode():this._enable3DMode())}_enable2DMode(){const e=this.cesium,t=this.viewer.scene;this.setGlobeEnvironmentVisible(!0);const n=t.screenSpaceCameraController;this.setBackgroundColor("#000000"),this.setGlobeColor("#000000"),this.viewer.imageryLayers.removeAll(),n.enableZoomInertia=!1,n.minimumZoomDistance=1,n.maximumZoomDistance=1e6,n.enableTilt=!1,n.enableLook=!1,n.enableCollisionDetection=!1,n.inertiaSpin=0,n.inertiaZoom=0,n.inertiaTranslate=0,this.viewer.camera.setView({orientation:{heading:0,pitch:e.Math.toRadians(-90),roll:0}}),this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const s=()=>{const o=this.viewer.camera,r=e.Math.EPSILON3,l=0,a=e.Math.toRadians(-90),d=0,h=Math.abs(o.heading-l);((h>Math.PI?Math.abs(h-2*Math.PI):h)>r||Math.abs(o.pitch-a)>r||Math.abs(o.roll-d)>r)&&o.setView({orientation:{heading:l,pitch:o.pitch,roll:d}})};this._removeCameraLockListener=this.viewer.scene.postRender.addEventListener(s),this.setCollisionDetection(!1),this.setHeightBasedZoom(!0)}_enable3DMode(){this._removeCameraLockListener&&(this._removeCameraLockListener(),this._removeCameraLockListener=null);const e=this.viewer.scene.screenSpaceCameraController;e.enableRotate=!0,e.enableTilt=!0,e.enableLook=!0,this.viewer.scene.morphTo3D(0),this.setMouseHabit(0),this.setCollisionDetection(!0),this.viewer.scene.screenSpaceCameraController.minimumZoomDistance=1,this.setHeightBasedZoom(!1)}async changeBaseMap(e,t){if(this.is2d){this.viewer.imageryLayers.removeAll();return}const n=Date.now();this.lastBaseMapRequestId=n;const s=this.viewer.imageryLayers,o=[];if(e==="tianditu"){const r=t?.token||"c25f14fb6bd4397cf8fe45144ff768d6",l=t?.layerType||"img_w",a=l.split("_"),d=a[0]||"img",h=a[1]||"w";let f="";d==="img"?f="cia":d==="vec"?f="cva":d==="ter"&&(f="cta");const p=f?`${f}_${h}`:"";o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${l}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${d}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:d,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]})),t.showAnnotation!==!1&&p&&o.push(new this.cesium.WebMapTileServiceImageryProvider({url:`https://{s}.tianditu.gov.cn/${p}/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=${f}&STYLE=default&TILEMATRIXSET=${h}&FORMAT=tiles&TILEMATRIX={TileMatrix}&TILEROW={TileRow}&TILECOL={TileCol}&tk=${r}`,layer:f,style:"default",format:"tiles",tileMatrixSetID:h,maximumLevel:18,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"]}))}else if(e==="arcgis"){console.log("Switching to ArcGIS...");const r=t?.url||"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer";try{if(this.cesium.ArcGisMapServerImageryProvider.fromUrl){const l=this.cesium.ArcGisMapServerImageryProvider.fromUrl(r,{enablePickFeatures:!1}),a=new Promise((h,f)=>setTimeout(()=>f(new Error("ArcGIS metadata request timed out")),3e3)),d=await Promise.race([l,a]);o.push(d)}else o.push(new this.cesium.ArcGisMapServerImageryProvider({url:r,enablePickFeatures:!1}))}catch(l){console.warn("ArcGIS provider failed (or timed out), fallback to XYZ template",l),o.push(new this.cesium.UrlTemplateImageryProvider({url:`${r}/tile/{z}/{y}/{x}`,maximumLevel:19,credit:"ArcGIS Layer"}))}}else if(e==="tianditu_img")return this.changeBaseMap("tianditu",{...t,layerType:"img_w"});if(this.lastBaseMapRequestId!==n){console.log("BaseMap switch cancelled due to new request.");return}s.removeAll(),o.forEach(r=>s.addImageryProvider(r))}async searchLocation(e,t){if(!e)return null;if(!t)throw new Error("缺少天地图 Token");const s=JSON.stringify({keyWord:e,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}),o=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(s)}&type=query&tk=${encodeURIComponent(t)}`,r=await fetch(o);if(!r.ok)throw new Error(`HTTP ${r.status}`);return await r.json()}setShadowsEnable(e){this.is2d||(this.viewer.shadows=e,this.viewer.terrainShadows=e?this.cesium.ShadowMode.ENABLED:this.cesium.ShadowMode.DISABLED,this.viewer.shadowMap&&(this._shadowDarkness===void 0?this.viewer.shadowMap.darkness=e?.7:.3:this.viewer.shadowMap.darkness=this._shadowDarkness))}_shadowDarkness;setShadowDarkness(e){this.is2d||(this._shadowDarkness=e,this.viewer.shadowMap&&(this.viewer.shadowMap.darkness=e))}setTime(e){if(this.is2d)return;let t;if(e instanceof Date)t=e;else{const s=this.cesium.JulianDate.now();t=this.cesium.JulianDate.toDate(s),t.setHours(e),t.setMinutes(0),t.setSeconds(0)}const n=this.cesium.JulianDate.fromDate(t);this.viewer.clock.currentTime=n}setModelColorAdjustment(e){if(this.is2d)return;const t=this.viewer,n=this.cesium;if(!t||!t.scene)return;const s=e.brightness!==void 0?e.brightness:1,o=e.contrast!==void 0?e.contrast:1,r=e.saturation!==void 0?e.saturation:1,l=t.scene.primitives,a=l.length,d=!!n.CustomShader;for(let h=0;h<a;++h){const f=l.get(h);if(f instanceof n.Cesium3DTileset)if(d)if(f.customShader&&f.customShader.isModelAdjustment)e.brightness!==void 0&&f.customShader.setUniform("u_brightness",s),e.contrast!==void 0&&f.customShader.setUniform("u_contrast",o),e.saturation!==void 0&&f.customShader.setUniform("u_saturation",r);else{const p=new n.CustomShader({uniforms:{u_brightness:{type:n.UniformType.FLOAT,value:s},u_contrast:{type:n.UniformType.FLOAT,value:o},u_saturation:{type:n.UniformType.FLOAT,value:r}},fragmentShaderText:`
99
99
  void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) {
100
100
  // 1. 亮度 (Brightness) - RGB 乘法
101
101
  material.diffuse *= u_brightness;
@@ -115,4 +115,4 @@
115
115
  // 通常不需要 clamp,除非开启 HDR 后期望超亮,但负值需要避免
116
116
  material.diffuse = max(material.diffuse, vec3(0.0));
117
117
  }
118
- `});p.isModelAdjustment=!0,f.customShader=p}else e.brightness!==void 0&&e.brightness!==1&&!f.style&&(f.style=new n.Cesium3DTileStyle({color:`color('white') * ${e.brightness}`}))}}setModelBrightness(e){this.setModelColorAdjustment({brightness:e})}_defaultSkyBox=null;_updateLightDirection=e=>{e.light instanceof this.cesium.DirectionalLight&&(e.light.direction=e.camera.directionWC)};setEnvironmentMapEnable(e){this.is2d||(e?(this.viewer.scene.light=new this.cesium.DirectionalLight({direction:this.viewer.scene.camera.directionWC}),this.viewer.scene.preRender.addEventListener(this._updateLightDirection)):(this._defaultSkyBox&&(this.viewer.scene.skyBox=this._defaultSkyBox),this.viewer.scene.preRender.removeEventListener(this._updateLightDirection),this.viewer.scene.light=new this.cesium.SunLight),this.viewer.scene.imageBasedLighting&&(this.viewer.scene.imageBasedLighting.imageBasedLightingFactor=e?new this.cesium.Cartesian2(2,2):new this.cesium.Cartesian2(1,1)))}setAmbientOcclusion(e){if(this.is2d)return;const t=this.viewer.scene;if(!t||!t.postProcessStages||!t.postProcessStages.ambientOcclusion)return;const n=t.postProcessStages.ambientOcclusion;n.enabled=e,e&&(n.uniforms.ambientOcclusionOnly=!1,n.uniforms.intensity=3,n.uniforms.bias=.1,n.uniforms.lengthCap=.03,n.uniforms.stepSize=1,n.uniforms.blurStepSize=.86)}setCollisionDetection(e){if(this.is2d){this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1;return}const t=this.viewer.scene.screenSpaceCameraController;t.enableCollisionDetection=e,e||t.minimumZoomDistance<1&&(t.minimumZoomDistance=1)}_customZoomHandler=null;_zoomInertiaListener=null;setHeightBasedZoom(e){const t=this.viewer.scene.screenSpaceCameraController,n=this.cesium;if(this.viewer.camera.frustum.near=1e-5,this.viewer.camera.frustum.far=1e8,e||(this.viewer.camera.frustum.near=.1),this._customZoomHandler&&(this._customZoomHandler.destroy(),this._customZoomHandler=null),this._zoomInertiaListener&&(this._zoomInertiaListener(),this._zoomInertiaListener=null),!e){t.zoomEventTypes.includes(n.CameraEventType.WHEEL)||t.zoomEventTypes.push(n.CameraEventType.WHEEL);return}t.zoomEventTypes=t.zoomEventTypes.filter(l=>l!==n.CameraEventType.WHEEL),this._customZoomHandler=new n.ScreenSpaceEventHandler(this.viewer.scene.canvas);let s=null;this._customZoomHandler.setInputAction(l=>{s=l.endPosition},n.ScreenSpaceEventType.MOUSE_MOVE);let o=0,r=null;this._zoomInertiaListener=this.viewer.scene.preUpdate.addEventListener(()=>{if(Math.abs(o)<.001||!r){o=0;return}const l=this.viewer.camera,a=o*.2;if(s){const h=l.getPickRay(s);if(h){let f=this.viewer.scene.pickPosition(s);if(!f){const p=n.IntersectionTests.rayEllipsoid(h,this.viewer.scene.globe.ellipsoid);p&&(f=n.Ray.getPoint(h,p.start))}if(f){const p=n.Cartesian3.distance(l.position,f);if(a>0&&a>p-.01){if(o=0,p>.01){const u=n.Cartesian3.multiplyByScalar(r,p-.01,new n.Cartesian3);l.position=n.Cartesian3.add(l.position,u,new n.Cartesian3)}return}}}}const d=n.Cartesian3.multiplyByScalar(r,a,new n.Cartesian3);l.position=n.Cartesian3.add(l.position,d,new n.Cartesian3),o-=a}),this._customZoomHandler.setInputAction(l=>{const a=this.viewer.camera,d=a.positionCartographic.height;let h=.1;d<4?h=.08+d/4*.08:d>1e3&&(h=.1+Math.min((d-1e3)/1e3,1)*.1);let f=d*h;f=Math.max(.001,f);const p=Math.sign(l);if(d<.2&&p>0){fe.warning("无法继续放大");return}if(!s)r=a.direction;else{const u=a.getPickRay(s);if(u){let m=this.viewer.scene.pickPosition(s);if(!m){const w=n.IntersectionTests.rayEllipsoid(u,this.viewer.scene.globe.ellipsoid);w&&(m=n.Ray.getPoint(u,w.start))}if(m){const w=n.Cartesian3.subtract(m,a.position,new n.Cartesian3);r=n.Cartesian3.normalize(w,new n.Cartesian3)}else r=a.direction}else r=a.direction}o+=p>0?f:-f},n.ScreenSpaceEventType.WHEEL)}setMouseHabit(e){if(this.is2d)return;const t=this.viewer.scene.screenSpaceCameraController;t.enableTranslate=!0,t.enableRotate=!0,t.enableZoom=!0,t.enableTilt=!0,t.enableLook=!1,t.lookEventTypes=[],e===1?(t.rotateEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.MIDDLE_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.LEFT_DRAG]):(t.rotateEventTypes=[this.cesium.CameraEventType.LEFT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.MIDDLE_DRAG])}}class cy{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}getCameraView(){const e=this.viewer.camera;return{position:{x:e.position.x,y:e.position.y,z:e.position.z},destination:{x:e.position.x,y:e.position.y,z:e.position.z},orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},duration:1}}flyToCameraView(e){const{position:t,orientation:n,duration:s}=e,o=new this.cesium.Cartesian3(t.x,t.y,t.z),r=new this.cesium.HeadingPitchRoll(n.heading,n.pitch,n.roll);!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}getCurrentCameraPositionAndTarget(){const e=this.getCameraView();return{position:e.position,target:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll},duration:e.duration}}setCameraView(e){const t=e.target||e.orientation||{},n=e.destination||e.position||{};this.flyToCameraView({position:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},destination:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},orientation:{heading:Number(t.heading||0),pitch:Number(t.pitch||0),roll:Number(t.roll||0)},duration:e.duration})}flyToLonLatHeight(e,t,n,s=1){const o=this.cesium.Cartesian3.fromDegrees(e,t,n),r={heading:this.cesium.Math.toRadians(0),pitch:this.cesium.Math.toRadians(-90),roll:0};!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}}function dy(i){const{container:e,appContext:t,methods:n,viewerOptions:s,options:o,callbacks:r}=i,l=new Hi,a=window.Cesium;if(!a)throw new Error("Cesium is not loaded");e.id=`cesium-container-${np()}`;const d={animation:!1,timeline:!1,infoBox:!1,homeButton:!1,fullscreenButton:!1,sceneModePicker:!1,navigationHelpButton:!1,geocoder:!1,baseLayerPicker:!1,selectionIndicator:!1,heightBasedZoom:!0,creditContainer:document.createElement("div"),contextOptions:{webgl:{alpha:!0}}},h=t?.config?.globalProperties?.$leitingBimOptions,f={...d,...h?.viewerOptions??{},...s??{}},p=new a.Viewer(e,f);p.camera.setView({destination:a.Cartesian3.fromDegrees(108,32,1e7),orientation:{heading:a.Math.toRadians(0),pitch:a.Math.toRadians(-90),roll:0}});let u=n;if(!u&&h&&(h.methods||(h.methods={}),u=h.methods),u){const m=new mp({cesium:a,viewer:p,options:o,callbacks:r}),w=new kr({cesium:a,viewer:p}),A=new ly({cesium:a,viewer:p}),C=new Ap({cesium:a,viewer:p}),v=new cy({cesium:a,viewer:p});let S;const D=new il({cesium:a,viewer:p});o&&(o.globe!==void 0&&A.setGlobeEnvironmentVisible(o.globe),o.terrain!==void 0&&A.setTerrainEnable(o.terrain),o.depthTest!==void 0&&A.setDepthTestEnable(o.depthTest),o.mapProvider&&o.mode!=="2d"&&A.changeBaseMap(o.mapProvider,{token:o.tiandituToken,layerType:o.tiandituLayerType,showAnnotation:o.tiandituShowLabel,url:o.arcgisUrl}),o.shadows!==void 0&&A.setShadowsEnable(o.shadows),o.environmentMap!==void 0&&A.setEnvironmentMapEnable(o.environmentMap),o.ambientOcclusion!==void 0&&A.setAmbientOcclusion(o.ambientOcclusion),o.time!==void 0&&A.setTime(o.time),o.brightness!==void 0&&A.setModelBrightness(o.brightness),o.backgroundColor!==void 0&&A.setBackgroundColor(o.backgroundColor),o.collision!==void 0&&A.setCollisionDetection(o.collision),o.mouseHabit!==void 0&&A.setMouseHabit(o.mouseHabit),o.heightBasedZoom!==void 0&&A.setHeightBasedZoom(o.heightBasedZoom)),o&&o.mode==="2d"&&(console.log("InitMap: Setting CAD Mode 2D"),A.setCadMode("2d"),S=new tl({cesium:a,viewer:p})),w.events.on("tilesetLoaded",g=>{m.baseCompt.attachTileset(g,m.baseCompt.selectedColor),m.baseSection.attachTileset(g,g.leiting?.model?.modelId),u&&u.tilesLoad3dTiles&&u.tilesLoad3dTiles(g),o?.tilesLoad3dTiles&&o.tilesLoad3dTiles(g.leiting)}),w.events.on("loadingStatus",g=>{u&&u.onLoadingStatus&&u.onLoadingStatus(g)}),w.events.on("mountAll3Dtiles",({modelList:g})=>{o?.mountAll3Dtiles&&o.mountAll3Dtiles(g),u?.mountAll3Dtiles&&u.mountAll3Dtiles(g)}),w.events.on("updateModels",({modelList:g})=>{o?.updateModels&&o.updateModels(g),u?.updateModels&&u.updateModels(g)}),C.events.on("mountAllCad",g=>{o?.mountAllCad&&o.mountAllCad(g),u?.mountAllCad&&u.mountAllCad(g)}),m.baseCompt.loadNodeDetailsForModel=g=>w.loadNodeDetailsForModel(g),m.baseCompt.selectionChange(g=>{g.length!==0&&(o?.selectionChange&&o.selectionChange(g),u?.selectionChange&&u.selectionChange(g))}),u.onSearchComponent=g=>{o?.searchComponent&&o.searchComponent(g),u?.searchComponent&&u.searchComponent(g)};const N=u.saveRegion;u.saveRegion=g=>{o?.saveRegion&&o.saveRegion(g),N&&N!==o?.saveRegion&&N(g)};const I=u.saveCadCalibration;u.saveCadCalibration=g=>{o?.saveCadCalibration&&o.saveCadCalibration(g),I&&I!==o?.saveCadCalibration&&I(g)};const B=u.saveCadRegion;u.saveCadRegion=g=>{o?.saveCadRegion&&o.saveCadRegion(g),B&&B!==o?.saveCadRegion&&B(g)},u.getCesium=()=>a,u.getViewer=()=>p,u.getAnnotationInstance=()=>S,u.getMeasureInstance=()=>D,u.flyToCamera=g=>{v.setCameraView(g)},u.flyToLonLatHeight=(g,P,x,k=1)=>{v.flyToLonLatHeight(g,P,x,k)},u.flyTo=u.flyToCamera,u.getCameraState=()=>v.getCameraView(),u.getCameraInfo=u.getCameraState,u.restoreCameraState=g=>v.flyToCameraView(g),u.flyToCameraView=u.restoreCameraState,u.getCameraPositionTarget=()=>v.getCurrentCameraPositionAndTarget(),u.getCurrentCameraPositionAndTarget=u.getCameraPositionTarget,u.setCameraLookAt=g=>v.setCameraView(g),u.setCameraView=u.setCameraLookAt,u.setCanvasBackground=g=>A.setBackgroundColor(g),u.setBackgroundColor=u.setCanvasBackground,u.setAntiAliasing=g=>m.enableCesiumFXAA(g),u.enableCesiumFXAA=u.setAntiAliasing,u.setSceneVisibility=g=>m.setSceneOptions(g),u.setSceneOptions=u.setSceneVisibility,u.addDebugPoint=(g,P,x=0)=>{p.entities.add({position:a.Cartesian3.fromDegrees(g,P,x),point:{pixelSize:10,color:a.Color.RED}})},u.addPoint=u.addDebugPoint,u.toggleDebugLabels=()=>m.enableTestLabel(),u.enableTestLabel=u.toggleDebugLabels,u.captureScreenshot=()=>{const g=p.scene.canvas;return p.render(),g.toDataURL("image/png")},u.getImageBase64=u.captureScreenshot,u.captureDomScreenshot=(g,P)=>m.getSnapDomSImageBase64(g,P),u.getSnapDomSImageBase64=u.captureDomScreenshot,u.addModels=g=>w.addModels(g),u.add3DtilesModel=u.addModels,u.addObliquePhotography=g=>w.addOSGB(g),u.addOSGB=u.addObliquePhotography,u.adjustOSGBModelMatrix=g=>w.updateOSGBMatrix(g),u.updateOSGBMatrix=u.adjustOSGBModelMatrix,u.setModelVisibility=g=>w.showModels(g),u.showModels=u.setModelVisibility,u.showTileset=u.setModelVisibility,u.removeModels=g=>w.deleteModels(g),u.deleteModels=u.removeModels,u.clearAllModels=()=>{w.deleteAllModels(),l.emit("deleteAllModels")},u.deleteAllModelList=u.clearAllModels,u.deleteAllModels=u.clearAllModels,u.flyToModel=g=>w.flyToTileset(g),u.flyToTileset=u.flyToModel,u.flyToByModelId=u.flyToModel,u.setModelBrightness=g=>m.updateModelEffect(g),u.updateModelEffect=u.setModelBrightness,u.getAllTilesets=()=>w.getMapTileset(),u.getMapTileset=u.getAllTilesets,u.getCurrentModelId=()=>w.getBIMmodelId(),u.getBIMmodelId=u.getCurrentModelId,u.getLoadedModels=()=>w.getModelList(),u.getModelList=u.getLoadedModels,u.loadModelStructure=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelStructure: modelId is required");return}return await w.loadTreeForModel(P)},u.loadTreeForModel=u.loadModelStructure,u.loadModelDetails=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelDetails: modelId is required");return}return await w.loadNodeDetailsForModel(P)},u.loadNodeDetailsForModel=u.loadModelDetails,u._loadNodeDetailsForModel=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelDetails: modelId is required");return}return await w._loadNodeDetailsForModel(P)},u.setMapTileset=g=>w.setMapTileset(g),u.setCurrentModelId=g=>w.setBIMmodelId(g),u.setBIMmodelId=u.setCurrentModelId,u.setModelList=g=>w.setModelList(g),u.highlightComponents=(g,P={})=>m.baseCompt.setSelectColorUserModelCpt(g,P),u.setSelectColorUserModelCpt=u.highlightComponents,m.baseCompt.setLoadNodeDetailsCallback(g=>w.loadNodeDetailsForModel(g)),u.highlightAllComponents=(g,P)=>m.baseCompt.setAllSelectColorUserModelCpt(g,P),u.setAllSelectColorUserModelCpt=u.highlightAllComponents,u.setSelectColorUserModelCptByClear=(g,P)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g.selectCpts,P??{rank:0})},u.clearSelectColorUserModelCpt=()=>m.baseCompt.clearAllHaveSelected(),u.selectComponents=(g,P)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g,P??{rank:0})},u.setSelecteds=u.selectComponents,u.setSelectionColor=(g,P,x,k)=>m.baseCompt.setSelectedColorRgba(g,P,x,k),u.setSelectedColor=u.setSelectionColor,u.clearSelection=()=>m.baseCompt.clearAllHaveSelected(),u.clearAllHaveSelected=u.clearSelection,u.getSelectedComponents=g=>m.baseCompt.getSelected(g),u.getSelected=u.getSelectedComponents,u.onSelectionChange=g=>{m.baseCompt.selectionChange(g)},u.selectionChange=u.onSelectionChange,u.flyToComponents=g=>m.baseCompt.flyToObjects(g),u.flyToObjects=u.flyToComponents,u.setConstructionData=async g=>{if(g&&Array.isArray(g)){const P=new Set;g.forEach(x=>{x.mergeCpts&&Array.isArray(x.mergeCpts)&&x.mergeCpts.forEach(k=>{k.modelId&&P.add(k.modelId)})}),P.size>0&&await Promise.all(Array.from(P).map(x=>u.loadNodeDetailsForModel(x)))}m.baseCompt.setAllConstructionProgressTracking(g)},u.setAllConstructionProgressTracking=u.setConstructionData,u.startConstructionSimulation=()=>m.baseCompt.enableConstructionProgressTracking(),u.enableAllConstructionProgressTracking=u.startConstructionSimulation,u.stopConstructionSimulation=()=>m.baseCompt.disableConstructionProgressTracking(),u.disableConstructionProgressTracking=u.stopConstructionSimulation,u.disableAllConstructionProgressTracking=u.stopConstructionSimulation,u.resetConstructionSimulation=()=>m.baseCompt.freshConstructionProgressTracking(),u.freshConstructionProgressTracking=u.resetConstructionSimulation,u.restartConstructionSimulation=()=>m.baseCompt.reStartAnimation(),u.reStartAnimation=u.restartConstructionSimulation,u.resumeFlyTo=()=>m.baseCompt.resumeFlyTo(),u.pauseConstructionSimulation=()=>m.baseCompt.pauseFlyTo(),u.pauseFlyTo=u.pauseConstructionSimulation,u.pauseAnimation=u.pauseConstructionSimulation,u.resumeConstructionSimulation=()=>m.baseCompt.resumeFlyTo(),u.resumeAnimation=u.resumeConstructionSimulation,u.setComponentsVisibility=async g=>await m.baseCompt.setComponentVisibility(g),u.setElementsListVisible=u.setComponentsVisibility,u.setAllComponentsVisibility=async g=>await m.baseCompt.setAllComponentsVisibility(g),u.setAllElementsVisible=u.setAllComponentsVisibility,u.isolateComponents=g=>m.baseCompt.isolateComponentVisibility(g),u.isolateComponentVisibility=u.isolateComponents,u.getComponentsByVisibility=g=>m.baseCompt._getComponentsByVisibility(g),u.getShowCpts=g=>m.baseCompt.getComponentsByVisibility(g),u.getElementsVisible=g=>m.baseCompt.getComponentsByVisibility(g),u.setComponentVisibility=u.setComponentsVisibility,u.enableSectioning=(g,P)=>m.baseSection.open(g,P),u.openSection=u.enableSectioning,u.disableSectioning=g=>m.baseSection.close(g),u.closeSection=u.disableSectioning,u.updateSectionBox=g=>m.baseSection.updateRange(g),u.updateSectionRange=u.updateSectionBox,u.getSectionBox=()=>m.baseSection.getRange(),u.getSectionRange=u.getSectionBox,u.fitSectionToModel=()=>m.baseSection.fitToModels(),u.fitToModels=u.fitSectionToModel,u.setSectionBoxVisibility=g=>m.baseSection.setBoxVisibility(g),u.startFirstPersonMode=()=>{m.baseCompt.disableSelection(),m.basePlayer.openPlayer()},u.openPlayer=u.startFirstPersonMode,u.stopFirstPersonMode=()=>{m.basePlayer.closePlayer(),m.baseCompt.enableSelection()},u.closePlayer=u.stopFirstPersonMode,u.setPlayerPosition=g=>m.basePlayer.setPersonPosition(g),u.setPersonPosition=u.setPlayerPosition,u.setWalkSpeed=g=>m.basePlayer.setSpeed({speed:g}),u.setPlayerSpeed=u.setWalkSpeed,u.setPlayerConfig=g=>m.basePlayer.setParams(g),u.setPlayerParams=u.setPlayerConfig,u.setPlayerAction=(g,P)=>m.basePlayer.setMoveState(g,P),u.setPlayerMoveState=u.setPlayerAction,u.bindPlayerControls=g=>m.basePlayer.bindUiKeys(g),u.bindPlayerUiKeys=u.bindPlayerControls,u.setGlobeVisibility=g=>A.setGlobeEnvironmentVisible(g),u.setGlobeEnvironmentVisible=u.setGlobeVisibility,u.setTerrainVisibility=g=>A.setTerrainEnable(g),u.setTerrainEnable=u.setTerrainVisibility,u.setDepthTest=g=>A.setDepthTestEnable(g),u.setDepthTestEnable=u.setDepthTest,u.setBaseMap=(g,P)=>A.changeBaseMap(g,P),u.changeBaseMap=u.setBaseMap,u.setWorldTime=g=>A.setTime(g),u.setTime=u.setWorldTime,u.setGisOptions=g=>{g.globe!==void 0&&A.setGlobeEnvironmentVisible(g.globe),g.elevation!==void 0&&A.setTerrainEnable(g.elevation),g.depthTestAgainstTerrain!==void 0&&A.setDepthTestEnable(g.depthTestAgainstTerrain),g.rendering!==void 0&&A.setAmbientOcclusion(g.rendering)},u.setShadowVisibility=g=>A.setShadowsEnable(g),u.setShadowsEnable=u.setShadowVisibility,u.setEnvironmentMapVisibility=g=>A.setEnvironmentMapEnable(g),u.setEnvironmentMapEnable=u.setEnvironmentMapVisibility,u.setAOVisibility=g=>A.setAmbientOcclusion(g),u.setAmbientOcclusion=u.setAOVisibility,u.setBackgroundColor=g=>A.setGlobeColor(g),u.setGlobeColor=u.setBackgroundColor,u.setModelBrightness=g=>A.setModelBrightness(g),u.adjustModelColor=g=>A.setModelColorAdjustment(g),u.setModelColorAdjustment=u.adjustModelColor,u.setShadowIntensity=g=>{A.setShadowDarkness?A.setShadowDarkness(g):console.warn("baseSetting.setShadowDarkness is not available. Please reload the page.")},u.setShadowDarkness=u.setShadowIntensity,u.switchSceneMode=async g=>{const P=g?"2d":"3d";await A.setCadMode(P),g&&!S&&(S=new tl({cesium:a,viewer:p}),u.setGlobeVisibility(!0)),l.emit("setMode",P)},u.setSceneMode=u.switchSceneMode,u.set2d=g=>u.switchSceneMode(g),u.is2dMode=()=>A.is2d,u.setMouseControlMode=g=>A.setMouseHabit(g),u.setMouseHabit=u.setMouseControlMode,u.setCollisionEnabled=g=>A.setCollisionDetection(g),u.setCollisionDetection=u.setCollisionEnabled,u.searchAndLocate=(g,P)=>A.searchLocation(g,P),u.searchLocation=u.searchAndLocate,u.getConfigure=()=>(console.warn("getConfigure is not initialized. Please ensure LeitingSetting component is mounted."),{}),u.setConfigure=g=>{console.warn("setConfigure is not initialized. Please ensure LeitingSetting component is mounted.",g)},u.addCadModel=g=>{const P={...g};return P.files&&!P.fileNames&&(P.fileNames=P.files),P.fileNames||(P.fileNames=[]),C.addDxfModel(P)},u.addDxfModel=u.addCadModel,u.deleteCad=g=>C.deleteCad(g),u.deleteAllCad=()=>C.deleteAllCad(),u.showCadModel=g=>C.showJson(g),u.showGeoJson=g=>C.showJson(g),u.showDxfModel=u.showCadModel,u.showCadLayer=g=>C.showJsonByLayer(g),u.showDxfLayer=u.showCadLayer,u.flyToCadModel=(g={})=>C.flyToCadModel(g),u.getCadModels=g=>C.getDxfModels(g),u.getDxfModels=u.getCadModels,u.getCadLayers=g=>C.getMapLayers(g),u.getDxfLayers=u.getCadLayers,u.getCadModelId=()=>C.getModelId(),u.setCadOpen=g=>C.setDxfOpen(g),u.setDxfOpen=u.setCadOpen,u.getCadOpen=()=>C.getDxfOpen(),u.getDxfOpen=u.getCadOpen,u.adjustCadModel=g=>C.adjustingModelByCad(g),u.adjustingModelByCad=u.adjustCadModel,u.saveAnnotations=()=>{let g=null;return S&&(g=S.saveAnnotations()),o?.saveAnnotations&&o.saveAnnotations(g),g},u.loadAnnotations=g=>S?S.loadAnnotations(g):!1,u.flyToTopView=()=>{C.flyToCadModel()},u.menuEvents=l,u.addMenuItems=g=>{l.emit("insertMenu",g)},u.insertMenu=u.addMenuItems,u.filterMenuItems=g=>{l.emit("setMenuListFilter",g)},u.setMenuListFilter=u.filterMenuItems,u.setMenuVisibility=g=>{l.emit("showMenu",g)},u.showMenu=u.setMenuVisibility,u.setPanelVisibility=(g,P)=>{l.emit("setMenuActive",g,P)},u.setMenuActive=u.setPanelVisibility,u.addContextMenuItems=g=>{console.warn("addContextMenuItems is not initialized yet. Please wait for LeitingBIM component to mount.",g)},u.insertContextMenu=u.addContextMenuItems,u.removeContextMenuItems=g=>{console.warn("removeContextMenuItems is not initialized yet.",g)},u.deleteContextMenu=u.removeContextMenuItems,u.closeContextMenu=()=>{console.warn("closeContextMenu is not initialized yet.")},u.hideContextMenu=u.closeContextMenu,u.getModelTree=()=>{const g=[],P=w.getMapTileset();return Object.keys(P).forEach(x=>{const k=P[x];if(k&&k.leiting&&k.leiting.tree){const _=k.leiting.tree;Array.isArray(_)?g.push(..._):g.push(_)}}),g},u.getTree=u.getModelTree,u.getAllComponentDetails=()=>{const g=w.getMapTileset(),P={},x=[];try{Object.keys(g).forEach(k=>{const _=g[k];if(!_||!_.leiting)return;const G=_.leiting,F=G.node,E=G.model.formData,y=G.box;if(!F||!F.nodeExtras)return;const b=G.model.modelId;P[b]=F.nodeExtras;const T=F.nodeExtras.element;if(!T)return;const R=y?y.center:{x:0,y:0,z:0};Object.values(T).forEach(O=>{if(O.box3)try{const L=a.Quaternion.fromAxisAngle(a.Cartesian3.UNIT_Z,a.Math.toRadians(E.totalRotation||0)),M=a.Matrix4.fromRotationTranslation(a.Matrix3.fromQuaternion(L),new a.Cartesian3(0,0,0)),Q=a.Cartesian3.fromDegrees(E.longitude,E.latitude,E.height),Y=a.Transforms.eastNorthUpToFixedFrame(Q);a.Matrix4.multiply(Y,M,Y);const W=new a.Cartesian3(R.x,R.y,0),q=new a.Cartesian3;a.Matrix4.multiplyByPoint(Y,W,q);const Z=a.Cartographic.fromCartesian(q),oe=O.box3?.Center?.x||0,ne=O.box3?.Center?.y||0,se=O.box3?.Center?.z||0,pe=new a.Cartesian3(-R.x+oe,-R.y+ne,0+se),ve=a.Matrix4.fromTranslation(pe),V=a.Matrix4.clone(ve);a.Matrix4.multiply(M,V,V);const j=a.Cartesian3.fromDegrees(Z.longitude/Math.PI*180,Z.latitude/Math.PI*180,E.height),te=a.Transforms.eastNorthUpToFixedFrame(j);a.Matrix4.multiply(te,V,te);const Ae=a.Cartographic.fromCartesian(new a.Cartesian3(te[12],te[13],te[14]));O.box3.cartographic={longitude:Ae.longitude/Math.PI*180,latitude:Ae.latitude/Math.PI*180,height:Ae.height};const Ce={id:O.uniqueId,billboard:[{theme:"Tag9999",position:[O.box3.cartographic.longitude,O.box3.cartographic.latitude,O.box3.cartographic.height],options:{text:O.name}}]};x.push(Ce)}catch(L){console.warn("Error calculating component position:",L)}})})}catch(k){console.error("getAllComponents error:",k)}return P},u.getAllComponents=u.getAllComponentDetails,u.getComponentInfoList=async g=>{if(!Array.isArray(g))return[];const P=w.getMapTileset(),x=[],k=[],_={};if(g.forEach(F=>{const y=P[F.modelId]?.leiting?.model?.dbName;y&&F.elementId&&k.push({dbName:y,elementId:F.elementId,modelId:F.modelId})}),k.length>0)try{const F=k.map(b=>({dbName:b.dbName,elementId:b.elementId})),E=await Dr(F),y=Array.isArray(E)?E:E?.data;Array.isArray(y)&&y.forEach(b=>{if(b){const T=`${b.modelId}_${b.elementId}`;_[T]=b}})}catch(F){console.warn("API fetch component details failed, falling back to local data",F)}const G=new Set;if(g.forEach(F=>{const E=P[F.modelId],y=`${F.modelId}_${F.elementId}`;_[y]||E&&E.leiting&&!E.leiting?.node?.nodeExtras&&E.leiting.model?.nodeUrl&&G.add(F.modelId)}),G.size>0&&w._loadNodeDetailsForModel)try{const F=Array.from(G).map(E=>w._loadNodeDetailsForModel(E));await Promise.all(F)}catch(F){console.error("Failed to load node details in getComponentInfoList",F)}try{g.forEach(F=>{const E=F.modelId,y=F.elementId,b=P[E];if(!b||!b.leiting)return;const T=`${E}_${y}`,R=_[T];let O=null;if(R)O=R;else{const L=b.leiting.node?.nodeExtras?.element||b.leiting.node?.nodeExtras;L&&L[y]&&(O=JSON.parse(JSON.stringify(L[y])))}if(O){if(O.elementId=y,O.modelId=E,O.box3&&!O.box3.cartographic)try{const L=b.leiting,M=L.model.formData,Q=L.box,Y=Q?Q.center:{x:0,y:0,z:0},W=a.Quaternion.fromAxisAngle(a.Cartesian3.UNIT_Z,a.Math.toRadians(M.totalRotation||0)),q=a.Matrix4.fromRotationTranslation(a.Matrix3.fromQuaternion(W),new a.Cartesian3(0,0,0)),Z=a.Cartesian3.fromDegrees(M.longitude,M.latitude,M.height),oe=a.Transforms.eastNorthUpToFixedFrame(Z);a.Matrix4.multiply(oe,q,oe);const ne=new a.Cartesian3(Y.x,Y.y,0),se=new a.Cartesian3;a.Matrix4.multiplyByPoint(oe,ne,se);const pe=a.Cartographic.fromCartesian(se),ve=O.box3?.Center?.x||0,V=O.box3?.Center?.y||0,j=O.box3?.Center?.z||0,te=new a.Cartesian3(-Y.x+ve,-Y.y+V,0+j),Ae=a.Matrix4.fromTranslation(te),Ce=a.Matrix4.clone(Ae);a.Matrix4.multiply(q,Ce,Ce);const Me=a.Cartesian3.fromDegrees(pe.longitude/Math.PI*180,pe.latitude/Math.PI*180,M.height),Le=a.Transforms.eastNorthUpToFixedFrame(Me);a.Matrix4.multiply(Le,Ce,Le);const Ne=a.Cartographic.fromCartesian(new a.Cartesian3(Le[12],Le[13],Le[14]));O.box3.cartographic={longitude:Ne.longitude/Math.PI*180,latitude:Ne.latitude/Math.PI*180,height:Ne.height}}catch(L){console.warn("Error calculating component position:",L)}x.push(O)}})}catch(F){console.error("getComponentInfoList processing error:",F)}return x},u.getCptInfos=u.getComponentInfoList,u.baseCompt=m.baseCompt,u.setTeleportTarget=g=>{u.onSetTeleportTarget&&u.onSetTeleportTarget(g)},window.Methods=u}return console.log("methods",u),{Cesium:a,viewer:p,methods:u,menuEvents:l}}function Ms(i){return c.getCurrentScope()?(c.onScopeDispose(i),!0):!1}function Ds(i){return typeof i=="function"?i():c.unref(i)}const hy=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uy=Object.prototype.toString,fy=i=>uy.call(i)==="[object Object]",py=()=>{};function gy(i){return c.getCurrentInstance()}function ol(i,e=!0,t){gy()?c.onMounted(i,t):e?i():c.nextTick(i)}function Tt(i){var e;const t=Ds(i);return(e=t?.$el)!=null?e:t}const Ai=hy?window:void 0;function my(...i){let e,t,n,s;if(typeof i[0]=="string"||Array.isArray(i[0])?([t,n,s]=i,e=Ai):[e,t,n,s]=i,!e)return py;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},l=(h,f,p,u)=>(h.addEventListener(f,p,u),()=>h.removeEventListener(f,p,u)),a=c.watch(()=>[Tt(e),Ds(s)],([h,f])=>{if(r(),!h)return;const p=fy(f)?{...f}:f;o.push(...t.flatMap(u=>n.map(m=>l(h,u,m,p))))},{immediate:!0,flush:"post"}),d=()=>{a(),r()};return Ms(d),d}function Ay(){const i=c.ref(!1),e=c.getCurrentInstance();return e&&c.onMounted(()=>{i.value=!0},e),i}function rl(i){const e=Ay();return c.computed(()=>(e.value,!!i()))}function yy(i,e={}){const{window:t=Ai}=e,n=rl(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let s;const o=c.ref(!1),r=d=>{o.value=d.matches},l=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",r):s.removeListener(r))},a=c.watchEffect(()=>{n.value&&(l(),s=t.matchMedia(Ds(i)),"addEventListener"in s?s.addEventListener("change",r):s.addListener(r),o.value=s.matches)});return Ms(()=>{a(),l(),s=void 0}),o}function Cy(i,e,t={}){const{window:n=Ai,...s}=t;let o;const r=rl(()=>n&&"ResizeObserver"in n),l=()=>{o&&(o.disconnect(),o=void 0)},a=c.computed(()=>Array.isArray(i)?i.map(f=>Tt(f)):[Tt(i)]),d=c.watch(a,f=>{if(l(),r.value&&n){o=new ResizeObserver(e);for(const p of f)p&&o.observe(p,s)}},{immediate:!0,flush:"post"}),h=()=>{l(),d()};return Ms(h),{isSupported:r,stop:h}}function Ey(i,e={width:0,height:0},t={}){const{window:n=Ai,box:s="content-box"}=t,o=c.computed(()=>{var f,p;return(p=(f=Tt(i))==null?void 0:f.namespaceURI)==null?void 0:p.includes("svg")}),r=c.ref(e.width),l=c.ref(e.height),{stop:a}=Cy(i,([f])=>{const p=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(n&&o.value){const u=Tt(i);if(u){const m=u.getBoundingClientRect();r.value=m.width,l.value=m.height}}else if(p){const u=Array.isArray(p)?p:[p];r.value=u.reduce((m,{inlineSize:w})=>m+w,0),l.value=u.reduce((m,{blockSize:w})=>m+w,0)}else r.value=f.contentRect.width,l.value=f.contentRect.height},t);ol(()=>{const f=Tt(i);f&&(r.value="offsetWidth"in f?f.offsetWidth:e.width,l.value="offsetHeight"in f?f.offsetHeight:e.height)});const d=c.watch(()=>Tt(i),f=>{r.value=f?e.width:0,l.value=f?e.height:0});function h(){a(),d()}return{width:r,height:l,stop:h}}function wy(i={}){const{window:e=Ai,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:o=!0}=i,r=c.ref(t),l=c.ref(n),a=()=>{e&&(o?(r.value=e.innerWidth,l.value=e.innerHeight):(r.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight))};if(a(),ol(a),my("resize",a,{passive:!0}),s){const d=yy("(orientation: portrait)");c.watch(d,()=>a())}return{width:r,height:l}}const by={class:"title"},vy={class:"actions"},Iy={class:"card-body"},By=c.defineComponent({__name:"LeitingDraggableCard",props:{visible:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},title:{type:String,default:"Title"},initialPosition:{type:Object,default:()=>({x:0,y:0})},width:{type:[Number,String],default:300},minWidth:{type:Number,default:200},fullHeight:{type:Boolean,default:!1},align:{type:String,default:""}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=c.inject("leiting-theme",c.ref("dark")),s=e,o=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:D=>{s("update:visible",D),s("update:open",D)}}),r=c.ref(null),l=c.ref(t.initialPosition?.x||0),a=c.ref(t.initialPosition?.y||0),d=c.ref(t.width),h=c.ref(t.fullHeight?"100%":"600px");c.watch(()=>t.fullHeight,D=>{D?h.value="100%":h.value==="100%"&&(h.value="600px")});const{height:f}=wy();c.watch(f,()=>{t.fullHeight&&(h.value="100%")});const p=c.ref(!1),u=D=>{p.value=!0,D.preventDefault(),D.stopPropagation();const N=D.clientX,I=D.clientY,B=typeof d.value=="number"?d.value:r.value?.offsetWidth||0,g=typeof h.value=="number"?h.value:r.value?.offsetHeight||0,P=k=>{if(!p.value)return;k.preventDefault();const _=k.clientX-N,G=k.clientY-I,F=B+_,E=g+G;F>100&&(d.value=F),E>100&&(h.value=E)},x=()=>{p.value=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",x)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",x)},m=c.computed(()=>({left:`${l.value}px`,top:`${a.value}px`,width:typeof d.value=="number"?`${d.value}px`:d.value,height:typeof h.value=="number"?`${h.value}px`:h.value,position:"absolute",zIndex:2e3})),w=()=>{c.nextTick(()=>{if(r.value){const D=r.value.offsetParent||document.body,N=D.clientWidth,I=D.clientHeight,B=typeof d.value=="number"?d.value:r.value.offsetWidth||350,g=typeof h.value=="number"?h.value:r.value.offsetHeight||600;l.value+B>N&&(l.value=Math.max(0,N-B-20)),a.value+g>I&&(a.value=Math.max(0,I-g-20)),l.value<0&&(l.value=0),a.value<0&&(a.value=0)}})},A=c.ref(!1),C=D=>{if(D.target.closest(".close-btn")||D.target.closest(".actions"))return;A.value=!0,D.preventDefault(),D.stopPropagation();const N=D.clientX,I=D.clientY,B=l.value,g=a.value,P=k=>{if(!A.value)return;k.preventDefault();const _=k.clientX-N,G=k.clientY-I;l.value=B+_,a.value=g+G},x=()=>{A.value=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",x),w()};document.addEventListener("mousemove",P),document.addEventListener("mouseup",x)},v=()=>{c.nextTick(()=>{if(t.align&&r.value){const D=r.value.offsetParent||document.body,N=typeof d.value=="number"?d.value:r.value.offsetWidth||350;t.align==="right"?l.value=Math.max(0,D.clientWidth-N-20):t.align==="center"&&(l.value=Math.max(0,(D.clientWidth-N)/2))}w()})};c.onMounted(()=>{t.align?v():w()}),c.watch(o,D=>{D&&(t.align?v():w())});const S=()=>{o.value=!1,s("close")};return(D,N)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{ref_key:"cardRef",ref:r,class:c.normalizeClass(["draggable-card leiting-scroll",["leiting-theme-"+c.unref(n)]]),style:c.normalizeStyle(m.value)},[c.createElementVNode("div",{ref:"headerRef",class:"card-header",onMousedown:C},[c.createElementVNode("span",by,c.toDisplayString(i.title),1),c.createElementVNode("div",vy,[c.renderSlot(D.$slots,"header-extra",{},void 0,!0),c.createElementVNode("span",{class:"close-btn",onClick:S},"×")])],544),c.createElementVNode("div",Iy,[c.renderSlot(D.$slots,"default",{},void 0,!0)]),c.createElementVNode("div",{class:"resize-handle",onMousedown:u},[...N[0]||(N[0]=[c.createElementVNode("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"currentColor"},[c.createElementVNode("path",{d:"M10 10 L10 2 L2 10 Z"})],-1)])],32)],6)),[[c.vShow,o.value]])}}),Oe=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},Pe=Oe(By,[["__scopeId","data-v-50bf6126"]]);function xy(i){const e=c.ref([]),t=c.ref([]),n=c.ref([]),s=c.ref(""),o=c.ref(!0);c.watch(()=>c.unref(i),f=>{if(!f||f.length===0)return;const p=[],u=(A,C)=>{A.forEach(v=>{const S=v.id||v.key||v.$id,D=v.modelId||C;D&&(v.modelId=D),S&&p.push(S),v.children&&v.children.length>0&&u(v.children,D)})};u(f);const m=new Set(n.value);let w=!1;p.forEach(A=>{m.has(A)||(m.add(A),w=!0)}),w&&(n.value=Array.from(m))},{immediate:!0,deep:!0});const r=c.computed(()=>{const f=c.unref(i);if(!f)return[];const p=[],u=(m,w)=>{m.forEach(A=>{const C=A.id||A.key||A.$id,v=A.name||A.title;p.push({key:C,title:v,parentKey:w}),A.children&&A.children.length>0&&u(A.children,C)})};return u(f),p}),l=f=>{e.value=f,o.value=!1},a=f=>{n.value=f},d=f=>{t.value=f},h=f=>r.value.find(u=>u.key===f)?.parentKey;return c.watch(s,f=>{if(!f)return;const u=r.value.filter(w=>w.title&&w.title.toLowerCase().includes(f.toLowerCase())).map(w=>w.parentKey),m=new Set;u.forEach(w=>{let A=w;for(;A;)m.add(A),A=h(A)}),e.value=[...m],o.value=!0}),{expandedKeys:e,selectedKeys:t,checkedKeys:n,searchValue:s,autoExpandParent:o,onExpand:l,onCheck:a,onSelect:d}}const Sy={class:"search-box"},Ty={key:0},My={style:{color:"#f50"}},Dy={key:1},ky={key:1,class:"empty-tip"},an=Oe(c.defineComponent({__name:"LeitingTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"构件树"},width:{type:[Number,String],default:320},treeData:{type:Array,default:()=>[]},initialPosition:{type:Object,default:()=>({x:0,y:0})},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close","select","check"],setup(i,{emit:e}){const t=ge.Input.Search,n=ge.Tree,s=i,o=e,r=c.inject("leiting-theme",c.ref("dark")),l=c.inject("leitingMethods"),a=x=>{l?.value?.onSearchComponent&&l.value.onSearchComponent(x)},d=c.computed({get:()=>s.open!==void 0?s.open:s.visible,set:x=>{o("update:visible",x),o("update:open",x)}}),h=c.ref(null),{height:f}=Ey(h),p=c.computed(()=>f.value||300),u=c.ref({children:"children",title:"name",key:"id"}),m=c.ref([]),{expandedKeys:w,selectedKeys:A,checkedKeys:C,searchValue:v,autoExpandParent:S}=xy(c.toRef(s,"treeData")),D=(x,k)=>{if(!k)return x;const _=k.toLowerCase();return x.reduce((G,F)=>{const y=(F.name||F.title||"").toLowerCase().includes(_);if(F.children&&F.children.length>0){const b=D(F.children,k);(b.length>0||y)&&G.push({...F,children:b})}else y&&G.push({...F});return G},[])};c.watch([()=>s.treeData,v],([x,k])=>{x?m.value=D(x,k||""):m.value=[]},{immediate:!0,deep:!0});const N=x=>{w.value=x,S.value=!1},I=x=>{const k=[],_=G=>{if(!G.children||G.children.length===0){const E=G.element_Id;G.modelId&&E&&k.push({modelId:G.modelId,elementId:E})}else G.children.forEach(_)};return _(x),k},B=(x,k)=>{C.value=x,o("check",x,k);const _=[],G=new Set(x.map(E=>String(E))),F=E=>{for(let y=0;y<E.length;y++){const b=E[y];if(!b.children||b.children.length===0){if(!G.has(String(b.id))){const O=b.element_Id;b.modelId&&O&&_.push({modelId:b.modelId,elementId:O,show:!1})}}else b.children&&F(b.children)}};s.treeData&&F(s.treeData),l?.value?.setComponentVisibility&&l.value.setComponentVisibility(_),l?.value?.onTreeCheck&&l.value.onTreeCheck(x,k)},g=(x,k)=>{if(A.value=x,o("select",x,k),k.selected){const _=I(k.node);_.length>0&&l?.value?.flyToObjects&&l.value.flyToObjects({selectCpts:_})}l?.value?.onTreeSelect&&l.value.onTreeSelect(x,k)},P=()=>{o("update:visible",!1),o("close")};return(x,k)=>(c.openBlock(),c.createBlock(Pe,{visible:d.value,"onUpdate:visible":k[1]||(k[1]=_=>d.value=_),title:i.title,"initial-position":i.initialPosition,"full-height":i.fullHeight,onClose:P},{default:c.withCtx(()=>[c.createElementVNode("div",{class:c.normalizeClass(["leiting-tree-container",[`theme-${c.unref(r)}`]])},[c.createElementVNode("div",Sy,[c.createVNode(c.unref(t),{value:c.unref(v),"onUpdate:value":k[0]||(k[0]=_=>c.isRef(v)?v.value=_:null),placeholder:"搜索构件","allow-clear":"","enter-button":"",onSearch:a},null,8,["value"])]),c.createElementVNode("div",{class:"tree-wrapper",ref_key:"treeWrapperRef",ref:h},[m.value&&m.value.length?(c.openBlock(),c.createBlock(c.unref(n),{key:0,"tree-data":m.value,"field-names":u.value,height:p.value,"expanded-keys":c.unref(w),"auto-expand-parent":c.unref(S),"selected-keys":c.unref(A),"checked-keys":c.unref(C),checkable:"","block-node":"",onExpand:N,onSelect:g,onCheck:B},{title:c.withCtx(({name:_,title:G})=>[(_||G)&&c.unref(v)&&(_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())>-1?(c.openBlock(),c.createElementBlock("span",Ty,[c.createTextVNode(c.toDisplayString((_||G).substr(0,(_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())))+" ",1),c.createElementVNode("span",My,c.toDisplayString(c.unref(v)),1),c.createTextVNode(" "+c.toDisplayString((_||G).substr((_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())+c.unref(v).length)),1)])):(c.openBlock(),c.createElementBlock("span",Dy,c.toDisplayString(_||G),1))]),_:1},8,["tree-data","field-names","height","expanded-keys","auto-expand-parent","selected-keys","checked-keys"])):(c.openBlock(),c.createElementBlock("div",ky,"暂无数据"))],512)],2)]),_:1},8,["visible","title","initial-position","full-height"]))}}),[["__scopeId","data-v-3748c20d"]]),Py="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",al="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAERSURBVDhPvZTrEYIwEISTCrQD6EA7gA60AylBK1Aq0A7ECrQDoQPsADrACuLuTMJkIiHxjzezgyR7H3d5KJVSqRAigcaQUjYYX2JgZY/P/O4lEgYYFo7pgPcc2kSCBoIUzDeo0klPPEsNYlX7AKzA/M6ASrRzYoIGG5DAOCvzBvzMOxqQazSgLLI1QdAW5jWpUAPV0AVKIc7FRCuNy7RkWozJtj1BED7ANbpDXHhffFXUwUnZwRYp7qw7Rx8/lLkV9R4QD2w1A8pjW3sA4h5au+pXEBS76P8D6Ut9/nXXaiRQdnBXqBfEC+4GdzSxW5v6F7CTeHnbCVCBsWIE+RYVrdF4DSz6OwgiADDexbmT3X0A4fSDfDjUugcAAAAASUVORK5CYII=",Fy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",Ry="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHDSURBVDhPlZOxL0NRFIe9ECubhehoIIjJ1HYwCkIiJpUQEkN1YZBobU0kFKNI3iTGYrDRv0BIhLXCYpCwiO35fs25zWva98JNvpz37j33d8+551yvLWIEQXDG0izMe55XjvJz816MUJG1LVuvYJcQrEb5xwkV2JSHGfAhgBJiu63E4oSUzpRtusa+wBooKkWnKOujQYh7SbCShQx0m9cpds4iOseOw7BFmUPwU341IQT2MaOQgi9QND+wiqNnBxT4X7SIbrAqhNI9wiUvJ+W8A99wDEWdwrw25iVkkenAEb5LkIQPuIMJWJGQoriFd+iBCkhc8zUhfJSm7mva5l3aadubDgtpMgGKpB/eoBfuQZFoPNhBj9gTaC3kKkEEGXPswF7Y5rLro1AW8UI6GmelmAzfkUWlNaWt6/iT0DOOA5bqoSuzHfIvofATqSJQb8KoiJbtPi6x2dA9FPjXE1F/uZKrv3IwCFcNqVmoPlal7QJ9q/wZCbk7Ioo9/tehE9q1r0nIxNQbG4YEXdkVjQ5J2OZXbB88gVrgQIJNj9aaT4LboPK7J6O0Ktb1KYtc/aYxGff6h3AYY6Nvzk2GQ1WQTVj4BST70jYaqceXAAAAAElFTkSuQmCC",Oy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",Ly="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",Ny="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEcSURBVDhPrZSNDYIwEIXpBOIGjMAIOIE4AbgBGwAbOIJu4Aa4gW4gI+gE9b3mjjSmibSR5ALX3H33W4y1Ns+yrIe0EH7HPC8YnyGjAegkEB5cYyiwrdWXIEc1xnSREGcuiTQEWeg7gG4+CMcl9ALnLkvogwScv+wq6FMQJJCJDgBtBcSAI3QClwe2YZAHcY2Ho4kGAVLA6U5/CEvdp4KYhesFhBPpCZIAz6jStHhproJcHyAHbb5nF+6RZ8CsGslIQaHp/gSxRzlApU4GugPxNuDN/eNarAJxapUPgm8rQ9C1SAI9AOGiHhGApSdnRN8FshbEiLwiLI1rMUM6zSQ0tX9c2lp/Iw0iMIPU38iFIN1mTmOjKa98vyWB4QM5XQnvsbFsyAAAAABJRU5ErkJggg==",_y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",Uy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",Qy={class:"menu-container"},Gy=["onClick","title"],Hy={class:"menu-icon"},Yy=["src","alt"],Vy={key:3,style:{"font-size":"12px"}},zy={key:0,class:"sub-menu"},Wy=["onClick"],yi=c.defineComponent({__name:"LeitingMenu",props:{visible:{type:Boolean,default:!0},activeIds:{type:Array,default:()=>[]},is2d:{type:Boolean,default:!1},customItems:{type:Array,default:()=>[]}},emits:["action"],setup(i,{emit:e}){const t=i,n=c.inject("leiting-theme",c.ref("dark")),s=c.inject("leiting-menu-size",c.ref("medium")),o=c.inject("leitingMethods",c.ref({})),r=c.computed(()=>n.value||n),l=c.computed(()=>s.value||s),a=c.ref([{ID:"home",title:"主视角",src:Py,key:"homeView"},{ID:"tree",title:"目录树",src:al,key:"componentTree"},{ID:"cadLayer",title:"图层",src:al,key:"cadLayer"},{ID:"measure",title:"量算",src:Fy,key:"measurement"},{ID:"section",title:"剖切",src:Ry,key:"section"},{ID:"roam",title:"人物漫游",src:Oy,key:"roam"},{ID:"info",title:"构件信息",src:Ly,key:"componentInfo"},{ID:"cadPosition",title:"调整位置",src:Ny,key:"cadPosition"},{ID:"annotation",title:"标注",src:Uy,key:"annotation"},{ID:"setting",title:"设置",src:_y,key:"setting"}]),d=c.ref([]),h=c.ref([...t.activeIds]);c.watch(()=>t.activeIds,D=>{h.value=[...D]},{deep:!0});const f=c.computed(()=>t.visible);o.value&&o.value.menuEvents&&(o.value.menuEvents.on("setMenuListFilter",D=>{d.value=D}),o.value.menuEvents.on("setMenuActive",(D,N)=>{N?h.value.includes(D)||h.value.push(D):h.value=h.value.filter(I=>I!==D)}));const p=c.computed(()=>{let D=a.value;if(t.is2d){const N=["homeView","measurement","cadLayer","annotation"];D=D.filter(I=>I.key&&N.includes(I.key))}else{const N=["cadLayer","cadPosition","annotation"];D=D.filter(I=>!I.key||!N.includes(I.key))}if(d.value.length>0&&(D=D.filter(N=>!N.key||!d.value.includes(N.key))),t.customItems&&t.customItems.length>0){const N=t.customItems.map(I=>({...I,key:I.ID,src:I.src||I.icon}));return[...D,...N]}return D}),u=e,m=D=>{const N=["homeView"];if(D.key&&N.includes(D.key))h.value.includes(D.ID)||(h.value.push(D.ID),setTimeout(()=>{const B=h.value.indexOf(D.ID);B>-1&&h.value.splice(B,1)},1e3));else{const B=h.value.indexOf(D.ID);B>-1?h.value.splice(B,1):h.value.push(D.ID)}const I=h.value.includes(D.ID);D.func&&D.func(D),D.key&&u("action",D.key,I)},w=D=>{d.value=D},A=D=>{console.log("LeitingMenu received showMenu event:",D)},C=(D,N)=>{const I=p.value.find(B=>B.ID===D||B.key===D);if(I){const B=h.value.indexOf(I.ID);N&&B===-1?h.value.push(I.ID):!N&&B>-1&&h.value.splice(B,1)}};let v=null;const S=()=>{o.value?.menuEvents&&(v&&(v.off("setMenuListFilter",w),v.off("showMenu",A),v.off("setMenuActive",C)),v=o.value.menuEvents,v.on("setMenuListFilter",w),v.on("showMenu",A),v.on("setMenuActive",C))};return c.onMounted(()=>{S()}),c.onUnmounted(()=>{v&&(v.off("setMenuListFilter",w),v.off("showMenu",A),v.off("setMenuActive",C))}),c.watch(o,()=>{S()},{deep:!0}),(D,N)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["leiting-menu-wrapper",["leiting-theme-"+r.value,"size-"+l.value]])},[c.createElementVNode("div",Qy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.value,I=>(c.openBlock(),c.createElementBlock("div",{key:I.ID,class:c.normalizeClass(["menu-item",{active:h.value.includes(I.ID)}]),onClick:B=>m(I),title:I.title},[c.createElementVNode("div",Hy,[I.src?(c.openBlock(),c.createElementBlock("img",{key:0,src:I.src,alt:I.title},null,8,Yy)):typeof I.icon=="object"?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(I.icon),{key:1})):typeof I.icon=="string"?(c.openBlock(),c.createElementBlock("i",{key:2,class:c.normalizeClass(["iconfont",`icon-${I.icon}`])},null,2)):(c.openBlock(),c.createElementBlock("span",Vy,c.toDisplayString(I.title.substring(0,2)),1))]),I.children&&I.children.length>0?(c.openBlock(),c.createElementBlock("div",zy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.children,B=>(c.openBlock(),c.createElementBlock("div",{key:B.ID,class:c.normalizeClass(["sub-menu-item",{active:h.value.includes(B.ID)}]),onClick:c.withModifiers(g=>m(B),["stop"])},c.toDisplayString(B.title),11,Wy))),128))])):c.createCommentVNode("",!0)],10,Gy))),128))])],2)),[[c.vShow,f.value]])}}),jy={class:"leiting-section-content"},Ky={class:"section-form-item"},$y={class:"radio-group"},Xy={class:"section-form-item"},qy={class:"switch-container"},Jy={class:"switch"},Zy={class:"status-text"},e0={class:"section-form-item slider-item"},t0={class:"slider-wrapper"},i0={class:"section-form-item slider-item"},n0={class:"slider-wrapper"},s0={class:"section-form-item slider-item"},o0={class:"slider-wrapper"},r0={class:"section-form-item table-item"},a0={class:"model-table-container"},l0={class:"model-table"},c0={width:"40"},d0=["checked"],h0=["onClick"],u0=["value"],f0={class:"model-name"},Ci=Oe(c.defineComponent({__name:"LeitingSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"剖切控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:F=>{n("update:visible",F),n("update:open",F)}}),r=c.ref("Box"),l=c.ref(!1),a=c.ref([]),d=c.ref([]),h=c.computed(()=>d.value.length===0?!1:d.value.every(F=>a.value.includes(F.modelId))),f=F=>{F.target.checked?a.value=d.value.map(y=>y.modelId):a.value=[],P()},p=c.ref([-10,10]),u=c.ref([-10,10]),m=c.ref([-10,10]),w=c.ref([-100,100]),A=c.ref([-100,100]),C=c.ref([-100,100]);let v=!1;const S=F=>{v=!0;const{targetZPlus:E,targetZMinus:y,targetXPlus:b,targetXMinus:T,targetYPlus:R,targetYMinus:O}=F;m.value=[-y,E],p.value=[-T,b],u.value=[-O,R],setTimeout(()=>{v=!1},100)},D=()=>{v||a.value.length===0||!s?.value?.updateSectionRange||s.value.updateSectionRange({targetZPlus:m.value[1],targetZMinus:-m.value[0],targetXPlus:p.value[1],targetXMinus:-p.value[0],targetYPlus:u.value[1],targetYMinus:-u.value[0]})},N=()=>{s?.value?.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)},I=F=>{if(!s?.value?.getMapTileset||!s?.value?.openSection)return;const y=s.value.getMapTileset()[F];if(y&&y.leiting?.box){const{min:b,max:T}=y.leiting.box,R=(T.x-b.x)/2,O=(T.y-b.y)/2,L=(T.z-b.z)/2;a.value.length<=1&&(w.value=[-R*2,R*2],A.value=[-O*2,O*2],C.value=[-L*2,L*2],p.value=[-R,R],u.value=[-O,O],m.value=[-L,L],s.value.updateSectionRange&&s.value.updateSectionRange({targetZPlus:L,targetZMinus:L,targetXPlus:R,targetXMinus:R,targetYPlus:O,targetYMinus:O})),s.value.openSection(F,{moveCallBack:S}),s.value.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)}},B=F=>{const E=a.value.indexOf(F);E>-1?a.value.splice(E,1):a.value.push(F),P()};let g=[];const P=()=>{const F=a.value.filter(y=>!g.includes(y)),E=g.filter(y=>!a.value.includes(y));F.forEach(y=>I(y)),E.forEach(y=>{s?.value?.closeSection&&s.value.closeSection(y)}),g=[...a.value]},x=()=>{},k=()=>{o.value=!1,n("close")},_=()=>{l.value=!1,a.value=[],g=[],p.value=[-10,10],u.value=[-10,10],m.value=[-10,10],w.value=[-100,100],A.value=[-100,100],C.value=[-100,100]};c.watch(()=>t.visible,F=>{F?G():(s?.value?.closeSection&&s.value.closeSection(),_())});const G=()=>{s?.value&&typeof s.value.getModelList=="function"&&(d.value=s.value.getModelList()||[],d.value.length>0&&a.value.length===0&&(a.value=[d.value[0].modelId],g=[...a.value]),t.visible&&a.value.length>0&&(l.value=!0,a.value.forEach(F=>I(F))))};return c.watch(()=>s?.value,()=>{G()},{immediate:!0,deep:!0}),c.onMounted(()=>{G()}),(F,E)=>(c.openBlock(),c.createBlock(Pe,{visible:o.value,title:"剖切分析","full-height":i.fullHeight,"onUpdate:visible":k},{default:c.withCtx(()=>[c.createElementVNode("div",jy,[c.createElementVNode("div",Ky,[E[8]||(E[8]=c.createElementVNode("span",{class:"label"},"模式",-1)),c.createElementVNode("div",$y,[c.createElementVNode("label",{class:c.normalizeClass(["radio-item",{active:r.value==="Box"}])},[c.withDirectives(c.createElementVNode("input",{type:"radio",value:"Box","onUpdate:modelValue":E[0]||(E[0]=y=>r.value=y),onChange:x},null,544),[[c.vModelRadio,r.value]]),E[7]||(E[7]=c.createTextVNode(" 剖切盒 ",-1))],2)])]),c.createElementVNode("div",Xy,[E[10]||(E[10]=c.createElementVNode("span",{class:"label"},"显示",-1)),c.createElementVNode("div",qy,[c.createElementVNode("label",Jy,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":E[1]||(E[1]=y=>l.value=y),onChange:N},null,544),[[c.vModelCheckbox,l.value]]),E[9]||(E[9]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",Zy,c.toDisplayString(l.value?"显示":"隐藏"),1)])]),c.createElementVNode("div",e0,[E[11]||(E[11]=c.createElementVNode("span",{class:"label"},"X 轴",-1)),c.createElementVNode("div",t0,[c.createVNode(c.unref(ge.Slider),{value:p.value,"onUpdate:value":E[2]||(E[2]=y=>p.value=y),range:"",min:w.value[0],max:w.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",i0,[E[12]||(E[12]=c.createElementVNode("span",{class:"label"},"Y 轴",-1)),c.createElementVNode("div",n0,[c.createVNode(c.unref(ge.Slider),{value:u.value,"onUpdate:value":E[3]||(E[3]=y=>u.value=y),range:"",min:A.value[0],max:A.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",s0,[E[13]||(E[13]=c.createElementVNode("span",{class:"label"},"Z 轴",-1)),c.createElementVNode("div",o0,[c.createVNode(c.unref(ge.Slider),{value:m.value,"onUpdate:value":E[4]||(E[4]=y=>m.value=y),range:"",min:C.value[0],max:C.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",r0,[E[15]||(E[15]=c.createElementVNode("span",{class:"label"},"模型",-1)),c.createElementVNode("div",a0,[c.createElementVNode("table",l0,[c.createElementVNode("thead",null,[c.createElementVNode("tr",null,[c.createElementVNode("th",c0,[c.createElementVNode("input",{type:"checkbox",checked:h.value,onChange:f},null,40,d0)]),E[14]||(E[14]=c.createElementVNode("th",null,"名称",-1))])]),c.createElementVNode("tbody",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(d.value,y=>(c.openBlock(),c.createElementBlock("tr",{key:y.modelId,class:c.normalizeClass({selected:a.value.includes(y.modelId)}),onClick:b=>B(y.modelId)},[c.createElementVNode("td",null,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",value:y.modelId,"onUpdate:modelValue":E[5]||(E[5]=b=>a.value=b),onClick:E[6]||(E[6]=c.withModifiers(()=>{},["stop"])),onChange:P},null,40,u0),[[c.vModelCheckbox,a.value]])]),c.createElementVNode("td",f0,c.toDisplayString(y.modelName),1)],10,h0))),128))])])])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-ee4d9a12"]]),p0={class:"leiting-player-content"},g0={class:"player-form-item"},m0={class:"switch-container"},A0={class:"switch"},y0={class:"status-text"},C0={class:"player-form-item"},E0={class:"switch-container"},w0={class:"switch"},b0={class:"status-text"},v0={class:"player-form-item"},I0={class:"switch-container"},B0={class:"switch"},x0={class:"status-text"},S0={class:"player-form-item slider-item"},T0={class:"slider-wrapper"},M0={class:"value-text"},D0={class:"instructions"},k0={class:"key-map"},P0={class:"key-row"},F0={class:"key-row"},R0={class:"key-row"},O0={class:"key-row"},L0={class:"key-row"},N0={class:"key-row"},Ei=Oe(c.defineComponent({__name:"LeitingPlayer",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"漫游控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref(!1),r=c.ref(!1),l=c.ref(!0),a=c.ref(5),d=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:I=>{n("update:visible",I),n("update:open",I)}}),h=c.ref(null),f=c.ref(null),p=c.ref(null),u=c.ref(null),m=c.ref(null),w=c.ref(null),A=()=>{o.value?v():S()},C=()=>{s?.value?.setPlayerParams&&s.value.setPlayerParams({gravityTest:r.value,collisionTest:l.value})},v=async()=>{s?.value?.openPlayer&&(await s.value.openPlayer(),s.value.setPlayerSpeed&&s.value.setPlayerSpeed(a.value),C(),s.value.bindPlayerUiKeys&&(await c.nextTick(),s.value.bindPlayerUiKeys({moveFront:h.value,moveBack:f.value,moveLeft:p.value,moveRight:u.value,moveUp:m.value,moveDown:w.value})))},S=()=>{s?.value?.closePlayer&&s.value.closePlayer()},D=()=>{s?.value?.setPlayerSpeed&&s.value.setPlayerSpeed(a.value)},N=()=>{d.value=!1,n("close")};return c.watch(()=>t.visible,I=>{I?(o.value=!0,s?.value?v():setTimeout(()=>{s?.value&&v()},100)):o.value&&(o.value=!1,S())},{immediate:!0}),(I,B)=>(c.openBlock(),c.createBlock(Pe,{title:i.title,visible:d.value,"full-height":i.fullHeight,"onUpdate:visible":N},{default:c.withCtx(()=>[c.createElementVNode("div",p0,[c.createElementVNode("div",g0,[B[5]||(B[5]=c.createElementVNode("span",{class:"label"},"启用",-1)),c.createElementVNode("div",m0,[c.createElementVNode("label",A0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[0]||(B[0]=g=>o.value=g),onChange:A},null,544),[[c.vModelCheckbox,o.value]]),B[4]||(B[4]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",y0,c.toDisplayString(o.value?"开启":"关闭"),1)])]),c.createElementVNode("div",C0,[B[7]||(B[7]=c.createElementVNode("span",{class:"label"},"重力",-1)),c.createElementVNode("div",E0,[c.createElementVNode("label",w0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[1]||(B[1]=g=>r.value=g),onChange:C},null,544),[[c.vModelCheckbox,r.value]]),B[6]||(B[6]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",b0,c.toDisplayString(r.value?"开启":"关闭"),1)])]),c.createElementVNode("div",v0,[B[9]||(B[9]=c.createElementVNode("span",{class:"label"},"碰撞",-1)),c.createElementVNode("div",I0,[c.createElementVNode("label",B0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[2]||(B[2]=g=>l.value=g),onChange:C},null,544),[[c.vModelCheckbox,l.value]]),B[8]||(B[8]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",x0,c.toDisplayString(l.value?"开启":"关闭"),1)])]),c.createElementVNode("div",S0,[B[10]||(B[10]=c.createElementVNode("span",{class:"label"},"速度",-1)),c.createElementVNode("div",T0,[c.createVNode(c.unref(ge.Slider),{value:a.value,"onUpdate:value":B[3]||(B[3]=g=>a.value=g),min:1,max:10,step:1,onChange:D},null,8,["value"])]),c.createElementVNode("span",M0,c.toDisplayString(a.value),1)]),B[19]||(B[19]=c.createElementVNode("div",{class:"divider"},null,-1)),c.createElementVNode("div",D0,[B[18]||(B[18]=c.createElementVNode("div",{class:"instruction-title"},"操作说明",-1)),c.createElementVNode("div",k0,[c.createElementVNode("div",P0,[c.createElementVNode("span",{class:"key",ref_key:"btnFront",ref:h},"W",512),B[11]||(B[11]=c.createTextVNode(" 前进 ",-1))]),c.createElementVNode("div",F0,[c.createElementVNode("span",{class:"key",ref_key:"btnBack",ref:f},"S",512),B[12]||(B[12]=c.createTextVNode(" 后退 ",-1))]),c.createElementVNode("div",R0,[c.createElementVNode("span",{class:"key",ref_key:"btnLeft",ref:p},"A",512),B[13]||(B[13]=c.createTextVNode(" 左移 ",-1))]),c.createElementVNode("div",O0,[c.createElementVNode("span",{class:"key",ref_key:"btnRight",ref:u},"D",512),B[14]||(B[14]=c.createTextVNode(" 右移 ",-1))]),c.createElementVNode("div",L0,[c.createElementVNode("span",{class:"key",ref_key:"btnUp",ref:m},"Q",512),B[15]||(B[15]=c.createTextVNode(" 上升 ",-1))]),c.createElementVNode("div",N0,[c.createElementVNode("span",{class:"key",ref_key:"btnDown",ref:w},"E",512),B[16]||(B[16]=c.createTextVNode(" 下降 ",-1))]),B[17]||(B[17]=c.createElementVNode("div",{class:"key-row"},[c.createElementVNode("span",{class:"mouse-icon"},"🖱️"),c.createTextVNode(" 按住左键拖拽旋转视角 ")],-1))])])])]),_:1},8,["title","visible","full-height"]))}}),[["__scopeId","data-v-ff3f266e"]]),_0={class:"info-content"},U0={key:0,class:"component-title"},wi=Oe(c.defineComponent({__name:"LeitingInfo",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref([]),r=c.ref(!1),l=c.ref([]),a=c.ref([]),d=c.ref(0),h=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:C=>{n("update:visible",C),n("update:open",C)}}),f=()=>{h.value=!1},p=C=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[C]||C,u=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],m=async C=>{const v=++d.value;if(a.value=C,!C||C.length===0){o.value=[];return}if(!h.value)return;let S=C;C.length>10&&(fe.warning(`选中构件数量过多(${C.length}个),仅显示前10个`),S=C.slice(0,10));const D=s?.value;let N=D?.getMapTileset?D.getMapTileset():{};r.value=!0;const I=[],B={};if(S.forEach(x=>{const _=N[x.modelId]?.leiting?.model?.dbName;_&&x.elementId&&I.push({dbName:_,elementId:x.elementId,modelId:x.modelId})}),I.length>0){try{const x=I.map(G=>({dbName:G.dbName,elementId:G.elementId})),k=await Dr(x),_=Array.isArray(k)?k:k?.data;_&&Array.isArray(_)&&_.forEach(G=>{if(G){const F=`${G.modelId}_${G.elementId}`;B[F]=G}})}catch(x){console.warn("API fetch component details failed, falling back to local data",x)}console.log("123")}const g=new Set;if(S.forEach(x=>{const k=N[x.modelId],_=`${x.modelId}_${x.elementId}`;B[_]||k&&k.leiting&&!k.leiting?.node?.nodeExtras&&k.leiting.model?.nodeUrl&&g.add(x.modelId)}),g.size>0&&D?._loadNodeDetailsForModel)try{const x=Array.from(g).map(k=>D._loadNodeDetailsForModel(k));await Promise.all(x)}catch(x){console.error("Failed to load node details",x)}if(v!==d.value)return;N=D?.getMapTileset?D.getMapTileset():{};const P=[];S.forEach((x,k)=>{const G=N[x.modelId]?.leiting||{},F=B[`${x.modelId}_${x.elementId}`];let E={modelName:G.model?.modelId||x.modelId};E.elementID||(E.elementID=x.elementId);let y=null;if(F)y=F;else{const R=G.node?.nodeExtras?.element||G.node?.nodeExtras;if(R){const O=E.elementID;R[O]&&(y=R[O])}}y&&y.box3&&(E.length=`${y.box3.length?.toFixed(2)||0}米`,E.width=`${y.box3.width?.toFixed(2)||0}米`,E.height=`${y.box3.height?.toFixed(2)||0}米`);const b=[];y&&(y.name&&(E.elementName=y.name),y.categoryName&&(E.categoryName=y.categoryName),y.familySymbolName&&(E.familySymbolName=y.familySymbolName),y.levelName&&(E.levelName=y.levelName));const T={};if(u.forEach(R=>{E[R]!==void 0&&(T[R]=E[R])}),b.push({name:"基础信息",params:T}),y){const R=Array.isArray(y)?y:Array.isArray(y?.parameters)?y.parameters:null;if(R){if(R.flat().forEach(L=>{if(L&&L.GroupName&&Array.isArray(L.Parameters)){const M={};L.Parameters.forEach(Q=>{Q.name&&(M[Q.name]=Q.value??"")}),Object.keys(M).length>0&&b.push({name:L.GroupName,params:M})}}),!Array.isArray(y)){const{parameters:L,...M}=y,Q={};Object.keys(M).forEach(Y=>{!u.includes(Y)&&Y!=="uniqueId"&&typeof M[Y]!="object"&&(Q[Y]=M[Y])}),Object.keys(Q).length>0&&b.push({name:"其他属性",params:Q})}}else{let O=!1;if(Object.keys(y).forEach(L=>{y[L]&&typeof y[L]=="object"&&!Array.isArray(y[L])&&(O=!0,b.push({name:L,params:y[L]}))}),!O){const L={};Object.keys(y).forEach(M=>{if(!u.includes(M)&&M!=="batchId"){const Q=y[M];typeof Q=="string"&&Q.length>500?L[M]=Q.substring(0,500)+"...":L[M]=Q}}),Object.keys(L).length>0&&b.push({name:"属性",params:L})}}}P.push({id:k,title:`${E.modelName}${E.elementName?` - ${E.elementName}`:""}`,groups:b})}),o.value=P,v===d.value&&(r.value=!1),P.length>0?l.value=[`${P[0].id}-基础信息`]:l.value=[]};let w=!1;const A=()=>{if(w)return;const C=s?.value;C&&C.selectionChange&&(C.selectionChange(m),w=!0)};return c.watch(()=>s?.value,()=>{A()},{deep:!0,immediate:!0}),c.watch(h,C=>{C&&a.value.length>0&&m(a.value)}),c.onMounted(()=>{A()}),(C,v)=>(c.openBlock(),c.createBlock(Pe,{visible:h.value,title:"构件详情",width:350,align:"right","initial-position":{x:0,y:0},"full-height":i.fullHeight,onClose:f,"onUpdate:visible":v[1]||(v[1]=S=>h.value=S),class:"base-info-card"},{default:c.withCtx(()=>[c.createElementVNode("div",_0,[c.createVNode(c.unref(ge.Spin),{spinning:r.value},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,S=>(c.openBlock(),c.createElementBlock("div",{key:S.id,class:"component-block"},[o.value.length>1?(c.openBlock(),c.createElementBlock("div",U0,c.toDisplayString(S.title),1)):c.createCommentVNode("",!0),c.createVNode(c.unref(ge.Collapse),{activeKey:l.value,"onUpdate:activeKey":v[0]||(v[0]=D=>l.value=D),ghost:"","expand-icon-position":"end"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(S.groups,D=>(c.openBlock(),c.createBlock(c.unref(ge.CollapsePanel),{key:`${S.id}-${D.name}`,header:D.name},{default:c.withCtx(()=>[c.createVNode(c.unref(ge.Descriptions),{size:"small",bordered:"",column:1,labelStyle:{width:"100px",background:"rgba(255,255,255,0.05)",color:"#aaa"},contentStyle:{color:"#fff"}},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(D.params,(N,I)=>(c.openBlock(),c.createBlock(c.unref(ge.DescriptionsItem),{key:I,label:p(String(I))},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(N),1)]),_:2},1032,["label"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128))]),_:2},1032,["activeKey"])]))),128))]),_:1},8,["spinning"])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-1fb90635"]]);class ll{viewer;Cesium;pickHandler=null;bimEntityId="";mapEntityId="";constructor(e,t){this.viewer=e,this.Cesium=t}removeMarker(e){if(!this.viewer)return;const t=e==="BIM"?this.bimEntityId:this.mapEntityId;t&&(this.viewer.entities.removeById(t),e==="BIM"?this.bimEntityId="":this.mapEntityId="")}clearMarkers(){this.removeMarker("BIM"),this.removeMarker("MAP")}addMarker(e,t){if(!this.viewer||!this.Cesium)return;this.removeMarker(e);const n=`adjust-marker-${e}-${Date.now()}`;e==="BIM"?this.bimEntityId=n:this.mapEntityId=n,this.viewer.entities.add({id:n,position:this.Cesium.Cartesian3.fromDegrees(t.longitude,t.latitude,t.height),point:{pixelSize:10,color:e==="BIM"?this.Cesium.Color.RED:this.Cesium.Color.ORANGE,outlineColor:this.Cesium.Color.WHITE,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:`${e==="BIM"?"BIM":"地图"}标记点`,font:"14pt sans-serif",style:this.Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:new this.Cesium.Cartesian2(0,-10),fillColor:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLACK,backgroundColor:new this.Cesium.Color(.1,.1,.1,.8),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}registerPickHandler(e){this.destroyPickHandler(),!(!this.Cesium||!this.viewer)&&(this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pickHandler.setInputAction(t=>{let n;try{n=this.viewer.scene.pickPosition(t.position)}catch(s){console.warn("pickPosition failed:",s)}if(!n){const s=this.viewer.camera.getPickRay(t.position);n=this.viewer.scene.globe.pick(s,this.viewer.scene)}if(n||(n=this.viewer.camera.pickEllipsoid(t.position,this.viewer.scene.globe.ellipsoid)),n){const s=this.Cesium.Cartographic.fromCartesian(n),o=this.Cesium.Math.toDegrees(s.longitude),r=this.Cesium.Math.toDegrees(s.latitude),l=s.height;e({longitude:o,latitude:r,height:l})}},this.Cesium.ScreenSpaceEventType.LEFT_CLICK,this.Cesium.KeyboardEventModifier.SHIFT))}destroyPickHandler(){this.pickHandler&&(this.pickHandler.destroy(),this.pickHandler=null)}calculateOffset(e,t){return{dLon:t.longitude-e.longitude,dLat:t.latitude-e.latitude,dHeight:t.height-e.height}}}const Q0={class:"adjust-panel"},G0={class:"control-panel"},H0={class:"form-item"},Y0={class:"radio-group"},V0={class:"form-item"},z0={class:"radio-group"},W0={class:"form-item"},j0={class:"value"},K0={class:"param-row"},$0={class:"param-row"},X0={class:"param-row"},q0={class:"param-row"},J0={class:"param-row"},Z0={class:"param-row"},eC={class:"param-row"},tC={class:"button-grid"},iC={key:1,class:"pick-mode-ui"},nC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},sC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},oC=["checked"],rC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},aC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},lC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},cC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},dC=["checked"],hC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},uC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},fC={class:"list-panel"},pC={class:"list-header"},gC={class:"col-check"},mC=["checked"],AC={class:"list-body"},yC={class:"col-check"},CC=["onUpdate:modelValue"],EC={class:"col-index"},wC=["title"],bC={class:"col-main"},vC=["checked","onChange"],bi=Oe(c.defineComponent({__name:"LeitingPosition",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=c.computed({get:()=>n.open!==void 0?n.open:n.visible,set:L=>{s("update:visible",L),s("update:open",L)}}),r=c.inject("leitingMethods"),l=c.ref("BIM"),a=c.ref("param"),d=c.ref(""),h=c.ref([]),f=c.ref("BIM"),p=c.ref(null),u=c.ref(null),m=c.ref(null),w=()=>(!m.value&&r?.value?.getViewer&&r?.value?.getCesium&&(m.value=new ll(r.value.getViewer(),r.value.getCesium())),m.value),A=()=>{w()?.clearMarkers(),p.value=null,u.value=null},C=(L,M)=>{L==="BIM"?p.value=M:u.value=M,w()?.addMarker(L,M),fe.success(`${L==="BIM"?"BIM":"地图"}标记点已添加`)},v=()=>{w()?.registerPickHandler(L=>{C(f.value,L)})},S=()=>{w()?.destroyPickHandler()},D=()=>{if(!p.value||!u.value){fe.warning("请先选择BIM标记点和地图标记点");return}if(!d.value){fe.warning("请先选择主模型");return}const L=w();let M=0,Q=0,Y=0;if(L){const{dLon:W,dLat:q,dHeight:Z}=L.calculateOffset(p.value,u.value);M=W,Q=q,Y=Z}else M=u.value.longitude-p.value.longitude,Q=u.value.latitude-p.value.latitude,Y=u.value.height-p.value.height;I.value.longitude+=M,I.value.latitude+=Q,I.value.height+=Y,y(d.value,{longitude:I.value.longitude,latitude:I.value.latitude,height:I.value.height}),fe.success("位置已调整")};c.watch(()=>a.value,L=>{L==="pick"?v():S()}),e({addMarker:C,setModelType:L=>{(L==="BIM"||L==="OSGB")&&(l.value=L)}});const I=c.ref({longitude:0,latitude:0,lonlat:1e-6,heightDistance:1,rotation:30,totalRotation:0,height:0,X:0,Y:0,Z:0}),B=c.computed(()=>{const L=h.value.find(M=>M.modelId===d.value);return L?L.modelName:""}),g=c.computed(()=>x.value.length>0&&x.value.every(L=>L.selected)),P=()=>{o.value=!1,s("close")},x=c.computed(()=>h.value.filter(L=>L.type===l.value)),k=L=>{const M=L.target.checked;x.value.forEach(Q=>Q.selected=M)},_=()=>{if(!r?.value)return;const L=r.value,M=L.getMapTileset?L.getMapTileset():{},Q=[];if(Object.keys(M).forEach(Y=>{const q=M[Y].leiting||{};q.model&&Q.push({modelId:q.model.modelId,modelName:q.model.modelName,selected:!1,formData:q.model.formData||{},dbName:q.model.dbName,url:q.model.url,type:q.model.type||"BIM"})}),h.value=Q,Q.length>0){const Y=L.getBIMmodelId?L.getBIMmodelId():"";Y&&Q.find(W=>W.modelId===Y)?F(Y):F(Q[0].modelId),Q.forEach(W=>W.selected=!0)}},G=()=>{fe.info("拖动右下角标,可显示模型列表",void 0,2)},F=L=>{d.value=L;const M=h.value.find(Q=>Q.modelId===L);M&&M.formData&&Object.keys(I.value).forEach(Q=>{M.formData[Q]!==void 0&&(I.value[Q]=M.formData[Q])})},E=L=>r?.value?.getMapTileset?r.value.getMapTileset()[L]:null,y=(L,M)=>{const Q=E(L),Y=r.value.getCesium();if(Q&&Y){if(Q.leiting?.model){Q.leiting.model.formData={...Q.leiting.model.formData,...M};const W=h.value.find(q=>q.modelId===L);W&&(W.formData=Q.leiting.model.formData)}Rn({Cesium:Y,tileset:Q})}},b=L=>{if(!d.value)return;const Q=h.value.find(q=>q.modelId===d.value)?.formData?.[L]??0,Y=I.value[L],W=Y-Q;y(d.value,{[L]:Y}),W!==0&&x.value.filter(Z=>Z.selected&&Z.modelId!==d.value).forEach(Z=>{const ne=(Z.formData?.[L]??0)+W;y(Z.modelId,{[L]:ne})})},T=L=>{const M=x.value.filter(q=>q.selected);if(M.length===0){fe.warning("请先选择要调整的模型");return}const{lonlat:Q,heightDistance:Y,rotation:W}=I.value;M.forEach(q=>{const Z={...q.formData};switch(L){case"north":Z.latitude+=Q;break;case"south":Z.latitude-=Q;break;case"east":Z.longitude+=Q;break;case"west":Z.longitude-=Q;break;case"up":Z.height+=Y;break;case"down":Z.height-=Y;break;case"rotateLeft":Z.totalRotation=(Z.totalRotation||0)+W;break;case"rotateRight":Z.totalRotation=(Z.totalRotation||0)-W;break}q.modelId===d.value&&(Z.lonlat=Q,Z.heightDistance=Y,Z.rotation=W,Object.assign(I.value,Z)),y(q.modelId,Z)})},R=()=>{if(!d.value){fe.warning("请先选择主模型");return}const L=E(d.value);if(!L||!r?.value?.getViewer)return;const M=r.value.getViewer(),Q=r.value.getCesium(),Y=L.boundingSphere;M.camera.flyToBoundingSphere(Y,{offset:new Q.HeadingPitchRange(0,Q.Math.toRadians(-90),Y.radius*2),duration:1.5})},O=()=>{r?.value?.saveRegion?(r.value.saveRegion(h.value),s("save",c.unref(h))):(console.log("Save models:",h.value),fe.warning("未找到保存接口,数据已打印控制台"))};return c.watch(()=>n.visible,L=>{L?(_(),G(),a.value==="pick"&&v()):(S(),A())}),c.onMounted(()=>{n.visible&&(_(),G(),a.value==="pick"&&v())}),(L,M)=>(c.openBlock(),c.createBlock(Pe,{visible:o.value,title:"调整位置(调整前可选择正北俯视)","full-height":i.fullHeight,width:260,"onUpdate:visible":M[25]||(M[25]=Q=>o.value=Q),onClose:P,onSave:O,class:"base-position-card"},{default:c.withCtx(()=>[c.createElementVNode("div",Q0,[c.createElementVNode("div",G0,[c.createElementVNode("div",H0,[M[26]||(M[26]=c.createElementVNode("label",null,"模型类型:",-1)),c.createElementVNode("div",Y0,[c.createElementVNode("span",{class:c.normalizeClass({active:l.value==="BIM"}),onClick:M[0]||(M[0]=Q=>l.value="BIM")},"BIM模型",2),c.createElementVNode("span",{class:c.normalizeClass({active:l.value==="OSGB"}),onClick:M[1]||(M[1]=Q=>l.value="OSGB")},"倾斜摄影",2)])]),c.createElementVNode("div",V0,[M[27]||(M[27]=c.createElementVNode("label",null,"调整操作:",-1)),c.createElementVNode("div",z0,[c.createElementVNode("span",{class:c.normalizeClass({active:a.value==="param"}),onClick:M[2]||(M[2]=Q=>a.value="param")},"参数模式",2),c.createElementVNode("span",{class:c.normalizeClass({active:a.value==="pick"}),onClick:M[3]||(M[3]=Q=>a.value="pick")},"地图点选",2)])]),c.createElementVNode("div",W0,[M[28]||(M[28]=c.createElementVNode("label",null,"当前主模型:",-1)),c.createElementVNode("span",j0,c.toDisplayString(B.value||"未选择"),1)]),M[42]||(M[42]=c.createElementVNode("div",{class:"separator"},null,-1)),a.value==="param"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[M[36]||(M[36]=c.createElementVNode("div",{class:"group-header"},"当前状态",-1)),c.createElementVNode("div",K0,[M[29]||(M[29]=c.createElementVNode("label",null,"经度(东西):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[4]||(M[4]=Q=>I.value.longitude=Q),onChange:M[5]||(M[5]=Q=>b("longitude")),step:"0.000001"},null,544),[[c.vModelText,I.value.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",$0,[M[30]||(M[30]=c.createElementVNode("label",null,"纬度(南北):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[6]||(M[6]=Q=>I.value.latitude=Q),onChange:M[7]||(M[7]=Q=>b("latitude")),step:"0.000001"},null,544),[[c.vModelText,I.value.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",X0,[M[31]||(M[31]=c.createElementVNode("label",null,"高度(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[8]||(M[8]=Q=>I.value.height=Q),onChange:M[9]||(M[9]=Q=>b("height")),step:"0.1"},null,544),[[c.vModelText,I.value.height,void 0,{number:!0}]])]),c.createElementVNode("div",q0,[M[32]||(M[32]=c.createElementVNode("label",null,"累计旋转(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[10]||(M[10]=Q=>I.value.totalRotation=Q),onChange:M[11]||(M[11]=Q=>b("totalRotation")),step:"1"},null,544),[[c.vModelText,I.value.totalRotation,void 0,{number:!0}]])]),M[37]||(M[37]=c.createElementVNode("div",{class:"separator"},null,-1)),M[38]||(M[38]=c.createElementVNode("div",{class:"group-header"},"调整步长",-1)),c.createElementVNode("div",J0,[M[33]||(M[33]=c.createElementVNode("label",null,"经纬步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[12]||(M[12]=Q=>I.value.lonlat=Q),step:"0.000001"},null,512),[[c.vModelText,I.value.lonlat,void 0,{number:!0}]])]),c.createElementVNode("div",Z0,[M[34]||(M[34]=c.createElementVNode("label",null,"高度步长(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[13]||(M[13]=Q=>I.value.heightDistance=Q),step:"0.1"},null,512),[[c.vModelText,I.value.heightDistance,void 0,{number:!0}]])]),c.createElementVNode("div",eC,[M[35]||(M[35]=c.createElementVNode("label",null,"旋转步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[14]||(M[14]=Q=>I.value.rotation=Q),step:"1"},null,512),[[c.vModelText,I.value.rotation,void 0,{number:!0}]])]),c.createElementVNode("div",tC,[c.createElementVNode("button",{onClick:M[15]||(M[15]=Q=>T("rotateLeft"))},"左转"),c.createElementVNode("button",{onClick:M[16]||(M[16]=Q=>T("north"))},"北移"),c.createElementVNode("button",{onClick:M[17]||(M[17]=Q=>T("rotateRight"))},"右转"),c.createElementVNode("button",{onClick:M[18]||(M[18]=Q=>T("west"))},"西移"),c.createElementVNode("button",{onClick:M[19]||(M[19]=Q=>T("south"))},"南移"),c.createElementVNode("button",{onClick:M[20]||(M[20]=Q=>T("east"))},"东移"),c.createElementVNode("button",{onClick:M[21]||(M[21]=Q=>T("up"))},"上移"),c.createElementVNode("button",{onClick:M[22]||(M[22]=Q=>T("down"))},"下移"),c.createElementVNode("button",{onClick:R,class:"primary-btn"},"正北俯视"),c.createElementVNode("button",{onClick:O,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):a.value==="pick"?(c.openBlock(),c.createElementBlock("div",iC,[c.createElementVNode("div",nC,[c.createElementVNode("div",sC,[c.createElementVNode("div",{onClick:M[23]||(M[23]=Q=>f.value="BIM"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[c.createElementVNode("input",{type:"radio",checked:f.value==="BIM",style:{"margin-right":"5px"}},null,8,oC),M[39]||(M[39]=c.createElementVNode("span",{style:{"font-weight":"bold"}},"BIM标记点:",-1))]),p.value?(c.openBlock(),c.createElementBlock("div",rC,[c.createElementVNode("div",null,"经度:"+c.toDisplayString(p.value.longitude.toFixed(10)),1),c.createElementVNode("div",null,"纬度:"+c.toDisplayString(p.value.latitude.toFixed(10)),1)])):(c.openBlock(),c.createElementBlock("div",aC,"未选择"))])]),c.createElementVNode("div",lC,[c.createElementVNode("div",cC,[c.createElementVNode("div",{onClick:M[24]||(M[24]=Q=>f.value="MAP"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[c.createElementVNode("input",{type:"radio",checked:f.value==="MAP",style:{"margin-right":"5px"}},null,8,dC),M[40]||(M[40]=c.createElementVNode("span",{style:{"font-weight":"bold"}},"地图标记点:",-1))]),u.value?(c.openBlock(),c.createElementBlock("div",hC,[c.createElementVNode("div",null,"经度:"+c.toDisplayString(u.value.longitude.toFixed(10)),1),c.createElementVNode("div",null,"纬度:"+c.toDisplayString(u.value.latitude.toFixed(10)),1)])):(c.openBlock(),c.createElementBlock("div",uC,"未选择"))])]),c.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[c.createElementVNode("button",{onClick:D},"调整位置"),c.createElementVNode("button",{onClick:O},"保存")]),M[41]||(M[41]=c.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[c.createElementVNode("div",null,"操作指南:"),c.createElementVNode("div",null,"1. 勾选上方 BIM 或 地图 标记点选项。"),c.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),c.createElementVNode("div",null,"3. 采集两点后,点击“调整位置”进行校准。")],-1))])):c.createCommentVNode("",!0)]),c.createElementVNode("div",fC,[c.createElementVNode("div",pC,[c.createElementVNode("div",gC,[c.createElementVNode("input",{type:"checkbox",checked:g.value,onChange:k},null,40,mC)]),M[43]||(M[43]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),M[44]||(M[44]=c.createElementVNode("div",{class:"col-name"},"名称",-1)),M[45]||(M[45]=c.createElementVNode("div",{class:"col-main"},"主模型",-1))]),c.createElementVNode("div",AC,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.value,(Q,Y)=>(c.openBlock(),c.createElementBlock("div",{key:Q.modelId,class:c.normalizeClass(["list-item",{active:Q.modelId===d.value}])},[c.createElementVNode("div",yC,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":W=>Q.selected=W},null,8,CC),[[c.vModelCheckbox,Q.selected]])]),c.createElementVNode("div",EC,c.toDisplayString(Y+1),1),c.createElementVNode("div",{class:"col-name",title:Q.modelName},c.toDisplayString(Q.modelName),9,wC),c.createElementVNode("div",bC,[c.createElementVNode("input",{type:"radio",name:"mainModel",checked:Q.modelId===d.value,onChange:W=>F(Q.modelId)},null,40,vC)])],2))),128))])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-9737215c"]]);function ln(){return ln=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},ln.apply(null,arguments)}const IC={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},BC={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},cl={lang:ln({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},IC),timePickerLocale:ln({},BC)};cl.lang.ok="确定";var cn={exports:{}},xC=cn.exports,dl;function hl(){return dl||(dl=1,(function(i,e){(function(t,n){i.exports=n()})(xC,(function(){var t=1e3,n=6e4,s=36e5,o="millisecond",r="second",l="minute",a="hour",d="day",h="week",f="month",p="quarter",u="year",m="date",w="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var E=["th","st","nd","rd"],y=F%100;return"["+F+(E[(y-20)%10]||E[y]||E[0])+"]"}},S=function(F,E,y){var b=String(F);return!b||b.length>=E?F:""+Array(E+1-b.length).join(y)+F},D={s:S,z:function(F){var E=-F.utcOffset(),y=Math.abs(E),b=Math.floor(y/60),T=y%60;return(E<=0?"+":"-")+S(b,2,"0")+":"+S(T,2,"0")},m:function F(E,y){if(E.date()<y.date())return-F(y,E);var b=12*(y.year()-E.year())+(y.month()-E.month()),T=E.clone().add(b,f),R=y-T<0,O=E.clone().add(b+(R?-1:1),f);return+(-(b+(y-T)/(R?T-O:O-T))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:u,w:h,d,D:m,h:a,m:l,s:r,ms:o,Q:p}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},N="en",I={};I[N]=v;var B="$isDayjsObject",g=function(F){return F instanceof _||!(!F||!F[B])},P=function F(E,y,b){var T;if(!E)return N;if(typeof E=="string"){var R=E.toLowerCase();I[R]&&(T=R),y&&(I[R]=y,T=R);var O=E.split("-");if(!T&&O.length>1)return F(O[0])}else{var L=E.name;I[L]=E,T=L}return!b&&T&&(N=T),T||!b&&N},x=function(F,E){if(g(F))return F.clone();var y=typeof E=="object"?E:{};return y.date=F,y.args=arguments,new _(y)},k=D;k.l=P,k.i=g,k.w=function(F,E){return x(F,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var _=(function(){function F(y){this.$L=P(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[B]=!0}var E=F.prototype;return E.parse=function(y){this.$d=(function(b){var T=b.date,R=b.utc;if(T===null)return new Date(NaN);if(k.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var O=T.match(A);if(O){var L=O[2]-1||0,M=(O[7]||"0").substring(0,3);return R?new Date(Date.UTC(O[1],L,O[3]||1,O[4]||0,O[5]||0,O[6]||0,M)):new Date(O[1],L,O[3]||1,O[4]||0,O[5]||0,O[6]||0,M)}}return new Date(T)})(y),this.init()},E.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},E.$utils=function(){return k},E.isValid=function(){return this.$d.toString()!==w},E.isSame=function(y,b){var T=x(y);return this.startOf(b)<=T&&T<=this.endOf(b)},E.isAfter=function(y,b){return x(y)<this.startOf(b)},E.isBefore=function(y,b){return this.endOf(b)<x(y)},E.$g=function(y,b,T){return k.u(y)?this[b]:this.set(T,y)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(y,b){var T=this,R=!!k.u(b)||b,O=k.p(y),L=function(ne,se){var pe=k.w(T.$u?Date.UTC(T.$y,se,ne):new Date(T.$y,se,ne),T);return R?pe:pe.endOf(d)},M=function(ne,se){return k.w(T.toDate()[ne].apply(T.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(se)),T)},Q=this.$W,Y=this.$M,W=this.$D,q="set"+(this.$u?"UTC":"");switch(O){case u:return R?L(1,0):L(31,11);case f:return R?L(1,Y):L(0,Y+1);case h:var Z=this.$locale().weekStart||0,oe=(Q<Z?Q+7:Q)-Z;return L(R?W-oe:W+(6-oe),Y);case d:case m:return M(q+"Hours",0);case a:return M(q+"Minutes",1);case l:return M(q+"Seconds",2);case r:return M(q+"Milliseconds",3);default:return this.clone()}},E.endOf=function(y){return this.startOf(y,!1)},E.$set=function(y,b){var T,R=k.p(y),O="set"+(this.$u?"UTC":""),L=(T={},T[d]=O+"Date",T[m]=O+"Date",T[f]=O+"Month",T[u]=O+"FullYear",T[a]=O+"Hours",T[l]=O+"Minutes",T[r]=O+"Seconds",T[o]=O+"Milliseconds",T)[R],M=R===d?this.$D+(b-this.$W):b;if(R===f||R===u){var Q=this.clone().set(m,1);Q.$d[L](M),Q.init(),this.$d=Q.set(m,Math.min(this.$D,Q.daysInMonth())).$d}else L&&this.$d[L](M);return this.init(),this},E.set=function(y,b){return this.clone().$set(y,b)},E.get=function(y){return this[k.p(y)]()},E.add=function(y,b){var T,R=this;y=Number(y);var O=k.p(b),L=function(Y){var W=x(R);return k.w(W.date(W.date()+Math.round(Y*y)),R)};if(O===f)return this.set(f,this.$M+y);if(O===u)return this.set(u,this.$y+y);if(O===d)return L(1);if(O===h)return L(7);var M=(T={},T[l]=n,T[a]=s,T[r]=t,T)[O]||1,Q=this.$d.getTime()+y*M;return k.w(Q,this)},E.subtract=function(y,b){return this.add(-1*y,b)},E.format=function(y){var b=this,T=this.$locale();if(!this.isValid())return T.invalidDate||w;var R=y||"YYYY-MM-DDTHH:mm:ssZ",O=k.z(this),L=this.$H,M=this.$m,Q=this.$M,Y=T.weekdays,W=T.months,q=T.meridiem,Z=function(se,pe,ve,V){return se&&(se[pe]||se(b,R))||ve[pe].slice(0,V)},oe=function(se){return k.s(L%12||12,se,"0")},ne=q||function(se,pe,ve){var V=se<12?"AM":"PM";return ve?V.toLowerCase():V};return R.replace(C,(function(se,pe){return pe||(function(ve){switch(ve){case"YY":return String(b.$y).slice(-2);case"YYYY":return k.s(b.$y,4,"0");case"M":return Q+1;case"MM":return k.s(Q+1,2,"0");case"MMM":return Z(T.monthsShort,Q,W,3);case"MMMM":return Z(W,Q);case"D":return b.$D;case"DD":return k.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return Z(T.weekdaysMin,b.$W,Y,2);case"ddd":return Z(T.weekdaysShort,b.$W,Y,3);case"dddd":return Y[b.$W];case"H":return String(L);case"HH":return k.s(L,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return ne(L,M,!0);case"A":return ne(L,M,!1);case"m":return String(M);case"mm":return k.s(M,2,"0");case"s":return String(b.$s);case"ss":return k.s(b.$s,2,"0");case"SSS":return k.s(b.$ms,3,"0");case"Z":return O}return null})(se)||O.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(y,b,T){var R,O=this,L=k.p(b),M=x(y),Q=(M.utcOffset()-this.utcOffset())*n,Y=this-M,W=function(){return k.m(O,M)};switch(L){case u:R=W()/12;break;case f:R=W();break;case p:R=W()/3;break;case h:R=(Y-Q)/6048e5;break;case d:R=(Y-Q)/864e5;break;case a:R=Y/s;break;case l:R=Y/n;break;case r:R=Y/t;break;default:R=Y}return T?R:k.a(R)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return I[this.$L]},E.locale=function(y,b){if(!y)return this.$L;var T=this.clone(),R=P(y,b,!0);return R&&(T.$L=R),T},E.clone=function(){return k.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},F})(),G=_.prototype;return x.prototype=G,[["$ms",o],["$s",r],["$m",l],["$H",a],["$W",d],["$M",f],["$y",u],["$D",m]].forEach((function(F){G[F[1]]=function(E){return this.$g(E,F[0],F[1])}})),x.extend=function(F,E){return F.$i||(F(E,_,x),F.$i=!0),x},x.locale=P,x.isDayjs=g,x.unix=function(F){return x(1e3*F)},x.en=I[N],x.Ls=I,x.p={},x}))})(cn)),cn.exports}var SC=hl();const ze=Gt(SC);var dn={exports:{}},TC=dn.exports,ul;function MC(){return ul||(ul=1,(function(i,e){(function(t,n){i.exports=n(hl())})(TC,(function(t){function n(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var s=n(t),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(r,l){return l==="W"?r+"周":r+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(r,l){var a=100*r+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return s.default.locale(o,null,!0),o}))})(dn)),dn.exports}MC();var hn={exports:{}},DC=hn.exports,fl;function kC(){return fl||(fl=1,(function(i,e){(function(t,n){i.exports=n()})(DC,(function(){return function(t,n,s){var o=n.prototype,r=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,p,u,m,w){var A=f.name?f:f.$locale(),C=r(A[p]),v=r(A[u]),S=C||v.map((function(N){return N.slice(0,m)}));if(!w)return S;var D=A.weekStart;return S.map((function(N,I){return S[(I+(D||0))%7]}))},a=function(){return s.Ls[s.locale()]},d=function(f,p){return f.formats[p]||(function(u){return u.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(m,w,A){return w||A.slice(1)}))})(f.formats[p.toUpperCase()])},h=function(){var f=this;return{months:function(p){return p?p.format("MMMM"):l(f,"months")},monthsShort:function(p){return p?p.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(p){return p?p.format("dddd"):l(f,"weekdays")},weekdaysMin:function(p){return p?p.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(p){return p?p.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(p){return d(f.$locale(),p)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return h.bind(this)()},s.localeData=function(){var f=a();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(p){return d(f,p)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return l(a(),"months")},s.monthsShort=function(){return l(a(),"monthsShort","months",3)},s.weekdays=function(f){return l(a(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return l(a(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return l(a(),"weekdaysMin","weekdays",2,f)}}}))})(hn)),hn.exports}var PC=kC();const FC=Gt(PC);var un={exports:{}},RC=un.exports,pl;function OC(){return pl||(pl=1,(function(i,e){(function(t,n){i.exports=n()})(RC,(function(){return function(t,n){n.prototype.weekday=function(s){var o=this.$locale().weekStart||0,r=this.$W,l=(r<o?r+7:r)-o;return this.$utils().u(s)?l:this.subtract(l,"day").add(s,"day")}}}))})(un)),un.exports}var LC=OC();const NC=Gt(LC);var fn={exports:{}},_C=fn.exports,gl;function UC(){return gl||(gl=1,(function(i,e){(function(t,n){i.exports=n()})(_C,(function(){var t="week",n="year";return function(s,o,r){var l=o.prototype;l.week=function(a){if(a===void 0&&(a=null),a!==null)return this.add(7*(a-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=r(this).startOf(n).add(1,n).date(d),f=r(this).endOf(t);if(h.isBefore(f))return 1}var p=r(this).startOf(n).date(d).startOf(t).subtract(1,"millisecond"),u=this.diff(p,t,!0);return u<0?r(this).startOf("week").week():Math.ceil(u)},l.weeks=function(a){return a===void 0&&(a=null),this.week(a)}}}))})(fn)),fn.exports}var QC=UC();const GC=Gt(QC);var pn={exports:{}},HC=pn.exports,ml;function YC(){return ml||(ml=1,(function(i,e){(function(t,n){i.exports=n()})(HC,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,o=/\d\d/,r=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,a={},d=function(A){return(A=+A)+(A>68?1900:2e3)},h=function(A){return function(C){this[A]=+C}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(A){(this.zone||(this.zone={})).offset=(function(C){if(!C||C==="Z")return 0;var v=C.match(/([+-]|\d\d)/g),S=60*v[1]+(+v[2]||0);return S===0?0:v[0]==="+"?-S:S})(A)}],p=function(A){var C=a[A];return C&&(C.indexOf?C:C.s.concat(C.f))},u=function(A,C){var v,S=a.meridiem;if(S){for(var D=1;D<=24;D+=1)if(A.indexOf(S(D,0,C))>-1){v=D>12;break}}else v=A===(C?"pm":"PM");return v},m={A:[l,function(A){this.afternoon=u(A,!1)}],a:[l,function(A){this.afternoon=u(A,!0)}],Q:[s,function(A){this.month=3*(A-1)+1}],S:[s,function(A){this.milliseconds=100*+A}],SS:[o,function(A){this.milliseconds=10*+A}],SSS:[/\d{3}/,function(A){this.milliseconds=+A}],s:[r,h("seconds")],ss:[r,h("seconds")],m:[r,h("minutes")],mm:[r,h("minutes")],H:[r,h("hours")],h:[r,h("hours")],HH:[r,h("hours")],hh:[r,h("hours")],D:[r,h("day")],DD:[o,h("day")],Do:[l,function(A){var C=a.ordinal,v=A.match(/\d+/);if(this.day=v[0],C)for(var S=1;S<=31;S+=1)C(S).replace(/\[|\]/g,"")===A&&(this.day=S)}],w:[r,h("week")],ww:[o,h("week")],M:[r,h("month")],MM:[o,h("month")],MMM:[l,function(A){var C=p("months"),v=(p("monthsShort")||C.map((function(S){return S.slice(0,3)}))).indexOf(A)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[l,function(A){var C=p("months").indexOf(A)+1;if(C<1)throw new Error;this.month=C%12||C}],Y:[/[+-]?\d+/,h("year")],YY:[o,function(A){this.year=d(A)}],YYYY:[/\d{4}/,h("year")],Z:f,ZZ:f};function w(A){var C,v;C=A,v=a&&a.formats;for(var S=(A=C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,k,_){var G=_&&_.toUpperCase();return k||v[_]||t[_]||v[G].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(F,E,y){return E||y.slice(1)}))}))).match(n),D=S.length,N=0;N<D;N+=1){var I=S[N],B=m[I],g=B&&B[0],P=B&&B[1];S[N]=P?{regex:g,parser:P}:I.replace(/^\[|\]$/g,"")}return function(x){for(var k={},_=0,G=0;_<D;_+=1){var F=S[_];if(typeof F=="string")G+=F.length;else{var E=F.regex,y=F.parser,b=x.slice(G),T=E.exec(b)[0];y.call(k,T),x=x.replace(T,"")}}return(function(R){var O=R.afternoon;if(O!==void 0){var L=R.hours;O?L<12&&(R.hours+=12):L===12&&(R.hours=0),delete R.afternoon}})(k),k}}return function(A,C,v){v.p.customParseFormat=!0,A&&A.parseTwoDigitYear&&(d=A.parseTwoDigitYear);var S=C.prototype,D=S.parse;S.parse=function(N){var I=N.date,B=N.utc,g=N.args;this.$u=B;var P=g[1];if(typeof P=="string"){var x=g[2]===!0,k=g[3]===!0,_=x||k,G=g[2];k&&(G=g[2]),a=this.$locale(),!x&&G&&(a=v.Ls[G]),this.$d=(function(b,T,R,O){try{if(["x","X"].indexOf(T)>-1)return new Date((T==="X"?1e3:1)*b);var L=w(T)(b),M=L.year,Q=L.month,Y=L.day,W=L.hours,q=L.minutes,Z=L.seconds,oe=L.milliseconds,ne=L.zone,se=L.week,pe=new Date,ve=Y||(M||Q?1:pe.getDate()),V=M||pe.getFullYear(),j=0;M&&!Q||(j=Q>0?Q-1:pe.getMonth());var te,Ae=W||0,Ce=q||0,Me=Z||0,Le=oe||0;return ne?new Date(Date.UTC(V,j,ve,Ae,Ce,Me,Le+60*ne.offset*1e3)):R?new Date(Date.UTC(V,j,ve,Ae,Ce,Me,Le)):(te=new Date(V,j,ve,Ae,Ce,Me,Le),se&&(te=O(te).week(se).toDate()),te)}catch{return new Date("")}})(I,P,B,v),this.init(),G&&G!==!0&&(this.$L=this.locale(G).$L),_&&I!=this.format(P)&&(this.$d=new Date("")),a={}}else if(P instanceof Array)for(var F=P.length,E=1;E<=F;E+=1){g[1]=P[E-1];var y=v.apply(this,g);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}E===F&&(this.$d=new Date(""))}else D.call(this,N)}}}))})(pn)),pn.exports}var VC=YC();const zC=Gt(VC),WC={class:"setting-panel"},jC={class:"tabs-header"},KC={class:"tab-content"},$C={key:0,class:"section"},XC={class:"setting-item"},qC={class:"setting-item"},JC={class:"setting-item"},ZC={key:1,class:"section"},eE={class:"tabs-header",style:{"margin-bottom":"8px"}},tE={key:0},iE={class:"setting-item column"},nE={class:"setting-item column"},sE={class:"setting-item"},oE={key:1},rE={class:"setting-item column"},aE={class:"setting-item column",style:{"margin-top":"12px","border-top":"1px solid rgba(255,255,255,0.1)","padding-top":"8px"}},lE={class:"search-box"},cE={key:2,class:"section"},dE={class:"setting-item"},hE={key:0,class:"setting-item column"},uE={class:"sub-label"},fE={class:"setting-item"},pE={class:"setting-item"},gE={class:"setting-item column"},mE={class:"setting-item column"},AE={class:"sub-label"},yE={class:"setting-item column"},CE={class:"sub-label"},EE={class:"setting-item column"},wE={class:"sub-label"},bE={class:"setting-item column"},vE={style:{display:"flex",gap:"8px","margin-bottom":"8px"}},IE=["onClick","title"],BE={style:{display:"flex",gap:"8px","align-items":"center"}},xE={key:3,class:"section"},SE={class:"setting-item"},TE={class:"setting-item column"},vi=Oe(c.defineComponent({__name:"LeitingSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean,default:!1},tiandituToken:{type:String,default:""},initialConfig:{type:Object,default:()=>({})}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){ze.locale("zh-cn"),ze.extend(FC),ze.extend(NC),ze.extend(GC),ze.extend(zC);const t=ge.Switch,n=ge.Radio.Group,s=ge.Radio,o=ge.Input,r=ge.Slider,l=ge.Select,a=ge.Select.Option,d=ge.DatePicker,h=i,f=e,p=c.inject("leitingMethods"),u=c.computed({get:()=>h.open!==void 0?h.open:h.visible,set:E=>{f("update:visible",E),f("update:open",E)}}),m=c.ref("GIS"),w=c.reactive({globe:!1,terrain:!1,depthTest:!1}),A=c.reactive({provider:"tianditu",tianditu:{token:"c25f14fb6bd4397cf8fe45144ff768d6",layerType:"img_w",showLabel:!1},arcgis:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},baseMap:"tianditu"}),C=c.reactive({shadows:!1,shadowDarkness:.7,environmentMap:!1,ambientOcclusion:!1,time:ze("2025-06-22 10:00"),brightness:1.5,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),v=c.reactive({collision:!1,habit:0}),S=E=>{E&&(E.globe!==void 0&&(w.globe=E.globe),E.terrain!==void 0&&(w.terrain=E.terrain),E.depthTest!==void 0&&(w.depthTest=E.depthTest),E.mapProvider!==void 0&&(A.provider=E.mapProvider),E.tiandituLayerType!==void 0&&(A.tianditu.layerType=E.tiandituLayerType),E.tiandituShowLabel!==void 0&&(A.tianditu.showLabel=E.tiandituShowLabel),E.arcgisUrl!==void 0&&(A.arcgis.url=E.arcgisUrl),E.shadows!==void 0&&(C.shadows=E.shadows),E.shadowDarkness!==void 0&&(C.shadowDarkness=E.shadowDarkness),E.environmentMap!==void 0&&(C.environmentMap=E.environmentMap),E.ambientOcclusion!==void 0&&(C.ambientOcclusion=E.ambientOcclusion),E.time!==void 0&&(typeof E.time=="number"?C.time=ze().startOf("day").add(E.time,"hour"):C.time=ze(E.time)),E.brightness!==void 0&&(C.brightness=E.brightness),E.contrast!==void 0&&(C.contrast=E.contrast),E.saturation!==void 0&&(C.saturation=E.saturation),E.backgroundColor!==void 0&&(C.backgroundColor=E.backgroundColor),E.collision!==void 0&&(v.collision=E.collision),E.mouseHabit!==void 0&&(v.habit=E.mouseHabit))};c.watch(()=>h.initialConfig,E=>{S(E)},{deep:!0,immediate:!0});const D=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],N=[{label:"全球影像地图服务(墨卡托)",value:"img_w"},{label:"全球影像地图服务(经纬度)",value:"img_c"},{label:"全球矢量地图服务(墨卡托)",value:"vec_w"},{label:"全球矢量地图服务(经纬度)",value:"vec_c"},{label:"全球地形晕渲服务(墨卡托)",value:"ter_w"},{label:"全球地形晕渲服务(经纬度)",value:"ter_c"}],I=()=>{const E=A.provider,y={};E==="tianditu"?(y.token=A.tianditu.token,y.layerType=A.tianditu.layerType,y.showAnnotation=A.tianditu.showLabel):E==="arcgis"&&(y.url=A.arcgis.url),p.value?.changeBaseMap?.(E,y)};c.watch(()=>A.provider,I),c.watch(()=>A.tianditu.layerType,I),c.watch(()=>A.tianditu.showLabel,I),c.watch(()=>A.tianditu.token,kn(I,1e3)),c.watch(()=>A.arcgis.url,kn(I,1e3)),c.onMounted(()=>{h.tiandituToken&&(A.tianditu.token=h.tiandituToken)}),c.watch(()=>w.globe,E=>p.value?.setGlobeEnvironmentVisible?.(E)),c.watch(()=>w.terrain,E=>p.value?.setTerrainEnable?.(E)),c.watch(()=>w.depthTest,E=>p.value?.setDepthTestEnable?.(E)),c.watch(()=>p?.value,E=>{if(E){if(E.getConfigure=()=>({globe:w.globe,terrain:w.terrain,depthTest:w.depthTest,mapProvider:A.provider,tiandituLayerType:A.tianditu.layerType,tiandituShowLabel:A.tianditu.showLabel,arcgisUrl:A.arcgis.url,shadows:C.shadows,shadowDarkness:C.shadowDarkness,environmentMap:C.environmentMap,ambientOcclusion:C.ambientOcclusion,time:ze.isDayjs(C.time)?C.time.format("YYYY-MM-DD HH:mm"):C.time,brightness:C.brightness,contrast:C.contrast,saturation:C.saturation,backgroundColor:C.backgroundColor,collision:v.collision,mouseHabit:v.habit}),E.setConfigure=y=>{S(y)},E.setBackgroundColor&&C.backgroundColor&&E.setBackgroundColor(C.backgroundColor),E.setGlobeEnvironmentVisible&&E.setGlobeEnvironmentVisible(w.globe),E.setShadowsEnable&&E.setShadowsEnable(C.shadows),E.setShadowDarkness&&E.setShadowDarkness(C.shadowDarkness),E.setEnvironmentMapEnable&&E.setEnvironmentMapEnable(C.environmentMap),E.setAmbientOcclusion&&E.setAmbientOcclusion(C.ambientOcclusion),E.setTime){const y=ze.isDayjs(C.time)?C.time.toDate():new Date;E.setTime(y)}E.setModelBrightness&&E.setModelBrightness(C.brightness),E.setCollisionDetection&&E.setCollisionDetection(v.collision),E.setMouseHabit&&E.setMouseHabit(v.habit),E.changeBaseMap&&A.baseMap&&E.changeBaseMap(A.baseMap,{token:A.tianditu.token,layerType:A.tianditu.layerType,showAnnotation:A.tianditu.showLabel,url:A.arcgis.url})}},{immediate:!0});const B=c.computed({get:()=>{const E=C.backgroundColor;return/^#[0-9A-Fa-f]{6}$/.test(E)?E:"#ffffff"},set:E=>{C.backgroundColor=E}}),g=c.ref(""),P=c.ref(!1),x=c.ref([]);c.watch(()=>w.globe,E=>p.value?.setGlobeEnvironmentVisible?.(E)),c.watch(()=>w.terrain,E=>p.value?.setTerrainEnable?.(E)),c.watch(()=>A.baseMap,E=>{p.value?.changeBaseMap?.(E,{token:h.tiandituToken})}),c.watch(()=>C.shadows,E=>p.value?.setShadowsEnable?.(E)),c.watch(()=>C.shadowDarkness,E=>p.value?.setShadowDarkness?.(E)),c.watch(()=>C.environmentMap,E=>p.value?.setEnvironmentMapEnable?.(E)),c.watch(()=>C.ambientOcclusion,E=>p.value?.setAmbientOcclusion?.(E)),c.watch(()=>C.time,E=>{const y=ze.isDayjs(E)?E.toDate():new Date;p.value?.setTime?.(y)}),c.watch(()=>[C.brightness,C.contrast,C.saturation],([E,y,b])=>{const T=p.value;T?.setModelColorAdjustment?T.setModelColorAdjustment({brightness:E,contrast:y,saturation:b}):T?.setModelBrightness?.(E)}),c.watch(()=>C.backgroundColor,E=>{if(p.value?.setBackgroundColor)p.value.setBackgroundColor(E);else{const y=document.querySelector(".cesium-viewer");y&&(y.style.background=E)}}),c.watch(()=>v.collision,E=>p.value?.setCollisionDetection?.(E)),c.watch(()=>v.habit,E=>p.value?.setMouseHabit?.(E));const k=E=>{if(E?.pois&&Array.isArray(E.pois)&&E.pois.length>0){const y=E.pois[0],b=y.lonlat.split(/[, ]/).map(Number);if(b.length>=2&&!isNaN(b[0])&&!isNaN(b[1]))return{name:y.name,lon:b[0],lat:b[1],raw:y}}if(E?.area&&E.area.lonlat){const y=E.area,b=y.lonlat.split(/[, ]/).map(Number);if(b.length>=2&&!isNaN(b[0])&&!isNaN(b[1]))return{name:y.name,lon:b[0],lat:b[1],raw:y}}return null},G=kn(async()=>{const E=(g.value||"").trim();if(!E)return;const y=h.tiandituToken||"c25f14fb6bd4397cf8fe45144ff768d6";P.value=!0,x.value=[];try{if(p.value?.searchLocation){const b=await p.value.searchLocation(E,y),T=k(b);T&&(x.value=[T],fe.success(`找到:${T.name||""}`),p.value.flyToLonLatHeight(T.lon,T.lat,5e3))}else{const T=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(JSON.stringify({keyWord:E,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}))}&type=query&tk=${encodeURIComponent(y)}`,R=await fetch(T);if(!R.ok)throw new Error(`HTTP ${R.status}`);const O=await R.json(),L=k(O);L&&(x.value=[L],fe.success(`找到:${L.name||""}`),p.value?.flyToLonLatHeight?.(L.lon,L.lat,5e3))}}catch(b){console.error("tianditu search error",b)}finally{P.value=!1}},800);c.watch(g,()=>{G()});const F=()=>{u.value=!1,f("close")};return c.onMounted(()=>{}),(E,y)=>(c.openBlock(),c.createBlock(Pe,{visible:u.value,title:"设置","full-height":i.fullHeight,onClose:F,"onUpdate:visible":y[26]||(y[26]=b=>u.value=b)},{default:c.withCtx(()=>[c.createElementVNode("div",WC,[c.createElementVNode("div",jC,[c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="GIS"}]),onClick:y[0]||(y[0]=b=>m.value="GIS")},"GIS",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="MAP"}]),onClick:y[1]||(y[1]=b=>m.value="MAP")},"地图",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="RENDER"}]),onClick:y[2]||(y[2]=b=>m.value="RENDER")},"渲染",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="MOUSE"}]),onClick:y[3]||(y[3]=b=>m.value="MOUSE")},"鼠标",2)]),c.createElementVNode("div",KC,[m.value==="GIS"?(c.openBlock(),c.createElementBlock("div",$C,[c.createElementVNode("div",XC,[y[27]||(y[27]=c.createElementVNode("span",null,"地球 (含大气/日月/星空)",-1)),c.createVNode(c.unref(t),{checked:w.globe,"onUpdate:checked":y[4]||(y[4]=b=>w.globe=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",qC,[y[28]||(y[28]=c.createElementVNode("span",null,"地形 (高程)",-1)),c.createVNode(c.unref(t),{checked:w.terrain,"onUpdate:checked":y[5]||(y[5]=b=>w.terrain=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",JC,[y[29]||(y[29]=c.createElementVNode("span",null,"地形遮挡",-1)),c.createVNode(c.unref(t),{checked:w.depthTest,"onUpdate:checked":y[6]||(y[6]=b=>w.depthTest=b),size:"small"},null,8,["checked"])])])):c.createCommentVNode("",!0),m.value==="MAP"?(c.openBlock(),c.createElementBlock("div",ZC,[c.createElementVNode("div",eE,[c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:A.provider==="tianditu"}]),onClick:y[7]||(y[7]=b=>A.provider="tianditu")},"天地图",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:A.provider==="arcgis"}]),onClick:y[8]||(y[8]=b=>A.provider="arcgis")},"ArcGIS",2)]),A.provider==="tianditu"?(c.openBlock(),c.createElementBlock("div",tE,[c.createElementVNode("div",iE,[y[30]||(y[30]=c.createElementVNode("div",{class:"sub-label"},"Token",-1)),c.createVNode(c.unref(o),{value:A.tianditu.token,"onUpdate:value":y[9]||(y[9]=b=>A.tianditu.token=b),size:"small",placeholder:"输入天地图Token"},null,8,["value"])]),c.createElementVNode("div",nE,[y[31]||(y[31]=c.createElementVNode("div",{class:"sub-label"},"地图风格",-1)),c.createVNode(c.unref(l),{value:A.tianditu.layerType,"onUpdate:value":y[10]||(y[10]=b=>A.tianditu.layerType=b),size:"small",style:{width:"100%"}},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(N,b=>c.createVNode(c.unref(a),{key:b.value,value:b.value},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(b.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),c.createElementVNode("div",sE,[y[32]||(y[32]=c.createElementVNode("span",null,"叠加注记",-1)),c.createVNode(c.unref(t),{checked:A.tianditu.showLabel,"onUpdate:checked":y[11]||(y[11]=b=>A.tianditu.showLabel=b),size:"small"},null,8,["checked"])])])):c.createCommentVNode("",!0),A.provider==="arcgis"?(c.openBlock(),c.createElementBlock("div",oE,[c.createElementVNode("div",rE,[y[33]||(y[33]=c.createElementVNode("div",{class:"sub-label"},"服务地址",-1)),c.createVNode(c.unref(o),{value:A.arcgis.url,"onUpdate:value":y[12]||(y[12]=b=>A.arcgis.url=b),size:"small",placeholder:"输入ArcGIS MapServer地址"},null,8,["value"])])])):c.createCommentVNode("",!0),c.createElementVNode("div",aE,[y[34]||(y[34]=c.createElementVNode("div",{class:"sub-label"},"位置搜索 (天地图)",-1)),c.createElementVNode("div",lE,[c.createVNode(c.unref(o),{value:g.value,"onUpdate:value":y[13]||(y[13]=b=>g.value=b),placeholder:"输入地名搜索",size:"small","allow-clear":""},null,8,["value"])])])])):c.createCommentVNode("",!0),m.value==="RENDER"?(c.openBlock(),c.createElementBlock("div",cE,[c.createElementVNode("div",dE,[y[35]||(y[35]=c.createElementVNode("span",null,"阴影",-1)),c.createVNode(c.unref(t),{checked:C.shadows,"onUpdate:checked":y[14]||(y[14]=b=>C.shadows=b),size:"small"},null,8,["checked"])]),C.shadows?(c.openBlock(),c.createElementBlock("div",hE,[c.createElementVNode("div",uE,"阴影暗度 ("+c.toDisplayString(C.shadowDarkness.toFixed(2))+")",1),c.createVNode(c.unref(r),{value:C.shadowDarkness,"onUpdate:value":y[15]||(y[15]=b=>C.shadowDarkness=b),min:0,max:1,step:.05,size:"small"},null,8,["value"])])):c.createCommentVNode("",!0),c.createElementVNode("div",fE,[y[36]||(y[36]=c.createElementVNode("span",null,"环境贴图 (HDR)",-1)),c.createVNode(c.unref(t),{checked:C.environmentMap,"onUpdate:checked":y[16]||(y[16]=b=>C.environmentMap=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",pE,[y[37]||(y[37]=c.createElementVNode("span",null,"环境光遮蔽 (AO)",-1)),c.createVNode(c.unref(t),{checked:C.ambientOcclusion,"onUpdate:checked":y[17]||(y[17]=b=>C.ambientOcclusion=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",gE,[y[38]||(y[38]=c.createElementVNode("div",{class:"sub-label"},"日期时间",-1)),c.createVNode(c.unref(d),{value:C.time,"onUpdate:value":y[18]||(y[18]=b=>C.time=b),"show-time":"",locale:c.unref(cl),format:"YYYY-MM-DD HH:mm",size:"small",style:{width:"100%"}},null,8,["value","locale"])]),c.createElementVNode("div",mE,[c.createElementVNode("div",AE,"模型亮度 ("+c.toDisplayString(C.brightness.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.brightness,"onUpdate:value":y[19]||(y[19]=b=>C.brightness=b),min:0,max:5,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",yE,[c.createElementVNode("div",CE,"模型对比度 ("+c.toDisplayString(C.contrast.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.contrast,"onUpdate:value":y[20]||(y[20]=b=>C.contrast=b),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",EE,[c.createElementVNode("div",wE,"模型饱和度 ("+c.toDisplayString(C.saturation.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.saturation,"onUpdate:value":y[21]||(y[21]=b=>C.saturation=b),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",bE,[y[39]||(y[39]=c.createElementVNode("div",{class:"sub-label"},"背景颜色",-1)),c.createElementVNode("div",vE,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(D,(b,T)=>c.createElementVNode("div",{key:T,style:c.normalizeStyle({background:b,width:"32px",height:"24px",borderRadius:"2px",cursor:"pointer",border:"1px solid #d9d9d9",flexShrink:0}),onClick:R=>C.backgroundColor=b,title:"预设 "+(T+1)},null,12,IE)),64))]),c.createElementVNode("div",BE,[c.withDirectives(c.createElementVNode("input",{type:"color","onUpdate:modelValue":y[22]||(y[22]=b=>B.value=b),style:{width:"40px",height:"24px",padding:"0",border:"1px solid #d9d9d9"}},null,512),[[c.vModelText,B.value]]),c.createVNode(c.unref(o),{value:C.backgroundColor,"onUpdate:value":y[23]||(y[23]=b=>C.backgroundColor=b),size:"small",style:{flex:"1"},placeholder:"CSS 颜色值"},null,8,["value"])])])])):c.createCommentVNode("",!0),m.value==="MOUSE"?(c.openBlock(),c.createElementBlock("div",xE,[c.createElementVNode("div",SE,[y[40]||(y[40]=c.createElementVNode("span",null,"碰撞检测",-1)),c.createVNode(c.unref(t),{checked:v.collision,"onUpdate:checked":y[24]||(y[24]=b=>v.collision=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",TE,[y[43]||(y[43]=c.createElementVNode("div",{class:"sub-label"},"操作习惯",-1)),c.createVNode(c.unref(n),{value:v.habit,"onUpdate:value":y[25]||(y[25]=b=>v.habit=b),size:"small"},{default:c.withCtx(()=>[c.createVNode(c.unref(s),{value:0},{default:c.withCtx(()=>[...y[41]||(y[41]=[c.createTextVNode("默认 (中键旋转)",-1)])]),_:1}),c.createVNode(c.unref(s),{value:1},{default:c.withCtx(()=>[...y[42]||(y[42]=[c.createTextVNode("习惯1 (左键旋转)",-1)])]),_:1})]),_:1},8,["value"])])])):c.createCommentVNode("",!0)])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-79494025"]]),ME={class:"cad-layer-panel"},DE={class:"layer-list-container"},kE={class:"list-header"},PE={class:"col-check"},FE=["checked"],RE={class:"list-body"},OE={class:"col-check"},LE=["checked","onChange"],NE={class:"col-index"},_E=["title"],UE={class:"col-color"},QE=["value"],GE={key:0,class:"empty-text"},HE=Oe(c.defineComponent({__name:"LeitingCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods",c.ref({})),o=c.ref(""),r=c.ref([]),l=()=>{s.value&&s.value.getDxfModels&&(r.value=s.value.getDxfModels().map(v=>({modelId:v.modelId,modelName:v.modelName}))||[])},a=c.computed(()=>r.value.map(v=>({value:v.modelId,label:v.modelName}))),d=c.ref([]),h=c.ref([]),f=c.computed(()=>d.value.length>0&&h.value.length===d.value.length),p=({modelId:v})=>{if(d.value=[],h.value=[],s.value&&s.value.getDxfLayers){const S=s.value.getDxfLayers({modelId:v});S&&Object.keys(S).forEach((D,N)=>{S[D].length&&(d.value.push({index:N+1,layerName:D,layerColor:S[D][0].color||"#ffffff",key:D}),h.value.push(D))})}},u=v=>{o.value=v,p({modelId:v})},m=v=>{v.target.checked?h.value=d.value.map(D=>D.key):h.value=[],A()},w=(v,S)=>{S.target.checked?h.value.includes(v)||h.value.push(v):h.value=h.value.filter(N=>N!==v),A()},A=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:o.value,show:!0,layers:h.value}),s.value.getDxfLayers)){const v=s.value.getDxfLayers({modelId:o.value});if(v){const S=Object.keys(v).filter(D=>!h.value.includes(D));s.value.showDxfLayer({modelId:o.value,show:!1,layers:S})}}},C=()=>{n("update:visible",!1),n("handleCloseCardByCadCard")};return c.watch(()=>t.visible,v=>{v&&(l(),t.currentModelId?(o.value=t.currentModelId,p({modelId:t.currentModelId})):a.value.length>0&&(o.value=a.value[0]?.value,p({modelId:o.value})))}),c.watch(()=>t.currentModelId,v=>{v&&t.visible&&(o.value=v,p({modelId:v}))}),(v,S)=>(c.openBlock(),c.createBlock(Pe,{visible:i.visible,title:"CAD图层","onUpdate:visible":S[3]||(S[3]=D=>v.$emit("update:visible",D)),onClose:C,width:360,align:"right","initial-position":{x:0,y:60}},{"header-extra":c.withCtx(()=>[c.createElementVNode("div",{class:"header-select-container",onMousedown:S[2]||(S[2]=c.withModifiers(()=>{},["stop"]))},[S[4]||(S[4]=c.createElementVNode("span",{class:"header-label"},"图纸:",-1)),c.createVNode(c.unref(ge.Select),{value:o.value,"onUpdate:value":S[0]||(S[0]=D=>o.value=D),options:a.value,onChange:S[1]||(S[1]=D=>u(D)),placeholder:"选择模型",style:{width:"140px"},bordered:!1,class:"custom-header-select",popupClassName:"leiting-select-dropdown",size:"small"},null,8,["value","options"])],32)]),default:c.withCtx(()=>[c.createElementVNode("div",ME,[c.createElementVNode("div",DE,[c.createElementVNode("div",kE,[c.createElementVNode("div",PE,[c.createElementVNode("input",{type:"checkbox",checked:f.value,onChange:m},null,40,FE)]),S[5]||(S[5]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),S[6]||(S[6]=c.createElementVNode("div",{class:"col-name"},"图层名称",-1)),S[7]||(S[7]=c.createElementVNode("div",{class:"col-color"},"颜色",-1))]),c.createElementVNode("div",RE,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(d.value,D=>(c.openBlock(),c.createElementBlock("div",{key:D.key,class:"list-item"},[c.createElementVNode("div",OE,[c.createElementVNode("input",{type:"checkbox",checked:h.value.includes(D.key),onChange:N=>w(D.key,N)},null,40,LE)]),c.createElementVNode("div",NE,c.toDisplayString(D.index),1),c.createElementVNode("div",{class:"col-name",title:D.layerName},c.toDisplayString(D.layerName),9,_E),c.createElementVNode("div",UE,[c.createElementVNode("input",{type:"color",value:D.layerColor,disabled:""},null,8,QE)])]))),128)),d.value.length===0?(c.openBlock(),c.createElementBlock("div",GE,"暂无数据")):c.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-a4db4977"]]),YE={class:"adjust-panel"},VE={class:"control-panel"},zE={class:"form-item"},WE={class:"radio-group"},jE={class:"form-item"},KE=["title"],$E={class:"param-row"},XE=["step"],qE={class:"param-row"},JE=["step"],ZE={class:"param-row"},ew=["step"],tw={class:"param-row"},iw=["step"],nw={class:"param-row"},sw=["step"],ow={class:"param-row"},rw=["step"],aw={class:"param-row"},lw=["step"],cw={class:"button-grid"},dw={key:1,class:"pick-mode-ui"},hw=["onClick"],uw=["checked"],fw={style:{"font-size":"12px",color:"#aaa","padding-left":"10px"}},pw={class:"param-row"},gw={style:{width:"40px"}},mw=["onUpdate:modelValue"],Aw={class:"param-row"},yw={style:{width:"40px"}},Cw=["onUpdate:modelValue"],Ew={class:"param-row"},ww={style:{width:"40px"}},bw=["onUpdate:modelValue"],vw={class:"list-panel"},Iw={class:"list-header"},Bw={class:"col-check"},xw=["checked"],Sw={class:"list-body"},Tw={class:"col-check"},Mw=["onUpdate:modelValue"],Dw={class:"col-index"},kw=["title"],Pw={class:"col-main"},Fw=["checked","onChange"],Rw={key:0,style:{padding:"10px","text-align":"center",color:"#999"}},Ow=Oe(c.defineComponent({__name:"LeitingCadPosition",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","handleSavingByCadCard","clearBimPointList","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=c.inject("leitingMethods"),r=c.ref([]),l=c.ref(""),a=c.computed(()=>r.value.length>0&&r.value.every(y=>y.selected)),d=c.ref("param"),h=c.ref("bimPoint1"),f=c.ref(null),p=c.ref("bimPoint1"),u=c.reactive({bimPoint1:{longitude:void 0,latitude:void 0,type:"CAD标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0},bimPoint2:{longitude:void 0,latitude:void 0,type:"地图标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0}}),m=c.ref(1e-6),w=c.reactive({modelId:"",longitude:0,latitude:0,distance:1e-6,rotation:1,totalRotation:0,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0}),A=c.computed(()=>{const y=r.value.find(b=>b.modelId===l.value);return y?y.modelName:""}),C=()=>{s("update:visible",!1)},v=()=>(!f.value&&o?.value?.getViewer&&o?.value?.getCesium&&(f.value=new ll(o.value.getViewer(),o.value.getCesium())),f.value),S=()=>{v()?.clearMarkers(),u.bimPoint1.longitude=void 0,u.bimPoint1.latitude=void 0,u.bimPoint1.height=void 0,u.bimPoint2.longitude=void 0,u.bimPoint2.latitude=void 0,u.bimPoint2.height=void 0},D=y=>{const b=h.value,T=u[b];if(T){T.longitude=y.longitude,T.latitude=y.latitude,T.height=y.height;const R=b==="bimPoint1"?"BIM":"MAP";v()?.addMarker(R,y),fe.success(`${T.type}已添加`)}},N=()=>{v()?.registerPickHandler(y=>{D(y)})},I=()=>{v()?.destroyPickHandler()},B=y=>{d.value=y,y!=="pick"&&s("clearBimPointList")};c.watch(()=>d.value,y=>{y==="pick"?N():I()}),c.onUnmounted(()=>{I()});const g=()=>{if(!o?.value?.getDxfModels)return;const y=o.value.getDxfModels();if(Array.isArray(y)?r.value=y.map(b=>({modelId:b.modelId,modelName:b.modelName,formData:b.formData||{},selected:!1,tileset:b})):r.value=[],r.value.length>0){const b=o.value.getCadModelId?o.value.getCadModelId():"";b&&r.value.find(T=>T.modelId===b)?P(b):P(r.value[0].modelId),r.value.forEach(T=>T.selected=!0)}},P=y=>{l.value=y;const b=r.value.find(T=>T.modelId===y);b&&b.formData&&Object.keys(w).forEach(T=>{b.formData[T]!==void 0&&(w[T]=b.formData[T])})},x=(y,b)=>{if(!o?.value?.adjustingModelByCad)return;const T=r.value.find(R=>R.modelId===y);T&&T.tileset&&(T.formData={...T.formData,...b},T.tileset.formData=T.formData,o.value.adjustingModelByCad({...T.formData,tileset:T.tileset}))},k=y=>{if(!l.value)return;const b=w[y];x(l.value,{[y]:b})},_=y=>{const b=r.value.filter(L=>L.selected);if(b.length===0){fe.warning("请先选择要调整的模型");return}const{distance:T,heightDistance:R,rotation:O}=w;b.forEach(L=>{const M={...L.formData};switch(y){case"north":M.latitude+=T;break;case"south":M.latitude-=T;break;case"east":M.longitude+=T;break;case"west":M.longitude-=T;break;case"up":M.height+=R;break;case"down":M.height-=R;break;case"rotateLeft":M.totalRotation=(M.totalRotation||0)-O;break;case"rotateRight":M.totalRotation=(M.totalRotation||0)+O;break}L.modelId===l.value&&Object.assign(w,M),x(L.modelId,M)})},G=y=>{const b=y.target.checked;r.value.forEach(T=>T.selected=b)},F=()=>{s("handleSavingByCadCard",r.value),s("save",r.value)},E=()=>{const y=u.bimPoint1,b=u.bimPoint2;if(y.longitude===void 0||b.longitude===void 0){fe.warning("请先完成点选操作");return}const T=r.value.filter(Q=>Q.selected);if(T.length===0){fe.warning("请先选择要调整的模型");return}let R=0,O=0,L=0;const M=v();if(M){const{dLon:Q,dLat:Y,dHeight:W}=M.calculateOffset(y,b);R=Q,O=Y,L=W}else R=b.longitude-y.longitude,O=b.latitude-y.latitude,L=b.height-y.height;T.forEach(Q=>{const Y={...Q.formData};Y.longitude+=R,Y.latitude+=O,Y.height+=L,Q.modelId===l.value&&Object.assign(w,Y),x(Q.modelId,Y)}),fe.success("位置已调整")};return c.watch(()=>n.visible,y=>{y?g():(I(),S())}),c.onMounted(()=>{n.visible&&g()}),e({setBIMPointsList:({longitude:y,latitude:b,height:T})=>{u[p.value].longitude=y,u[p.value].latitude=b,u[p.value].height=T},addGltfOr3dTilesModelList:y=>{console.warn("addGltfOr3dTilesModelList is deprecated, use internal loading")}}),(y,b)=>(c.openBlock(),c.createBlock(Pe,{visible:n.visible,title:"Cad校准",width:282,height:600,"onUpdate:visible":b[21]||(b[21]=T=>s("update:visible",T)),onClose:C},{default:c.withCtx(()=>[c.createElementVNode("div",YE,[c.createElementVNode("div",VE,[c.createElementVNode("div",zE,[b[22]||(b[22]=c.createElementVNode("label",null,"调整操作:",-1)),c.createElementVNode("div",WE,[c.createElementVNode("span",{class:c.normalizeClass({active:d.value==="param"}),onClick:b[0]||(b[0]=T=>B("param"))},"参数模式",2),c.createElementVNode("span",{class:c.normalizeClass({active:d.value==="pick"}),onClick:b[1]||(b[1]=T=>B("pick"))},"地图点选",2)])]),c.createElementVNode("div",jE,[b[23]||(b[23]=c.createElementVNode("label",null,"当前主模型:",-1)),c.createElementVNode("span",{class:"value",title:A.value},c.toDisplayString(A.value||"未选择"),9,KE)]),b[35]||(b[35]=c.createElementVNode("div",{class:"separator"},null,-1)),d.value==="param"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[b[31]||(b[31]=c.createElementVNode("div",{class:"group-header"},"当前状态",-1)),c.createElementVNode("div",$E,[b[24]||(b[24]=c.createElementVNode("label",null,"经度(东西):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[2]||(b[2]=T=>w.longitude=T),onChange:b[3]||(b[3]=T=>k("longitude")),step:m.value},null,40,XE),[[c.vModelText,w.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",qE,[b[25]||(b[25]=c.createElementVNode("label",null,"纬度(南北):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[4]||(b[4]=T=>w.latitude=T),onChange:b[5]||(b[5]=T=>k("latitude")),step:m.value},null,40,JE),[[c.vModelText,w.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",ZE,[b[26]||(b[26]=c.createElementVNode("label",null,"高度(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[6]||(b[6]=T=>w.height=T),onChange:b[7]||(b[7]=T=>k("height")),step:m.value},null,40,ew),[[c.vModelText,w.height,void 0,{number:!0}]])]),c.createElementVNode("div",tw,[b[27]||(b[27]=c.createElementVNode("label",null,"累计旋转(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[8]||(b[8]=T=>w.totalRotation=T),onChange:b[9]||(b[9]=T=>k("totalRotation")),step:m.value},null,40,iw),[[c.vModelText,w.totalRotation,void 0,{number:!0}]])]),b[32]||(b[32]=c.createElementVNode("div",{class:"separator"},null,-1)),b[33]||(b[33]=c.createElementVNode("div",{class:"group-header"},"调整步长",-1)),c.createElementVNode("div",nw,[b[28]||(b[28]=c.createElementVNode("label",null,"经纬步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[10]||(b[10]=T=>w.distance=T),step:m.value},null,8,sw),[[c.vModelText,w.distance,void 0,{number:!0}]])]),c.createElementVNode("div",ow,[b[29]||(b[29]=c.createElementVNode("label",null,"高度步长(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[11]||(b[11]=T=>w.heightDistance=T),step:m.value},null,8,rw),[[c.vModelText,w.heightDistance,void 0,{number:!0}]])]),c.createElementVNode("div",aw,[b[30]||(b[30]=c.createElementVNode("label",null,"旋转步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[12]||(b[12]=T=>w.rotation=T),step:m.value},null,8,lw),[[c.vModelText,w.rotation,void 0,{number:!0}]])]),c.createElementVNode("div",cw,[c.createElementVNode("button",{onClick:b[13]||(b[13]=T=>_("rotateLeft"))},"左转"),c.createElementVNode("button",{onClick:b[14]||(b[14]=T=>_("north"))},"北移"),c.createElementVNode("button",{onClick:b[15]||(b[15]=T=>_("rotateRight"))},"右转"),c.createElementVNode("button",{onClick:b[16]||(b[16]=T=>_("west"))},"西移"),c.createElementVNode("button",{onClick:b[17]||(b[17]=T=>_("south"))},"南移"),c.createElementVNode("button",{onClick:b[18]||(b[18]=T=>_("east"))},"东移"),c.createElementVNode("button",{onClick:b[19]||(b[19]=T=>_("up"))},"上移"),c.createElementVNode("button",{onClick:b[20]||(b[20]=T=>_("down"))},"下移"),c.createElementVNode("button",{onClick:F,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):(c.openBlock(),c.createElementBlock("div",dw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(u,(T,R)=>(c.openBlock(),c.createElementBlock("div",{key:R,class:"form-item",style:{display:"block","margin-bottom":"15px"}},[c.createElementVNode("div",{style:{"font-weight":"bold","margin-bottom":"5px",cursor:"pointer",display:"flex","align-items":"center"},onClick:O=>h.value=R},[c.createElementVNode("input",{type:"radio",checked:h.value===R,style:{"margin-right":"5px"}},null,8,uw),c.createTextVNode(" "+c.toDisplayString(T.type)+": ",1)],8,hw),c.createElementVNode("div",fw,[c.createElementVNode("div",pw,[c.createElementVNode("label",gw,c.toDisplayString(T.longitudeText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.longitude=O,readonly:"",style:{width:"100px"}},null,8,mw),[[c.vModelText,T.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",Aw,[c.createElementVNode("label",yw,c.toDisplayString(T.latitudeText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.latitude=O,readonly:"",style:{width:"100px"}},null,8,Cw),[[c.vModelText,T.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",Ew,[c.createElementVNode("label",ww,c.toDisplayString(T.heightText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.height=O,readonly:"",style:{width:"100px"}},null,8,bw),[[c.vModelText,T.height,void 0,{number:!0}]])])])]))),128)),c.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[c.createElementVNode("button",{onClick:E,class:"primary-btn"},"应用校准"),c.createElementVNode("button",{onClick:F},"保存")]),b[34]||(b[34]=c.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[c.createElementVNode("div",null,"操作指南:"),c.createElementVNode("div",null,"1. 勾选上方 CAD 或 地图 标记点选项。"),c.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),c.createElementVNode("div",null,"3. 采集两点后,点击“应用校准”进行校准。")],-1))]))]),c.createElementVNode("div",vw,[c.createElementVNode("div",Iw,[c.createElementVNode("div",Bw,[c.createElementVNode("input",{type:"checkbox",checked:a.value,onChange:G},null,40,xw)]),b[36]||(b[36]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),b[37]||(b[37]=c.createElementVNode("div",{class:"col-name"},"名称",-1)),b[38]||(b[38]=c.createElementVNode("div",{class:"col-main"},"主模型",-1))]),c.createElementVNode("div",Sw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(r.value,(T,R)=>(c.openBlock(),c.createElementBlock("div",{key:T.modelId,class:c.normalizeClass(["list-item",{active:T.modelId===l.value}])},[c.createElementVNode("div",Tw,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":O=>T.selected=O},null,8,Mw),[[c.vModelCheckbox,T.selected]])]),c.createElementVNode("div",Dw,c.toDisplayString(R+1),1),c.createElementVNode("div",{class:"col-name",title:T.modelName},c.toDisplayString(T.modelName),9,kw),c.createElementVNode("div",Pw,[c.createElementVNode("input",{type:"radio",name:"mainModel",checked:T.modelId===l.value,onChange:O=>P(T.modelId)},null,40,Fw)])],2))),128)),r.value.length===0?(c.openBlock(),c.createElementBlock("div",Rw,"暂无数据")):c.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-e8abd49d"]]),Lw={class:"annotation-content"},Nw={class:"annotation-tools"},_w={class:"annotation-controls"},Uw={class:"control-group",title:"颜色"},Qw={class:"tool-item color-tool"},Gw={class:"control-group line-width-container",title:"线宽"},Hw=["onClick"],Yw={class:"option-label"},Vw=Oe(c.defineComponent({__name:"LeitingAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref(""),r=c.ref("#ff0000"),l=c.ref(1),a=c.ref(!1),d=c.ref(null),h=c.ref(null),f=c.ref({top:"0px",left:"0px"}),p=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],u=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,m=()=>{n("update:visible",!1)},w=B=>{o.value=B;const g=u();if(g)switch(B){case"freehandLine":g.startFreehandLine();break;case"arrow":g.startArrow();break;case"straightLine":g.startStraightLine();break;case"rectangle":g.startRectangle();break;case"ellipse":g.startEllipse();break}},A=()=>{const B=u();B&&(B.setCurrentColor(r.value),B.changeColor(r.value))},C=()=>{if(!a.value&&d.value){const B=d.value.getBoundingClientRect();f.value={top:`${B.top}px`,left:`${B.right+8}px`}}a.value=!a.value},v=B=>{l.value=B,a.value=!1;const g=u();g&&(g.setCurrentWidth(B),g.changeWidth(B))},S=()=>{const B=u();B&&B.deleteSelectedEntity()},D=()=>{const B=u();B&&B.clearAll()},N=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const B=u();B&&B.saveAnnotations()},I=B=>{const g=B.target,P=d.value&&d.value.contains(g),x=h.value&&h.value.contains(g);!P&&!x&&(a.value=!1)};return c.onMounted(()=>{document.addEventListener("click",I)}),c.onUnmounted(()=>{document.removeEventListener("click",I)}),(B,g)=>(c.openBlock(),c.createBlock(Pe,{visible:t.visible,title:"标注",width:70,"min-width":70,height:480,"onUpdate:visible":g[6]||(g[6]=P=>n("update:visible",P)),onClose:m},{default:c.withCtx(()=>[c.createElementVNode("div",Lw,[c.createElementVNode("div",Nw,[c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="freehandLine"}]),onClick:g[0]||(g[0]=P=>w("freehandLine")),title:"手绘线"},[...g[7]||(g[7]=[c.createElementVNode("div",{class:"tool-icon"},"✏️",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="arrow"}]),onClick:g[1]||(g[1]=P=>w("arrow")),title:"箭头"},[...g[8]||(g[8]=[c.createElementVNode("div",{class:"tool-icon"},"↗️",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="straightLine"}]),onClick:g[2]||(g[2]=P=>w("straightLine")),title:"直线"},[...g[9]||(g[9]=[c.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="rectangle"}]),onClick:g[3]||(g[3]=P=>w("rectangle")),title:"矩形"},[...g[10]||(g[10]=[c.createElementVNode("div",{class:"tool-icon"},"▭",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="ellipse"}]),onClick:g[4]||(g[4]=P=>w("ellipse")),title:"椭圆"},[...g[11]||(g[11]=[c.createElementVNode("div",{class:"tool-icon"},"⭕",-1)])],2)]),g[13]||(g[13]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",_w,[c.createElementVNode("div",Uw,[c.createElementVNode("div",Qw,[c.createElementVNode("div",{class:"color-swatch",style:c.normalizeStyle({backgroundColor:r.value})},null,4),c.withDirectives(c.createElementVNode("input",{type:"color","onUpdate:modelValue":g[5]||(g[5]=P=>r.value=P),onChange:A,class:"color-input-overlay"},null,544),[[c.vModelText,r.value]])])]),c.createElementVNode("div",Gw,[c.createElementVNode("div",{ref_key:"lineWidthBtnRef",ref:d,class:"tool-item",onClick:c.withModifiers(C,["stop"])},[c.createElementVNode("div",{class:"current-width-preview",style:c.normalizeStyle({height:l.value+"px",backgroundColor:"#fff"})},null,4)],512),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[a.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,class:"line-width-dropdown",style:c.normalizeStyle(f.value)},[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(p,P=>c.createElementVNode("div",{key:P.value,class:c.normalizeClass(["line-width-option",{selected:l.value===P.value}]),onClick:c.withModifiers(x=>v(P.value),["stop"])},[c.createElementVNode("span",Yw,c.toDisplayString(P.label),1),c.createElementVNode("div",{class:"line-preview",style:c.normalizeStyle({height:P.value+"px",backgroundColor:l.value===P.value?"#1890ff":"#ddd"})},null,4)],10,Hw)),64))],4)):c.createCommentVNode("",!0)]))]),g[12]||(g[12]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",{class:"action-buttons"},[c.createElementVNode("button",{class:"control-btn",onClick:S,title:"删除选中"}," 🗑️ "),c.createElementVNode("button",{class:"control-btn",onClick:D,title:"清空"}," ❌ "),c.createElementVNode("button",{class:"control-btn",onClick:N,title:"保存"}," 💾 ")])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-3cfc8415"]]),zw={class:"measure-content"},Ww={class:"measure-tools"},jw={key:0,class:"measure-results"},Kw={class:"result-row"},$w={class:"result-value"},Xw={class:"result-row"},qw={class:"result-value"},Jw={class:"result-row"},Zw={class:"result-value"},eb={class:"result-row"},tb={class:"result-value"},ib={key:1,class:"result-row"},nb={class:"result-value"},sb={key:2,class:"result-row"},ob={class:"result-value"},rb={class:"measure-controls"},ab={class:"control-group",title:"单位"},lb={class:"unit-display"},cb=["onClick"],db=Oe(c.defineComponent({__name:"LeitingMeasurement",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods",c.ref({})),o=c.ref(null),r=c.ref(null),l=c.ref("m"),a=c.ref(!1),d=c.ref(null),h=c.ref(!1),f=c.ref({}),p=c.ref(null),u=[{label:"米 (m)",value:"m"},{label:"厘米 (cm)",value:"cm"},{label:"毫米 (mm)",value:"mm"}],m=B=>{const g=l.value;return g==="mm"?`${(B*1e3).toFixed(0)}mm`:g==="cm"?`${(B*100).toFixed(1)}cm`:`${B.toFixed(2)}m`},w=B=>B>1e6?`${(B/1e6).toFixed(2)} km²`:`${B.toFixed(2)} m²`,A=()=>{if(!o.value&&s.value?.getViewer){const B=s.value.getViewer(),g=s.value.getCesium();B&&g&&(o.value=new il({viewer:B,cesium:g}),o.value.setUnit(l.value),o.value.setSnapping(a.value),o.value.onMeasure=P=>{d.value=P})}},C=B=>{o.value||A(),r.value===B?(r.value=null,o.value?.stop()):(r.value=B,o.value?.start(B))},v=B=>{l.value=B,h.value=!1},S=()=>{o.value&&(o.value.clearAll(),r.value=null,o.value.stop())},D=()=>{n("update:visible",!1)},N=B=>{if(h.value){h.value=!1;return}const P=B.currentTarget.getBoundingClientRect();f.value={position:"fixed",top:`${P.top}px`,left:`${P.right+5}px`,zIndex:3e3},h.value=!0},I=B=>{h.value&&p.value&&!p.value.contains(B.target)&&(h.value=!1)};return c.onMounted(()=>{document.addEventListener("click",I),t.visible&&c.nextTick(()=>A())}),c.onUnmounted(()=>{document.removeEventListener("click",I),o.value&&o.value.destroy()}),c.watch(()=>t.visible,B=>{B?c.nextTick(()=>A()):o.value&&(o.value.stop(),r.value=null)}),c.watch(s,B=>{B&&B.getViewer&&!o.value&&t.visible&&A()}),c.watch(l,B=>{o.value&&o.value.setUnit(B)}),(B,g)=>(c.openBlock(),c.createBlock(Pe,{visible:t.visible,title:"量算",width:70,"min-width":70,height:480,"onUpdate:visible":g[3]||(g[3]=P=>n("update:visible",P)),onClose:D},{default:c.withCtx(()=>[c.createElementVNode("div",zw,[c.createElementVNode("div",Ww,[c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="distance"}]),onClick:g[0]||(g[0]=P=>C("distance")),title:"距离测量"},[...g[4]||(g[4]=[c.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="angle"}]),onClick:g[1]||(g[1]=P=>C("angle")),title:"角度测量"},[...g[5]||(g[5]=[c.createElementVNode("div",{class:"tool-icon"},"📐",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="area"}]),onClick:g[2]||(g[2]=P=>C("area")),title:"面积测量"},[...g[6]||(g[6]=[c.createElementVNode("div",{class:"tool-icon"},"🔳",-1)])],2)]),g[15]||(g[15]=c.createElementVNode("div",{class:"separator"},null,-1)),d.value?(c.openBlock(),c.createElementBlock("div",jw,[d.value.type==="distance"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("div",Kw,[g[7]||(g[7]=c.createElementVNode("span",{class:"result-label"},"总长:",-1)),c.createElementVNode("span",$w,c.toDisplayString(m(d.value.dist)),1)]),c.createElementVNode("div",Xw,[g[8]||(g[8]=c.createElementVNode("span",{class:"result-label",style:{color:"#ff4d4f"}},"ΔX:",-1)),c.createElementVNode("span",qw,c.toDisplayString(m(d.value.dx)),1)]),c.createElementVNode("div",Jw,[g[9]||(g[9]=c.createElementVNode("span",{class:"result-label",style:{color:"#52c41a"}},"ΔY:",-1)),c.createElementVNode("span",Zw,c.toDisplayString(m(d.value.dy)),1)]),c.createElementVNode("div",eb,[g[10]||(g[10]=c.createElementVNode("span",{class:"result-label",style:{color:"#1890ff"}},"ΔZ:",-1)),c.createElementVNode("span",tb,c.toDisplayString(m(d.value.dz)),1)])],64)):c.createCommentVNode("",!0),d.value.type==="angle"?(c.openBlock(),c.createElementBlock("div",ib,[g[11]||(g[11]=c.createElementVNode("span",{class:"result-label"},"角度:",-1)),c.createElementVNode("span",nb,c.toDisplayString(d.value.angle.toFixed(1))+"°",1)])):c.createCommentVNode("",!0),d.value.type==="area"?(c.openBlock(),c.createElementBlock("div",sb,[g[12]||(g[12]=c.createElementVNode("span",{class:"result-label"},"面积:",-1)),c.createElementVNode("span",ob,c.toDisplayString(w(d.value.area)),1)])):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),c.createElementVNode("div",rb,[c.createElementVNode("div",ab,[c.createElementVNode("div",{class:"tool-item",onClick:c.withModifiers(N,["stop"])},[c.createElementVNode("div",lb,c.toDisplayString(l.value),1)]),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[h.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"unitDropdownRef",ref:p,class:"unit-dropdown",style:c.normalizeStyle(f.value)},[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(u,P=>c.createElementVNode("div",{key:P.value,class:c.normalizeClass(["unit-option",{selected:l.value===P.value}]),onClick:c.withModifiers(x=>v(P.value),["stop"])},c.toDisplayString(P.label),11,cb)),64))],4)):c.createCommentVNode("",!0)]))]),g[14]||(g[14]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",{class:"action-buttons"},[c.createElementVNode("div",{class:"tool-item control-btn",onClick:S,title:"清空"},[...g[13]||(g[13]=[c.createElementVNode("div",{class:"tool-icon"},"🗑️",-1)])])])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-b766acb4"]]);function hb(){const i=c.ref(!1),e=c.reactive({x:0,y:0}),t=c.ref([]),n=c.ref(null);return{visible:i,position:e,items:t,contextData:n,show:(a,d,h)=>{a instanceof MouseEvent?(a.preventDefault(),e.x=a.clientX,e.y=a.clientY):(e.x=a.x,e.y=a.y),t.value=d,n.value=h,i.value=!0},hide:()=>{i.value=!1},addItem:a=>{t.value.push(a)},removeItem:a=>{t.value=t.value.filter(d=>d.id!==a)}}}const ub=["onClick"],fb={class:"menu-label"},pb={key:0,class:"menu-arrow"},gb=Oe(c.defineComponent({__name:"LeitingContextMenu",props:{visible:{type:Boolean},position:{},items:{}},emits:["update:visible","action"],setup(i,{emit:e}){const t=i,n=e,s=r=>{r.disabled||(r.action&&r.action(),n("action",r),n("update:visible",!1))},o=()=>{t.visible&&n("update:visible",!1)};return c.onMounted(()=>{document.addEventListener("click",o),document.addEventListener("contextmenu",r=>{r.target.closest(".leiting-context-menu")||o()})}),c.onUnmounted(()=>{document.removeEventListener("click",o)}),(r,l)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:"leiting-context-menu",style:c.normalizeStyle({left:i.position.x+"px",top:i.position.y+"px"}),onContextmenu:l[0]||(l[0]=c.withModifiers(()=>{},["prevent"]))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.items,a=>(c.openBlock(),c.createElementBlock("div",{key:a.id,class:c.normalizeClass(["menu-item",{"menu-divided":a.divided,"menu-disabled":a.disabled}]),onClick:d=>s(a)},[c.createElementVNode("span",fb,c.toDisplayString(a.label),1),a.children?(c.openBlock(),c.createElementBlock("span",pb,"▶")):c.createCommentVNode("",!0)],10,ub))),128))],36)),[[c.vShow,i.visible]])}}),[["__scopeId","data-v-f288753b"]]),gn=Oe(c.defineComponent({__name:"LeitingBIM",props:{accessToken:{},cesiumUrl:{},cesiumCssUrl:{},methods:{},viewerOptions:{},treeProps:{},showTree:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!1},playerUrl:{default:"https://leiting.chenxisoft.com/resource/person/person.glb"},playerModelName:{default:"Person"},playerModelId:{default:"player_111"},playerScale:{default:.0032},tiandituToken:{default:"c25f14fb6bd4397cf8fe45144ff768d6"},globe:{type:Boolean,default:void 0},terrain:{type:Boolean,default:void 0},depthTest:{type:Boolean,default:void 0},mapProvider:{},tiandituLayerType:{},tiandituShowLabel:{type:Boolean,default:void 0},arcgisUrl:{},teleportTarget:{},shadows:{type:Boolean,default:void 0},environmentMap:{type:Boolean,default:void 0},ambientOcclusion:{type:Boolean,default:void 0},time:{},brightness:{},backgroundColor:{},collision:{type:Boolean,default:void 0},mouseHabit:{},mode:{default:"3d"},mountAll3Dtiles:{},mountAllCad:{},saveRegion:{},saveCadRegion:{},saveCadCalibration:{},selectionChange:{},searchComponent:{}},emits:["register","init","ready"],setup(i,{expose:e,emit:t}){const n=c.ref(),s=c.ref(),o=c.getCurrentInstance(),r=c.ref(!1),l=c.ref(""),a=c.ref({}),d=c.ref("3d"),h=i,f={title:"构件树",treeData:[]},p=c.ref(!1),u=c.ref(!1),m=c.ref(!1),w=c.ref(!1),A=c.ref(!1),C=c.ref(!1),v=c.ref(!1),S=c.ref(!1),D=c.ref(!1),N=c.ref(!1),{visible:I,position:B,items:g,show:P,hide:x}=hb(),k=c.ref([]),_=V=>{k.value.push(V)},G=V=>{k.value=k.value.filter(j=>j.id!==V)},F=c.ref([]),E=c.ref(""),y=c.ref(null),b=c.ref([]),T=c.reactive({tree:!1,section:!1,roam:!1,info:!1,adjustModel:!1,setting:!1,cadLayer:!1,cadPosition:!1,annotation:!1}),R=(V,j)=>{V==="componentTree"&&(V="tree"),V==="componentInfo"&&(V="info"),V in T&&(T[V]=j)},O=c.shallowRef({});c.provide("leitingMethods",O);const L=c.ref(h.showMenu),M=c.ref([]);c.watch(()=>h.showMenu,V=>{L.value=V},{immediate:!0}),c.watch(()=>h.mode,V=>{V&&O.value?.set2d&&O.value.set2d(V==="2d")});const Q=c.ref("dark");c.provide("leiting-theme",Q);const Y=c.ref(h.teleportTarget);c.watch(()=>h.teleportTarget,V=>{Y.value=V});const W=c.ref([]),q=c.computed(()=>{const V=[];return p.value&&(V.push("tree"),V.push("componentTree")),u.value&&V.push("section"),m.value&&V.push("roam"),w.value&&(V.push("info"),V.push("componentInfo")),A.value&&V.push("adjust"),C.value&&V.push("setting"),v.value&&V.push("cadLayer"),S.value&&V.push("cadPosition"),D.value&&V.push("annotation"),N.value&&(V.push("measure"),V.push("measurement")),V.push(...W.value),V}),Z=c.ref(null),oe=(V,j)=>{V==="componentTree"||V==="tree"?p.value=j:V==="section"?u.value=j:V==="roam"?m.value=j:V==="componentInfo"||V==="info"?w.value=j:V==="homeView"?O.value?.is2dMode?.()?O.value?.flyToTopView?.({}):O.value?.getBIMmodelId()?O.value?.flyToTileset?.({}):O.value?.getCadModelId()&&O.value?.flyToTopView?.({}):V==="adjustModel"?(A.value=j,j&&Z.value&&Z.value.setModelType("BIM")):V==="osgbAdjust"?(A.value=j,j&&Z.value&&Z.value.setModelType("OSGB")):V==="setting"?C.value=j:V==="cadLayer"?v.value=j:V==="cadPosition"?S.value=j:V==="annotation"?D.value=j:V==="measurement"?N.value=j:j?W.value.includes(V)||W.value.push(V):W.value=W.value.filter(te=>te!==V)};c.watch(p,async V=>{if(V&&O.value?.loadTreeForModel&&O.value?.getMapTileset){const j=O.value.getMapTileset(),te=Object.values(j).map(async Ae=>{if(Ae.leiting&&Ae.leiting.model?.treeUrl){const Ce=Ae.leiting.model.modelId;try{Ae.leiting?.node?.batchIdEIDInfos||await O.value.loadNodeDetailsForModel(Ce);const Me=await O.value.loadTreeForModel(Ce);Me&&(Array.isArray(Me)?Me:[Me]).forEach(Ne=>{Ne&&!b.value.find(st=>st.id===Ne.id)&&(Ne.modelId=Ce,b.value=[...b.value,Ne])})}catch(Me){console.warn(`Failed to lazy load tree for ${Ce}`,Me)}}});await Promise.all(te)}});const ne=()=>{O.value&&(O.value.getDxfModels&&(F.value=O.value.getDxfModels()||[]),O.value.getCadModelId&&(E.value=O.value.getCadModelId()||""))};let se;c.watch(v,V=>{V&&ne()}),c.watch(S,V=>{V&&(ne(),y.value&&F.value.length&&y.value.addGltfOr3dTilesModelList(F.value))});const pe=t,ve=V=>{O.value&&O.value.saveCadCalibration&&O.value.saveCadCalibration(V),O.value&&O.value.saveCadRegion&&O.value.saveCadRegion(V)};return c.onMounted(async()=>{if(s.value&&fe.setContainer(s.value),!!n.value)try{const V={...mt,cesiumUrl:h.cesiumUrl||mt.cesiumUrl,cesiumCssUrl:h.cesiumCssUrl||mt.cesiumCssUrl,accessToken:h.accessToken||wn()||mt.accessToken};await En(V);const j=h.accessToken||wn()||mt.accessToken;j&&(Cesium.Ion.defaultAccessToken=j),r.value=!0,se=async(Ae={},Ce)=>{if(n.value){const{showMenu:Me,showTree:Le,globe:Ne,terrain:st,depthTest:mn,mapProvider:Ii,tiandituLayerType:jt,tiandituShowLabel:ks,arcgisUrl:yb,shadows:Cb,environmentMap:Eb,ambientOcclusion:wb,time:bb,brightness:vb,backgroundColor:Ib,collision:Bb,mouseHabit:xb,heightBasedZoom:Sb,mode:yl,...Ze}=Ae||{},Tb=h.showMenu!==void 0?h.showMenu:Me!==void 0?Me:!0;L.value=Tb;const De=(X,Ee,We)=>X!==void 0?X:Ee!==void 0?Ee:We,Cl=De(h.globe,Ne,!1),El=De(h.terrain,st,!1),wl=De(h.depthTest,mn,!1),bl=De(h.mapProvider,Ii,"tianditu"),vl=De(h.tiandituLayerType,jt,"img_w"),Il=De(h.tiandituShowLabel,ks,!1),Bl=De(h.arcgisUrl,yb,"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),xl=De(h.shadows,Cb,!1),Sl=De(h.environmentMap,Eb,!1),Tl=De(h.ambientOcclusion,wb,!1),Ml=De(h.time,bb,void 0),Dl=De(h.brightness,vb,1),An=h.mode||yl||"3d";console.log("LeitingBIM Mode:",An,"Props:",h.mode,"Options:",yl),d.value=An;const Mb=An==="2d"?"#000000":"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)",kl=De(h.backgroundColor,Ib,Mb),Pl=De(h.collision,Bb,!1),Fl=De(h.mouseHabit,xb,0),Rl=De(h.heightBasedZoom,Sb,!1);a.value={globe:Cl,terrain:El,depthTest:wl,mapProvider:bl,tiandituLayerType:vl,tiandituShowLabel:Il,arcgisUrl:Bl,shadows:xl,environmentMap:Sl,ambientOcclusion:Tl,time:Ml,brightness:Dl,backgroundColor:kl,collision:Pl,mouseHabit:Fl,heightBasedZoom:Rl};const Bi=dy({container:n.value,appContext:o?.appContext,methods:{...O.value,handleMenuAction:oe,setCardFullHeight:R,onLoadingStatus:X=>{X?fe.loading(X,"",s.value):fe.close()},...Ze,tilesLoad3dTiles:async X=>{let Ee=X.leiting?.tree;const We=X.leiting?.model?.modelId;if(!Ee&&p.value&&O.value?.loadTreeForModel)try{Ee=await O.value.loadTreeForModel(We)}catch(Si){console.warn("Failed to lazy load tree",Si)}Ee&&(Array.isArray(Ee)?Ee:[Ee]).forEach(Dt=>{Dt&&!b.value.find(Ll=>Ll.id===Dt.id)&&(Dt.modelId=We,b.value=[...b.value,Dt])});const{brightness:Ps,contrast:Fs,saturation:ot}=Bi.methods.getConfigure();Bi.methods.setModelColorAdjustment({brightness:Ps,contrast:Fs,saturation:ot}),Ze.tilesLoad3dTiles?.(X)},mountAll3Dtiles:X=>{h.mountAll3Dtiles&&h.mountAll3Dtiles(X),Ze.mountAll3Dtiles?.(X)},updateModels:X=>{if(Array.isArray(X))if(X.length===0)b.value=[];else{const Ee=X.map(We=>We.modelId);b.value=b.value.filter(We=>Ee.includes(We.modelId))}},mountAllCad:X=>{if(Bi.methods.setModelBrightness){const Ee=h.brightness!==void 0?h.brightness:a.value.brightness;Ee!==void 0&&Bi.methods.setModelBrightness(Ee)}h.mountAllCad&&h.mountAllCad(X),Ze.mountAllCad?.(X)},saveRegion:X=>{h.saveRegion&&h.saveRegion(X),Ze.saveRegion?.(X)},saveCadRegion:X=>{h.saveCadRegion&&h.saveCadRegion(X),Ze.saveCadRegion?.(X)},saveCadCalibration:X=>{h.saveCadCalibration&&h.saveCadCalibration(X),Ze.saveCadCalibration?.(X)},selectionChange:X=>{h.selectionChange&&h.selectionChange(X),Ze.selectionChange?.(X)},onSearchComponent:X=>{h.searchComponent&&h.searchComponent(X),Ze.searchComponent?.(X)}},viewerOptions:h.viewerOptions,options:{...Ze,mode:An,playerUrl:h.playerUrl,playerModelName:h.playerModelName,playerModelId:h.playerModelId,playerScale:h.playerScale,globe:Cl,terrain:El,depthTest:wl,mapProvider:bl,tiandituLayerType:vl,tiandituShowLabel:Il,tiandituToken:h.tiandituToken,arcgisUrl:Bl,shadows:xl,environmentMap:Sl,ambientOcclusion:Tl,time:Ml,brightness:Dl,backgroundColor:kl,collision:Pl,mouseHabit:Fl,heightBasedZoom:Rl},callbacks:{onLoading:X=>X?fe.loading(X,"",s.value):fe.close(),onSuccess:X=>fe.success(X,"",void 0,s.value),onError:X=>fe.error(X,"",void 0,s.value)}}),{Cesium:Mt,viewer:Kt,methods:yn,menuEvents:xi}=Bi,le=yn;xi.on("showMenu",X=>{L.value=X}),xi.on("insertMenu",X=>{M.value=[...M.value,...X]}),xi.on("setMenuActive",(X,Ee)=>{oe(X,Ee)}),O.value=le,Ce&&(Ce.value=le),xi.on("setMode",X=>{d.value=X}),xi.on("deleteAllModels",()=>{b.value=[]}),new Mt.ScreenSpaceEventHandler(Kt.scene.canvas).setInputAction(async X=>{if(x(),d.value==="2d")return;const Ee=Kt.scene.pick(X.position),We=Kt.container.getBoundingClientRect(),Ps=We.left+X.position.x,Fs=We.top+X.position.y,ot=[];if(Mt.defined(Ee)&&Ee instanceof Mt.Cesium3DTileFeature){const Si=le.baseCompt.getFeatureId(Ee),Dt=ai(Ee.tileset);le.baseCompt.hasSelectedFeaturesMap[Dt]?.some(Ti=>Ti.batchId===Si&&Ti.rank===0)||(await le.baseCompt.clearSelection(),await le.baseCompt.toggleMultiSelect(Dt,Si,le.baseCompt.selectedColor)),ot.push({id:"details",label:"构件详情",action:()=>{w.value=!0}}),ot.push({id:"hide",label:"隐藏选中构件",action:async()=>{const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,show:!1}));le.baseCompt.setComponentVisibility(Mi)}}),ot.push({id:"translucent",label:"半透明选中构件",action:async()=>{const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,rgba:{...rt.rgba,a:.3}}));await le.baseCompt.setSelectColorUserModelCpt(Mi,{rank:0})}}),ot.push({id:"isolate",label:"隔离选中构件",divided:!0,action:async()=>{await le.baseCompt.loadAllNodeDetailsForModel();const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,show:!0}));le.isolateComponents(Mi)}})}ot.push({id:"showAll",label:"显示所有",action:async()=>{le.baseCompt.setAllComponentsVisibility(!0),await le.baseCompt.clearSelection()}}),ot.push(...k.value),P({x:Ps,y:Fs},ot)},Mt.ScreenSpaceEventType.RIGHT_CLICK),le.addContextMenuItems=_,le.insertContextMenu=le.addContextMenuItems,le.removeContextMenuItems=G,le.deleteContextMenu=le.removeContextMenuItems,le.closeContextMenu=x,le.hideContextMenu=le.closeContextMenu,le.onSetTeleportTarget=X=>{Y.value=X},await c.nextTick();const Ol=Ae?.onLoaded||Ae?.onloaded;Ol&&Ol({Cesium:Mt,viewer:Kt,methods:yn}),pe("init",{Cesium:Mt,viewer:Kt,methods:yn}),pe("ready",{Cesium:Mt,viewer:Kt,methods:yn})}};let te=!1;pe("register",(Ae,Ce)=>{te=!0,se(Ae,Ce)}),te||setTimeout(()=>{O.value.getViewer||se()},0)}catch(V){l.value="Failed to load Cesium: "+(V.message||V),console.error(V)}}),c.onUnmounted(()=>{fe.setContainer(null)}),e({initMap:()=>O.value,initializeViewer:(V,j)=>se(V,j)}),(V,j)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["leiting-bim-container",[`theme-${Q.value}`]]),onContextmenu:j[11]||(j[11]=c.withModifiers(()=>{},["prevent","stop"]))},[!r.value&&!l.value?(c.openBlock(),c.createBlock(c.unref(ge.Spin),{key:0,class:"loading",size:"large",tip:"加载基础组件中..."})):c.createCommentVNode("",!0),l.value?(c.openBlock(),c.createBlock(c.unref(ge.Alert),{key:1,class:"error",type:"error",message:l.value,"show-icon":""},null,8,["message"])):c.createCommentVNode("",!0),c.createElementVNode("div",{ref_key:"containerRef",ref:n,class:"cesium-viewer"},[c.createVNode(yi,{visible:L.value,"active-ids":q.value,"custom-items":M.value,onAction:oe,"is-2d":d.value==="2d"},null,8,["visible","active-ids","custom-items","is-2d"]),(c.openBlock(),c.createBlock(c.Teleport,{to:Y.value||"body",disabled:!Y.value},[c.createElementVNode("div",{ref_key:"uiOverlayRef",ref:s,class:"leiting-ui-overlay"},[c.createVNode(wi,{visible:w.value,"full-height":T.info,"onUpdate:visible":j[0]||(j[0]=te=>w.value=te)},null,8,["visible","full-height"]),c.createVNode(bi,{ref_key:"LeitingPositionRef",ref:Z,visible:A.value,"full-height":T.adjustModel,"onUpdate:visible":j[1]||(j[1]=te=>A.value=te)},null,8,["visible","full-height"]),c.createVNode(vi,{visible:C.value,"full-height":T.setting,"tianditu-token":h.tiandituToken,"initial-config":a.value,"onUpdate:visible":j[2]||(j[2]=te=>C.value=te)},null,8,["visible","full-height","tianditu-token","initial-config"]),i.showTree!==!1?(c.openBlock(),c.createBlock(an,c.mergeProps({key:0},{...f,...i.treeProps},{visible:p.value,"full-height":T.tree,"tree-data":b.value.length>0?b.value:i.treeProps?.treeData||[],"onUpdate:visible":j[3]||(j[3]=te=>{p.value=te})}),null,16,["visible","full-height","tree-data"])):c.createCommentVNode("",!0),c.createVNode(Vw,{visible:D.value,"onUpdate:visible":j[4]||(j[4]=te=>D.value=te)},null,8,["visible"]),c.createVNode(db,{visible:N.value,"onUpdate:visible":j[5]||(j[5]=te=>N.value=te)},null,8,["visible"]),c.createVNode(Ci,{visible:u.value,"full-height":T.section,"onUpdate:visible":j[6]||(j[6]=te=>u.value=te)},null,8,["visible","full-height"]),c.createVNode(Ei,{visible:m.value,"full-height":T.roam,"onUpdate:visible":j[7]||(j[7]=te=>m.value=te)},null,8,["visible","full-height"]),c.createVNode(HE,{visible:v.value,"current-model-id":E.value,"onUpdate:visible":j[8]||(j[8]=te=>v.value=te)},null,8,["visible","current-model-id"]),c.createVNode(Ow,{ref_key:"cadPositionRef",ref:y,visible:S.value,"onUpdate:visible":j[9]||(j[9]=te=>S.value=te),onSave:ve},null,8,["visible"]),c.createVNode(gb,{visible:c.unref(I),position:c.unref(B),items:c.unref(g),"onUpdate:visible":j[10]||(j[10]=te=>I.value=te)},null,8,["visible","position","items"]),c.renderSlot(V.$slots,"default",c.normalizeProps(c.guardReactiveProps({methods:O.value,isReady:r.value})),void 0,!0)],512)],8,["to","disabled"]))],512)],34))}}),[["__scopeId","data-v-2c7554a8"]]);function Al(i){const e=c.ref(),t=c.ref(i.theme||"dark"),n=c.ref(i.menuSize||"medium");c.provide("leiting-theme",t),c.provide("leiting-menu-size",n);function s(l){c.onUnmounted(()=>{e.value=null}),l(i,e)}function o(){const l=c.unref(e);return l||console.error("未获取到leiting实例!"),l}const r=new Proxy({},{get(l,a){const d=o();if(!d)return;const h=d[a];return typeof h=="function"?h.bind(d):h},set(l,a,d){const h=o();return h?(h[a]=d,!0):!1}});return[s,r]}const mb=mt,Ab={install:(i,e)=>{if(i.component("LeitingBIM",gn),i.component("LeitingTree",an),i.component("LeitingDraggableCard",Pe),i.component("leiting-draggable-card",Pe),i.component("LeitingMenu",yi),i.component("leiting-menu",yi),i.component("LeitingSection",Ci),i.component("leiting-section",Ci),i.component("LeitingPlayer",Ei),i.component("leiting-player",Ei),i.component("LeitingInfo",wi),i.component("leiting-info",wi),i.component("LeitingPosition",bi),i.component("leiting-position",bi),i.component("LeitingSetting",vi),i.component("leiting-setting",vi),!e)return;const t={...mb,...e};t.cesiumUrl&&En(t).catch(n=>{console.error("[LeitingBim] Failed to load Cesium resources:",n)}),i.config.globalProperties.$leitingBimOptions=t}};U.DEFAULT_CESIUM_CONFIG=mt,U.LeiTingBIM=gn,U.LeiTingDraggableCard=Pe,U.LeiTingInfo=wi,U.LeiTingMenu=yi,U.LeiTingPlayer=Ei,U.LeiTingPosition=bi,U.LeiTingSection=Ci,U.LeiTingSetting=vi,U.LeiTingTree=an,U.LeitingBIM=gn,U.LeitingDraggableCard=Pe,U.LeitingInfo=wi,U.LeitingMenu=yi,U.LeitingPlayer=Ei,U.LeitingPosition=bi,U.LeitingSection=Ci,U.LeitingSetting=vi,U.LeitingTree=an,U.default=Ab,U.getAccessToken=wn,U.leitingBim=gn,U.loadCesium=En,U.useLeiTing=Al,U.useLeiting=Al,U.waitForCesium=Ql,Object.defineProperties(U,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
118
+ `});p.isModelAdjustment=!0,f.customShader=p}else e.brightness!==void 0&&e.brightness!==1&&!f.style&&(f.style=new n.Cesium3DTileStyle({color:`color('white') * ${e.brightness}`}))}}setModelBrightness(e){this.setModelColorAdjustment({brightness:e})}_defaultSkyBox=null;_updateLightDirection=e=>{e.light instanceof this.cesium.DirectionalLight&&(e.light.direction=e.camera.directionWC)};setEnvironmentMapEnable(e){this.is2d||(e?(this.viewer.scene.light=new this.cesium.DirectionalLight({direction:this.viewer.scene.camera.directionWC}),this.viewer.scene.preRender.addEventListener(this._updateLightDirection)):(this._defaultSkyBox&&(this.viewer.scene.skyBox=this._defaultSkyBox),this.viewer.scene.preRender.removeEventListener(this._updateLightDirection),this.viewer.scene.light=new this.cesium.SunLight),this.viewer.scene.imageBasedLighting&&(this.viewer.scene.imageBasedLighting.imageBasedLightingFactor=e?new this.cesium.Cartesian2(2,2):new this.cesium.Cartesian2(1,1)))}setAmbientOcclusion(e){if(this.is2d)return;const t=this.viewer.scene;if(!t||!t.postProcessStages||!t.postProcessStages.ambientOcclusion)return;const n=t.postProcessStages.ambientOcclusion;n.enabled=e,e&&(n.uniforms.ambientOcclusionOnly=!1,n.uniforms.intensity=3,n.uniforms.bias=.1,n.uniforms.lengthCap=.03,n.uniforms.stepSize=1,n.uniforms.blurStepSize=.86)}setCollisionDetection(e){if(this.is2d){this.viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1;return}const t=this.viewer.scene.screenSpaceCameraController;t.enableCollisionDetection=e,e||t.minimumZoomDistance<1&&(t.minimumZoomDistance=1)}_customZoomHandler=null;_zoomInertiaListener=null;setHeightBasedZoom(e){const t=this.viewer.scene.screenSpaceCameraController,n=this.cesium;if(this.viewer.camera.frustum.near=1e-5,this.viewer.camera.frustum.far=1e8,e||(this.viewer.camera.frustum.near=.1),this._customZoomHandler&&(this._customZoomHandler.destroy(),this._customZoomHandler=null),this._zoomInertiaListener&&(this._zoomInertiaListener(),this._zoomInertiaListener=null),!e){t.zoomEventTypes.includes(n.CameraEventType.WHEEL)||t.zoomEventTypes.push(n.CameraEventType.WHEEL);return}t.zoomEventTypes=t.zoomEventTypes.filter(l=>l!==n.CameraEventType.WHEEL),this._customZoomHandler=new n.ScreenSpaceEventHandler(this.viewer.scene.canvas);let s=null;this._customZoomHandler.setInputAction(l=>{s=l.endPosition},n.ScreenSpaceEventType.MOUSE_MOVE);let o=0,r=null;this._zoomInertiaListener=this.viewer.scene.preUpdate.addEventListener(()=>{if(Math.abs(o)<.001||!r){o=0;return}const l=this.viewer.camera,a=o*.2;if(s){const h=l.getPickRay(s);if(h){let f=this.viewer.scene.pickPosition(s);if(!f){const p=n.IntersectionTests.rayEllipsoid(h,this.viewer.scene.globe.ellipsoid);p&&(f=n.Ray.getPoint(h,p.start))}if(f){const p=n.Cartesian3.distance(l.position,f);if(a>0&&a>p-.01){if(o=0,p>.01){const u=n.Cartesian3.multiplyByScalar(r,p-.01,new n.Cartesian3);l.position=n.Cartesian3.add(l.position,u,new n.Cartesian3)}return}}}}const d=n.Cartesian3.multiplyByScalar(r,a,new n.Cartesian3);l.position=n.Cartesian3.add(l.position,d,new n.Cartesian3),o-=a}),this._customZoomHandler.setInputAction(l=>{const a=this.viewer.camera,d=a.positionCartographic.height,h=.2;let f=0;const p=Math.sign(l);if(p>0){const u=d-1;f=u>0?u*h:0}else f=d*h;if(f=Math.max(.01,f),d<.2&&p>0){fe.info("无法继续放大");return}if(!s)r=a.direction;else{const u=a.getPickRay(s);if(u){let m=this.viewer.scene.pickPosition(s);if(!m){const w=n.IntersectionTests.rayEllipsoid(u,this.viewer.scene.globe.ellipsoid);w&&(m=n.Ray.getPoint(u,w.start))}if(m){const w=n.Cartesian3.subtract(m,a.position,new n.Cartesian3);r=n.Cartesian3.normalize(w,new n.Cartesian3)}else r=a.direction}else r=a.direction}o+=p>0?f:-f*2},n.ScreenSpaceEventType.WHEEL)}setMouseHabit(e){if(this.is2d)return;const t=this.viewer.scene.screenSpaceCameraController;t.enableTranslate=!0,t.enableRotate=!0,t.enableZoom=!0,t.enableTilt=!0,t.enableLook=!1,t.lookEventTypes=[],e===1?(t.rotateEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.MIDDLE_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.LEFT_DRAG]):(t.rotateEventTypes=[this.cesium.CameraEventType.LEFT_DRAG],t.zoomEventTypes=[this.cesium.CameraEventType.RIGHT_DRAG,this.cesium.CameraEventType.WHEEL,this.cesium.CameraEventType.PINCH],t.tiltEventTypes=[this.cesium.CameraEventType.PINCH,this.cesium.CameraEventType.MIDDLE_DRAG])}}class cy{cesium;viewer;constructor(e){this.cesium=e.cesium,this.viewer=e.viewer}getCameraView(){const e=this.viewer.camera;return{position:{x:e.position.x,y:e.position.y,z:e.position.z},destination:{x:e.position.x,y:e.position.y,z:e.position.z},orientation:{heading:e.heading,pitch:e.pitch,roll:e.roll},duration:1}}flyToCameraView(e){const{position:t,orientation:n,duration:s}=e,o=new this.cesium.Cartesian3(t.x,t.y,t.z),r=new this.cesium.HeadingPitchRoll(n.heading,n.pitch,n.roll);!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}getCurrentCameraPositionAndTarget(){const e=this.getCameraView();return{position:e.position,target:{heading:e.orientation.heading,pitch:e.orientation.pitch,roll:e.orientation.roll},duration:e.duration}}setCameraView(e){const t=e.target||e.orientation||{},n=e.destination||e.position||{};this.flyToCameraView({position:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},destination:{x:Number(n.x),y:Number(n.y),z:Number(n.z)},orientation:{heading:Number(t.heading||0),pitch:Number(t.pitch||0),roll:Number(t.roll||0)},duration:e.duration})}flyToLonLatHeight(e,t,n,s=1){const o=this.cesium.Cartesian3.fromDegrees(e,t,n),r={heading:this.cesium.Math.toRadians(0),pitch:this.cesium.Math.toRadians(-90),roll:0};!s||s<=0?this.viewer.camera.setView({destination:o,orientation:r}):this.viewer.camera.flyTo({destination:o,orientation:r,duration:s})}}function dy(i){const{container:e,appContext:t,methods:n,viewerOptions:s,options:o,callbacks:r}=i,l=new Hi,a=window.Cesium;if(!a)throw new Error("Cesium is not loaded");e.id=`cesium-container-${np()}`;const d={animation:!1,timeline:!1,infoBox:!1,homeButton:!1,fullscreenButton:!1,sceneModePicker:!1,navigationHelpButton:!1,geocoder:!1,baseLayerPicker:!1,selectionIndicator:!1,heightBasedZoom:!0,creditContainer:document.createElement("div"),contextOptions:{webgl:{alpha:!0}}},h=t?.config?.globalProperties?.$leitingBimOptions,f={...d,...h?.viewerOptions??{},...s??{}},p=new a.Viewer(e,f);p.camera.setView({destination:a.Cartesian3.fromDegrees(108,32,1e7),orientation:{heading:a.Math.toRadians(0),pitch:a.Math.toRadians(-90),roll:0}});let u=n;if(!u&&h&&(h.methods||(h.methods={}),u=h.methods),u){const m=new mp({cesium:a,viewer:p,options:o,callbacks:r}),w=new kr({cesium:a,viewer:p}),A=new ly({cesium:a,viewer:p}),C=new Ap({cesium:a,viewer:p}),v=new cy({cesium:a,viewer:p});let S;const D=new il({cesium:a,viewer:p});o&&(o.globe!==void 0&&A.setGlobeEnvironmentVisible(o.globe),o.terrain!==void 0&&A.setTerrainEnable(o.terrain),o.depthTest!==void 0&&A.setDepthTestEnable(o.depthTest),o.mapProvider&&o.mode!=="2d"&&A.changeBaseMap(o.mapProvider,{token:o.tiandituToken,layerType:o.tiandituLayerType,showAnnotation:o.tiandituShowLabel,url:o.arcgisUrl}),o.shadows!==void 0&&A.setShadowsEnable(o.shadows),o.environmentMap!==void 0&&A.setEnvironmentMapEnable(o.environmentMap),o.ambientOcclusion!==void 0&&A.setAmbientOcclusion(o.ambientOcclusion),o.time!==void 0&&A.setTime(o.time),o.brightness!==void 0&&A.setModelBrightness(o.brightness),o.backgroundColor!==void 0&&A.setBackgroundColor(o.backgroundColor),o.collision!==void 0&&A.setCollisionDetection(o.collision),o.mouseHabit!==void 0&&A.setMouseHabit(o.mouseHabit),o.heightBasedZoom!==void 0&&A.setHeightBasedZoom(o.heightBasedZoom)),o&&o.mode==="2d"&&(console.log("InitMap: Setting CAD Mode 2D"),A.setCadMode("2d"),S=new tl({cesium:a,viewer:p})),w.events.on("tilesetLoaded",g=>{m.baseCompt.attachTileset(g,m.baseCompt.selectedColor),m.baseSection.attachTileset(g,g.leiting?.model?.modelId),u&&u.tilesLoad3dTiles&&u.tilesLoad3dTiles(g),o?.tilesLoad3dTiles&&o.tilesLoad3dTiles(g.leiting)}),w.events.on("loadingStatus",g=>{u&&u.onLoadingStatus&&u.onLoadingStatus(g)}),w.events.on("mountAll3Dtiles",({modelList:g})=>{o?.mountAll3Dtiles&&o.mountAll3Dtiles(g),u?.mountAll3Dtiles&&u.mountAll3Dtiles(g)}),w.events.on("updateModels",({modelList:g})=>{o?.updateModels&&o.updateModels(g),u?.updateModels&&u.updateModels(g)}),C.events.on("mountAllCad",g=>{o?.mountAllCad&&o.mountAllCad(g),u?.mountAllCad&&u.mountAllCad(g)}),m.baseCompt.loadNodeDetailsForModel=g=>w.loadNodeDetailsForModel(g),m.baseCompt.selectionChange(g=>{g.length!==0&&(o?.selectionChange&&o.selectionChange(g),u?.selectionChange&&u.selectionChange(g))}),u.onSearchComponent=g=>{o?.searchComponent&&o.searchComponent(g),u?.searchComponent&&u.searchComponent(g)};const N=u.saveRegion;u.saveRegion=g=>{o?.saveRegion&&o.saveRegion(g),N&&N!==o?.saveRegion&&N(g)};const I=u.saveCadCalibration;u.saveCadCalibration=g=>{o?.saveCadCalibration&&o.saveCadCalibration(g),I&&I!==o?.saveCadCalibration&&I(g)};const B=u.saveCadRegion;u.saveCadRegion=g=>{o?.saveCadRegion&&o.saveCadRegion(g),B&&B!==o?.saveCadRegion&&B(g)},u.getCesium=()=>a,u.getViewer=()=>p,u.getAnnotationInstance=()=>S,u.getMeasureInstance=()=>D,u.flyToCamera=g=>{v.setCameraView(g)},u.flyToLonLatHeight=(g,P,x,k=1)=>{v.flyToLonLatHeight(g,P,x,k)},u.flyTo=u.flyToCamera,u.getCameraState=()=>v.getCameraView(),u.getCameraInfo=u.getCameraState,u.restoreCameraState=g=>v.flyToCameraView(g),u.flyToCameraView=u.restoreCameraState,u.getCameraPositionTarget=()=>v.getCurrentCameraPositionAndTarget(),u.getCurrentCameraPositionAndTarget=u.getCameraPositionTarget,u.setCameraLookAt=g=>v.setCameraView(g),u.setCameraView=u.setCameraLookAt,u.setCanvasBackground=g=>A.setBackgroundColor(g),u.setBackgroundColor=u.setCanvasBackground,u.setAntiAliasing=g=>m.enableCesiumFXAA(g),u.enableCesiumFXAA=u.setAntiAliasing,u.setSceneVisibility=g=>m.setSceneOptions(g),u.setSceneOptions=u.setSceneVisibility,u.addDebugPoint=(g,P,x=0)=>{p.entities.add({position:a.Cartesian3.fromDegrees(g,P,x),point:{pixelSize:10,color:a.Color.RED}})},u.addPoint=u.addDebugPoint,u.toggleDebugLabels=()=>m.enableTestLabel(),u.enableTestLabel=u.toggleDebugLabels,u.captureScreenshot=()=>{const g=p.scene.canvas;return p.render(),g.toDataURL("image/png")},u.getImageBase64=u.captureScreenshot,u.captureDomScreenshot=(g,P)=>m.getSnapDomSImageBase64(g,P),u.getSnapDomSImageBase64=u.captureDomScreenshot,u.addModels=g=>w.addModels(g),u.add3DtilesModel=u.addModels,u.addObliquePhotography=g=>w.addOSGB(g),u.addOSGB=u.addObliquePhotography,u.adjustOSGBModelMatrix=g=>w.updateOSGBMatrix(g),u.updateOSGBMatrix=u.adjustOSGBModelMatrix,u.setModelVisibility=g=>w.showModels(g),u.showModels=u.setModelVisibility,u.showTileset=u.setModelVisibility,u.removeModels=g=>w.deleteModels(g),u.deleteModels=u.removeModels,u.clearAllModels=()=>{w.deleteAllModels(),l.emit("deleteAllModels")},u.deleteAllModelList=u.clearAllModels,u.deleteAllModels=u.clearAllModels,u.flyToModel=g=>w.flyToTileset(g),u.flyToTileset=u.flyToModel,u.flyToByModelId=u.flyToModel,u.setModelBrightness=g=>m.updateModelEffect(g),u.updateModelEffect=u.setModelBrightness,u.getAllTilesets=()=>w.getMapTileset(),u.getMapTileset=u.getAllTilesets,u.getCurrentModelId=()=>w.getBIMmodelId(),u.getBIMmodelId=u.getCurrentModelId,u.getLoadedModels=()=>w.getModelList(),u.getModelList=u.getLoadedModels,u.loadModelStructure=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelStructure: modelId is required");return}return await w.loadTreeForModel(P)},u.loadTreeForModel=u.loadModelStructure,u.loadModelDetails=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelDetails: modelId is required");return}return await w.loadNodeDetailsForModel(P)},u.loadNodeDetailsForModel=u.loadModelDetails,u._loadNodeDetailsForModel=async g=>{const P=typeof g=="string"?g:g?.modelId;if(!P){console.warn("loadModelDetails: modelId is required");return}return await w._loadNodeDetailsForModel(P)},u.setMapTileset=g=>w.setMapTileset(g),u.setCurrentModelId=g=>w.setBIMmodelId(g),u.setBIMmodelId=u.setCurrentModelId,u.setModelList=g=>w.setModelList(g),u.highlightComponents=(g,P={})=>m.baseCompt.setSelectColorUserModelCpt(g,P),u.setSelectColorUserModelCpt=u.highlightComponents,m.baseCompt.setLoadNodeDetailsCallback(g=>w.loadNodeDetailsForModel(g)),u.highlightAllComponents=(g,P)=>m.baseCompt.setAllSelectColorUserModelCpt(g,P),u.setAllSelectColorUserModelCpt=u.highlightAllComponents,u.setSelectColorUserModelCptByClear=(g,P)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g.selectCpts,P??{rank:0})},u.clearSelectColorUserModelCpt=()=>m.baseCompt.clearAllHaveSelected(),u.selectComponents=(g,P)=>{m.baseCompt.clearAllHaveSelected(),m.baseCompt.setSelectColorUserModelCpt(g,P??{rank:0})},u.setSelecteds=u.selectComponents,u.setSelectionColor=(g,P,x,k)=>m.baseCompt.setSelectedColorRgba(g,P,x,k),u.setSelectedColor=u.setSelectionColor,u.clearSelection=()=>m.baseCompt.clearAllHaveSelected(),u.clearAllHaveSelected=u.clearSelection,u.getSelectedComponents=g=>m.baseCompt.getSelected(g),u.getSelected=u.getSelectedComponents,u.onSelectionChange=g=>{m.baseCompt.selectionChange(g)},u.selectionChange=u.onSelectionChange,u.flyToComponents=g=>m.baseCompt.flyToObjects(g),u.flyToObjects=u.flyToComponents,u.setConstructionData=async g=>{if(g&&Array.isArray(g)){const P=new Set;g.forEach(x=>{x.mergeCpts&&Array.isArray(x.mergeCpts)&&x.mergeCpts.forEach(k=>{k.modelId&&P.add(k.modelId)})}),P.size>0&&await Promise.all(Array.from(P).map(x=>u.loadNodeDetailsForModel(x)))}m.baseCompt.setAllConstructionProgressTracking(g)},u.setAllConstructionProgressTracking=u.setConstructionData,u.startConstructionSimulation=()=>m.baseCompt.enableConstructionProgressTracking(),u.enableAllConstructionProgressTracking=u.startConstructionSimulation,u.stopConstructionSimulation=()=>m.baseCompt.disableConstructionProgressTracking(),u.disableConstructionProgressTracking=u.stopConstructionSimulation,u.disableAllConstructionProgressTracking=u.stopConstructionSimulation,u.resetConstructionSimulation=()=>m.baseCompt.freshConstructionProgressTracking(),u.freshConstructionProgressTracking=u.resetConstructionSimulation,u.restartConstructionSimulation=()=>m.baseCompt.reStartAnimation(),u.reStartAnimation=u.restartConstructionSimulation,u.resumeFlyTo=()=>m.baseCompt.resumeFlyTo(),u.pauseConstructionSimulation=()=>m.baseCompt.pauseFlyTo(),u.pauseFlyTo=u.pauseConstructionSimulation,u.pauseAnimation=u.pauseConstructionSimulation,u.resumeConstructionSimulation=()=>m.baseCompt.resumeFlyTo(),u.resumeAnimation=u.resumeConstructionSimulation,u.setComponentsVisibility=async g=>await m.baseCompt.setComponentVisibility(g),u.setElementsListVisible=u.setComponentsVisibility,u.setAllComponentsVisibility=async g=>await m.baseCompt.setAllComponentsVisibility(g),u.setAllElementsVisible=u.setAllComponentsVisibility,u.isolateComponents=g=>m.baseCompt.isolateComponentVisibility(g),u.isolateComponentVisibility=u.isolateComponents,u.getComponentsByVisibility=g=>m.baseCompt._getComponentsByVisibility(g),u.getShowCpts=g=>m.baseCompt.getComponentsByVisibility(g),u.getElementsVisible=g=>m.baseCompt.getComponentsByVisibility(g),u.setComponentVisibility=u.setComponentsVisibility,u.enableSectioning=(g,P)=>m.baseSection.open(g,P),u.openSection=u.enableSectioning,u.disableSectioning=g=>m.baseSection.close(g),u.closeSection=u.disableSectioning,u.updateSectionBox=g=>m.baseSection.updateRange(g),u.updateSectionRange=u.updateSectionBox,u.getSectionBox=()=>m.baseSection.getRange(),u.getSectionRange=u.getSectionBox,u.fitSectionToModel=()=>m.baseSection.fitToModels(),u.fitToModels=u.fitSectionToModel,u.setSectionBoxVisibility=g=>m.baseSection.setBoxVisibility(g),u.startFirstPersonMode=()=>{m.baseCompt.disableSelection(),m.basePlayer.openPlayer()},u.openPlayer=u.startFirstPersonMode,u.stopFirstPersonMode=()=>{m.basePlayer.closePlayer(),m.baseCompt.enableSelection()},u.closePlayer=u.stopFirstPersonMode,u.setPlayerPosition=g=>m.basePlayer.setPersonPosition(g),u.setPersonPosition=u.setPlayerPosition,u.setWalkSpeed=g=>m.basePlayer.setSpeed({speed:g}),u.setPlayerSpeed=u.setWalkSpeed,u.setPlayerConfig=g=>m.basePlayer.setParams(g),u.setPlayerParams=u.setPlayerConfig,u.setPlayerAction=(g,P)=>m.basePlayer.setMoveState(g,P),u.setPlayerMoveState=u.setPlayerAction,u.bindPlayerControls=g=>m.basePlayer.bindUiKeys(g),u.bindPlayerUiKeys=u.bindPlayerControls,u.setGlobeVisibility=g=>A.setGlobeEnvironmentVisible(g),u.setGlobeEnvironmentVisible=u.setGlobeVisibility,u.setTerrainVisibility=g=>A.setTerrainEnable(g),u.setTerrainEnable=u.setTerrainVisibility,u.setDepthTest=g=>A.setDepthTestEnable(g),u.setDepthTestEnable=u.setDepthTest,u.setBaseMap=(g,P)=>A.changeBaseMap(g,P),u.changeBaseMap=u.setBaseMap,u.setWorldTime=g=>A.setTime(g),u.setTime=u.setWorldTime,u.setGisOptions=g=>{g.globe!==void 0&&A.setGlobeEnvironmentVisible(g.globe),g.elevation!==void 0&&A.setTerrainEnable(g.elevation),g.depthTestAgainstTerrain!==void 0&&A.setDepthTestEnable(g.depthTestAgainstTerrain),g.rendering!==void 0&&A.setAmbientOcclusion(g.rendering)},u.setShadowVisibility=g=>A.setShadowsEnable(g),u.setShadowsEnable=u.setShadowVisibility,u.setEnvironmentMapVisibility=g=>A.setEnvironmentMapEnable(g),u.setEnvironmentMapEnable=u.setEnvironmentMapVisibility,u.setAOVisibility=g=>A.setAmbientOcclusion(g),u.setAmbientOcclusion=u.setAOVisibility,u.setBackgroundColor=g=>A.setGlobeColor(g),u.setGlobeColor=u.setBackgroundColor,u.setModelBrightness=g=>A.setModelBrightness(g),u.adjustModelColor=g=>A.setModelColorAdjustment(g),u.setModelColorAdjustment=u.adjustModelColor,u.setShadowIntensity=g=>{A.setShadowDarkness?A.setShadowDarkness(g):console.warn("baseSetting.setShadowDarkness is not available. Please reload the page.")},u.setShadowDarkness=u.setShadowIntensity,u.switchSceneMode=async g=>{const P=g?"2d":"3d";await A.setCadMode(P),g&&!S&&(S=new tl({cesium:a,viewer:p}),u.setGlobeVisibility(!0)),l.emit("setMode",P)},u.setSceneMode=u.switchSceneMode,u.set2d=g=>u.switchSceneMode(g),u.is2dMode=()=>A.is2d,u.setMouseControlMode=g=>A.setMouseHabit(g),u.setMouseHabit=u.setMouseControlMode,u.setCollisionEnabled=g=>A.setCollisionDetection(g),u.setCollisionDetection=u.setCollisionEnabled,u.searchAndLocate=(g,P)=>A.searchLocation(g,P),u.searchLocation=u.searchAndLocate,u.getConfigure=()=>(console.warn("getConfigure is not initialized. Please ensure LeitingSetting component is mounted."),{}),u.setConfigure=g=>{console.warn("setConfigure is not initialized. Please ensure LeitingSetting component is mounted.",g)},u.addCadModel=g=>{const P={...g};return P.files&&!P.fileNames&&(P.fileNames=P.files),P.fileNames||(P.fileNames=[]),C.addDxfModel(P)},u.addDxfModel=u.addCadModel,u.deleteCad=g=>C.deleteCad(g),u.deleteAllCad=()=>C.deleteAllCad(),u.showCadModel=g=>C.showJson(g),u.showGeoJson=g=>C.showJson(g),u.showDxfModel=u.showCadModel,u.showCadLayer=g=>C.showJsonByLayer(g),u.showDxfLayer=u.showCadLayer,u.flyToCadModel=(g={})=>C.flyToCadModel(g),u.getCadModels=g=>C.getDxfModels(g),u.getDxfModels=u.getCadModels,u.getCadLayers=g=>C.getMapLayers(g),u.getDxfLayers=u.getCadLayers,u.getCadModelId=()=>C.getModelId(),u.setCadOpen=g=>C.setDxfOpen(g),u.setDxfOpen=u.setCadOpen,u.getCadOpen=()=>C.getDxfOpen(),u.getDxfOpen=u.getCadOpen,u.adjustCadModel=g=>C.adjustingModelByCad(g),u.adjustingModelByCad=u.adjustCadModel,u.saveAnnotations=()=>{let g=null;return S&&(g=S.saveAnnotations()),o?.saveAnnotations&&o.saveAnnotations(g),g},u.loadAnnotations=g=>S?S.loadAnnotations(g):!1,u.flyToTopView=()=>{C.flyToCadModel()},u.menuEvents=l,u.addMenuItems=g=>{l.emit("insertMenu",g)},u.insertMenu=u.addMenuItems,u.filterMenuItems=g=>{l.emit("setMenuListFilter",g)},u.setMenuListFilter=u.filterMenuItems,u.setMenuVisibility=g=>{l.emit("showMenu",g)},u.showMenu=u.setMenuVisibility,u.setPanelVisibility=(g,P)=>{l.emit("setMenuActive",g,P)},u.setMenuActive=u.setPanelVisibility,u.addContextMenuItems=g=>{console.warn("addContextMenuItems is not initialized yet. Please wait for LeitingBIM component to mount.",g)},u.insertContextMenu=u.addContextMenuItems,u.removeContextMenuItems=g=>{console.warn("removeContextMenuItems is not initialized yet.",g)},u.deleteContextMenu=u.removeContextMenuItems,u.closeContextMenu=()=>{console.warn("closeContextMenu is not initialized yet.")},u.hideContextMenu=u.closeContextMenu,u.getModelTree=()=>{const g=[],P=w.getMapTileset();return Object.keys(P).forEach(x=>{const k=P[x];if(k&&k.leiting&&k.leiting.tree){const _=k.leiting.tree;Array.isArray(_)?g.push(..._):g.push(_)}}),g},u.getTree=u.getModelTree,u.getAllComponentDetails=()=>{const g=w.getMapTileset(),P={},x=[];try{Object.keys(g).forEach(k=>{const _=g[k];if(!_||!_.leiting)return;const G=_.leiting,F=G.node,E=G.model.formData,y=G.box;if(!F||!F.nodeExtras)return;const b=G.model.modelId;P[b]=F.nodeExtras;const T=F.nodeExtras.element;if(!T)return;const R=y?y.center:{x:0,y:0,z:0};Object.values(T).forEach(O=>{if(O.box3)try{const L=a.Quaternion.fromAxisAngle(a.Cartesian3.UNIT_Z,a.Math.toRadians(E.totalRotation||0)),M=a.Matrix4.fromRotationTranslation(a.Matrix3.fromQuaternion(L),new a.Cartesian3(0,0,0)),Q=a.Cartesian3.fromDegrees(E.longitude,E.latitude,E.height),Y=a.Transforms.eastNorthUpToFixedFrame(Q);a.Matrix4.multiply(Y,M,Y);const W=new a.Cartesian3(R.x,R.y,0),q=new a.Cartesian3;a.Matrix4.multiplyByPoint(Y,W,q);const Z=a.Cartographic.fromCartesian(q),oe=O.box3?.Center?.x||0,ne=O.box3?.Center?.y||0,se=O.box3?.Center?.z||0,pe=new a.Cartesian3(-R.x+oe,-R.y+ne,0+se),ve=a.Matrix4.fromTranslation(pe),V=a.Matrix4.clone(ve);a.Matrix4.multiply(M,V,V);const j=a.Cartesian3.fromDegrees(Z.longitude/Math.PI*180,Z.latitude/Math.PI*180,E.height),te=a.Transforms.eastNorthUpToFixedFrame(j);a.Matrix4.multiply(te,V,te);const Ae=a.Cartographic.fromCartesian(new a.Cartesian3(te[12],te[13],te[14]));O.box3.cartographic={longitude:Ae.longitude/Math.PI*180,latitude:Ae.latitude/Math.PI*180,height:Ae.height};const Ce={id:O.uniqueId,billboard:[{theme:"Tag9999",position:[O.box3.cartographic.longitude,O.box3.cartographic.latitude,O.box3.cartographic.height],options:{text:O.name}}]};x.push(Ce)}catch(L){console.warn("Error calculating component position:",L)}})})}catch(k){console.error("getAllComponents error:",k)}return P},u.getAllComponents=u.getAllComponentDetails,u.getComponentInfoList=async g=>{if(!Array.isArray(g))return[];const P=w.getMapTileset(),x=[],k=[],_={};if(g.forEach(F=>{const y=P[F.modelId]?.leiting?.model?.dbName;y&&F.elementId&&k.push({dbName:y,elementId:F.elementId,modelId:F.modelId})}),k.length>0)try{const F=k.map(b=>({dbName:b.dbName,elementId:b.elementId})),E=await Dr(F),y=Array.isArray(E)?E:E?.data;Array.isArray(y)&&y.forEach(b=>{if(b){const T=`${b.modelId}_${b.elementId}`;_[T]=b}})}catch(F){console.warn("API fetch component details failed, falling back to local data",F)}const G=new Set;if(g.forEach(F=>{const E=P[F.modelId],y=`${F.modelId}_${F.elementId}`;_[y]||E&&E.leiting&&!E.leiting?.node?.nodeExtras&&E.leiting.model?.nodeUrl&&G.add(F.modelId)}),G.size>0&&w._loadNodeDetailsForModel)try{const F=Array.from(G).map(E=>w._loadNodeDetailsForModel(E));await Promise.all(F)}catch(F){console.error("Failed to load node details in getComponentInfoList",F)}try{g.forEach(F=>{const E=F.modelId,y=F.elementId,b=P[E];if(!b||!b.leiting)return;const T=`${E}_${y}`,R=_[T];let O=null;if(R)O=R;else{const L=b.leiting.node?.nodeExtras?.element||b.leiting.node?.nodeExtras;L&&L[y]&&(O=JSON.parse(JSON.stringify(L[y])))}if(O){if(O.elementId=y,O.modelId=E,O.box3&&!O.box3.cartographic)try{const L=b.leiting,M=L.model.formData,Q=L.box,Y=Q?Q.center:{x:0,y:0,z:0},W=a.Quaternion.fromAxisAngle(a.Cartesian3.UNIT_Z,a.Math.toRadians(M.totalRotation||0)),q=a.Matrix4.fromRotationTranslation(a.Matrix3.fromQuaternion(W),new a.Cartesian3(0,0,0)),Z=a.Cartesian3.fromDegrees(M.longitude,M.latitude,M.height),oe=a.Transforms.eastNorthUpToFixedFrame(Z);a.Matrix4.multiply(oe,q,oe);const ne=new a.Cartesian3(Y.x,Y.y,0),se=new a.Cartesian3;a.Matrix4.multiplyByPoint(oe,ne,se);const pe=a.Cartographic.fromCartesian(se),ve=O.box3?.Center?.x||0,V=O.box3?.Center?.y||0,j=O.box3?.Center?.z||0,te=new a.Cartesian3(-Y.x+ve,-Y.y+V,0+j),Ae=a.Matrix4.fromTranslation(te),Ce=a.Matrix4.clone(Ae);a.Matrix4.multiply(q,Ce,Ce);const Me=a.Cartesian3.fromDegrees(pe.longitude/Math.PI*180,pe.latitude/Math.PI*180,M.height),Le=a.Transforms.eastNorthUpToFixedFrame(Me);a.Matrix4.multiply(Le,Ce,Le);const Ne=a.Cartographic.fromCartesian(new a.Cartesian3(Le[12],Le[13],Le[14]));O.box3.cartographic={longitude:Ne.longitude/Math.PI*180,latitude:Ne.latitude/Math.PI*180,height:Ne.height}}catch(L){console.warn("Error calculating component position:",L)}x.push(O)}})}catch(F){console.error("getComponentInfoList processing error:",F)}return x},u.getCptInfos=u.getComponentInfoList,u.baseCompt=m.baseCompt,u.setTeleportTarget=g=>{u.onSetTeleportTarget&&u.onSetTeleportTarget(g)},window.Methods=u}return console.log("methods",u),{Cesium:a,viewer:p,methods:u,menuEvents:l}}function Ms(i){return c.getCurrentScope()?(c.onScopeDispose(i),!0):!1}function Ds(i){return typeof i=="function"?i():c.unref(i)}const hy=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const uy=Object.prototype.toString,fy=i=>uy.call(i)==="[object Object]",py=()=>{};function gy(i){return c.getCurrentInstance()}function ol(i,e=!0,t){gy()?c.onMounted(i,t):e?i():c.nextTick(i)}function Tt(i){var e;const t=Ds(i);return(e=t?.$el)!=null?e:t}const Ai=hy?window:void 0;function my(...i){let e,t,n,s;if(typeof i[0]=="string"||Array.isArray(i[0])?([t,n,s]=i,e=Ai):[e,t,n,s]=i,!e)return py;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},l=(h,f,p,u)=>(h.addEventListener(f,p,u),()=>h.removeEventListener(f,p,u)),a=c.watch(()=>[Tt(e),Ds(s)],([h,f])=>{if(r(),!h)return;const p=fy(f)?{...f}:f;o.push(...t.flatMap(u=>n.map(m=>l(h,u,m,p))))},{immediate:!0,flush:"post"}),d=()=>{a(),r()};return Ms(d),d}function Ay(){const i=c.ref(!1),e=c.getCurrentInstance();return e&&c.onMounted(()=>{i.value=!0},e),i}function rl(i){const e=Ay();return c.computed(()=>(e.value,!!i()))}function yy(i,e={}){const{window:t=Ai}=e,n=rl(()=>t&&"matchMedia"in t&&typeof t.matchMedia=="function");let s;const o=c.ref(!1),r=d=>{o.value=d.matches},l=()=>{s&&("removeEventListener"in s?s.removeEventListener("change",r):s.removeListener(r))},a=c.watchEffect(()=>{n.value&&(l(),s=t.matchMedia(Ds(i)),"addEventListener"in s?s.addEventListener("change",r):s.addListener(r),o.value=s.matches)});return Ms(()=>{a(),l(),s=void 0}),o}function Cy(i,e,t={}){const{window:n=Ai,...s}=t;let o;const r=rl(()=>n&&"ResizeObserver"in n),l=()=>{o&&(o.disconnect(),o=void 0)},a=c.computed(()=>Array.isArray(i)?i.map(f=>Tt(f)):[Tt(i)]),d=c.watch(a,f=>{if(l(),r.value&&n){o=new ResizeObserver(e);for(const p of f)p&&o.observe(p,s)}},{immediate:!0,flush:"post"}),h=()=>{l(),d()};return Ms(h),{isSupported:r,stop:h}}function Ey(i,e={width:0,height:0},t={}){const{window:n=Ai,box:s="content-box"}=t,o=c.computed(()=>{var f,p;return(p=(f=Tt(i))==null?void 0:f.namespaceURI)==null?void 0:p.includes("svg")}),r=c.ref(e.width),l=c.ref(e.height),{stop:a}=Cy(i,([f])=>{const p=s==="border-box"?f.borderBoxSize:s==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(n&&o.value){const u=Tt(i);if(u){const m=u.getBoundingClientRect();r.value=m.width,l.value=m.height}}else if(p){const u=Array.isArray(p)?p:[p];r.value=u.reduce((m,{inlineSize:w})=>m+w,0),l.value=u.reduce((m,{blockSize:w})=>m+w,0)}else r.value=f.contentRect.width,l.value=f.contentRect.height},t);ol(()=>{const f=Tt(i);f&&(r.value="offsetWidth"in f?f.offsetWidth:e.width,l.value="offsetHeight"in f?f.offsetHeight:e.height)});const d=c.watch(()=>Tt(i),f=>{r.value=f?e.width:0,l.value=f?e.height:0});function h(){a(),d()}return{width:r,height:l,stop:h}}function wy(i={}){const{window:e=Ai,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,listenOrientation:s=!0,includeScrollbar:o=!0}=i,r=c.ref(t),l=c.ref(n),a=()=>{e&&(o?(r.value=e.innerWidth,l.value=e.innerHeight):(r.value=e.document.documentElement.clientWidth,l.value=e.document.documentElement.clientHeight))};if(a(),ol(a),my("resize",a,{passive:!0}),s){const d=yy("(orientation: portrait)");c.watch(d,()=>a())}return{width:r,height:l}}const by={class:"title"},vy={class:"actions"},Iy={class:"card-body"},By=c.defineComponent({__name:"LeitingDraggableCard",props:{visible:{type:Boolean,default:!0},open:{type:Boolean,default:void 0},title:{type:String,default:"Title"},initialPosition:{type:Object,default:()=>({x:0,y:0})},width:{type:[Number,String],default:300},minWidth:{type:Number,default:200},fullHeight:{type:Boolean,default:!1},align:{type:String,default:""}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=c.inject("leiting-theme",c.ref("dark")),s=e,o=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:D=>{s("update:visible",D),s("update:open",D)}}),r=c.ref(null),l=c.ref(t.initialPosition?.x||0),a=c.ref(t.initialPosition?.y||0),d=c.ref(t.width),h=c.ref(t.fullHeight?"100%":"600px");c.watch(()=>t.fullHeight,D=>{D?h.value="100%":h.value==="100%"&&(h.value="600px")});const{height:f}=wy();c.watch(f,()=>{t.fullHeight&&(h.value="100%")});const p=c.ref(!1),u=D=>{p.value=!0,D.preventDefault(),D.stopPropagation();const N=D.clientX,I=D.clientY,B=typeof d.value=="number"?d.value:r.value?.offsetWidth||0,g=typeof h.value=="number"?h.value:r.value?.offsetHeight||0,P=k=>{if(!p.value)return;k.preventDefault();const _=k.clientX-N,G=k.clientY-I,F=B+_,E=g+G;F>100&&(d.value=F),E>100&&(h.value=E)},x=()=>{p.value=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",x)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",x)},m=c.computed(()=>({left:`${l.value}px`,top:`${a.value}px`,width:typeof d.value=="number"?`${d.value}px`:d.value,height:typeof h.value=="number"?`${h.value}px`:h.value,position:"absolute",zIndex:2e3})),w=()=>{c.nextTick(()=>{if(r.value){const D=r.value.offsetParent||document.body,N=D.clientWidth,I=D.clientHeight,B=typeof d.value=="number"?d.value:r.value.offsetWidth||350,g=typeof h.value=="number"?h.value:r.value.offsetHeight||600;l.value+B>N&&(l.value=Math.max(0,N-B-20)),a.value+g>I&&(a.value=Math.max(0,I-g-20)),l.value<0&&(l.value=0),a.value<0&&(a.value=0)}})},A=c.ref(!1),C=D=>{if(D.target.closest(".close-btn")||D.target.closest(".actions"))return;A.value=!0,D.preventDefault(),D.stopPropagation();const N=D.clientX,I=D.clientY,B=l.value,g=a.value,P=k=>{if(!A.value)return;k.preventDefault();const _=k.clientX-N,G=k.clientY-I;l.value=B+_,a.value=g+G},x=()=>{A.value=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",x),w()};document.addEventListener("mousemove",P),document.addEventListener("mouseup",x)},v=()=>{c.nextTick(()=>{if(t.align&&r.value){const D=r.value.offsetParent||document.body,N=typeof d.value=="number"?d.value:r.value.offsetWidth||350;t.align==="right"?l.value=Math.max(0,D.clientWidth-N-20):t.align==="center"&&(l.value=Math.max(0,(D.clientWidth-N)/2))}w()})};c.onMounted(()=>{t.align?v():w()}),c.watch(o,D=>{D&&(t.align?v():w())});const S=()=>{o.value=!1,s("close")};return(D,N)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{ref_key:"cardRef",ref:r,class:c.normalizeClass(["draggable-card leiting-scroll",["leiting-theme-"+c.unref(n)]]),style:c.normalizeStyle(m.value)},[c.createElementVNode("div",{ref:"headerRef",class:"card-header",onMousedown:C},[c.createElementVNode("span",by,c.toDisplayString(i.title),1),c.createElementVNode("div",vy,[c.renderSlot(D.$slots,"header-extra",{},void 0,!0),c.createElementVNode("span",{class:"close-btn",onClick:S},"×")])],544),c.createElementVNode("div",Iy,[c.renderSlot(D.$slots,"default",{},void 0,!0)]),c.createElementVNode("div",{class:"resize-handle",onMousedown:u},[...N[0]||(N[0]=[c.createElementVNode("svg",{viewBox:"0 0 10 10",width:"10",height:"10",fill:"currentColor"},[c.createElementVNode("path",{d:"M10 10 L10 2 L2 10 Z"})],-1)])],32)],6)),[[c.vShow,o.value]])}}),Oe=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t},Pe=Oe(By,[["__scopeId","data-v-50bf6126"]]);function xy(i){const e=c.ref([]),t=c.ref([]),n=c.ref([]),s=c.ref(""),o=c.ref(!0);c.watch(()=>c.unref(i),f=>{if(!f||f.length===0)return;const p=[],u=(A,C)=>{A.forEach(v=>{const S=v.id||v.key||v.$id,D=v.modelId||C;D&&(v.modelId=D),S&&p.push(S),v.children&&v.children.length>0&&u(v.children,D)})};u(f);const m=new Set(n.value);let w=!1;p.forEach(A=>{m.has(A)||(m.add(A),w=!0)}),w&&(n.value=Array.from(m))},{immediate:!0,deep:!0});const r=c.computed(()=>{const f=c.unref(i);if(!f)return[];const p=[],u=(m,w)=>{m.forEach(A=>{const C=A.id||A.key||A.$id,v=A.name||A.title;p.push({key:C,title:v,parentKey:w}),A.children&&A.children.length>0&&u(A.children,C)})};return u(f),p}),l=f=>{e.value=f,o.value=!1},a=f=>{n.value=f},d=f=>{t.value=f},h=f=>r.value.find(u=>u.key===f)?.parentKey;return c.watch(s,f=>{if(!f)return;const u=r.value.filter(w=>w.title&&w.title.toLowerCase().includes(f.toLowerCase())).map(w=>w.parentKey),m=new Set;u.forEach(w=>{let A=w;for(;A;)m.add(A),A=h(A)}),e.value=[...m],o.value=!0}),{expandedKeys:e,selectedKeys:t,checkedKeys:n,searchValue:s,autoExpandParent:o,onExpand:l,onCheck:a,onSelect:d}}const Sy={class:"search-box"},Ty={key:0},My={style:{color:"#f50"}},Dy={key:1},ky={key:1,class:"empty-tip"},an=Oe(c.defineComponent({__name:"LeitingTree",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"构件树"},width:{type:[Number,String],default:320},treeData:{type:Array,default:()=>[]},initialPosition:{type:Object,default:()=>({x:0,y:0})},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close","select","check"],setup(i,{emit:e}){const t=ge.Input.Search,n=ge.Tree,s=i,o=e,r=c.inject("leiting-theme",c.ref("dark")),l=c.inject("leitingMethods"),a=x=>{l?.value?.onSearchComponent&&l.value.onSearchComponent(x)},d=c.computed({get:()=>s.open!==void 0?s.open:s.visible,set:x=>{o("update:visible",x),o("update:open",x)}}),h=c.ref(null),{height:f}=Ey(h),p=c.computed(()=>f.value||300),u=c.ref({children:"children",title:"name",key:"id"}),m=c.ref([]),{expandedKeys:w,selectedKeys:A,checkedKeys:C,searchValue:v,autoExpandParent:S}=xy(c.toRef(s,"treeData")),D=(x,k)=>{if(!k)return x;const _=k.toLowerCase();return x.reduce((G,F)=>{const y=(F.name||F.title||"").toLowerCase().includes(_);if(F.children&&F.children.length>0){const b=D(F.children,k);(b.length>0||y)&&G.push({...F,children:b})}else y&&G.push({...F});return G},[])};c.watch([()=>s.treeData,v],([x,k])=>{x?m.value=D(x,k||""):m.value=[]},{immediate:!0,deep:!0});const N=x=>{w.value=x,S.value=!1},I=x=>{const k=[],_=G=>{if(!G.children||G.children.length===0){const E=G.element_Id;G.modelId&&E&&k.push({modelId:G.modelId,elementId:E})}else G.children.forEach(_)};return _(x),k},B=(x,k)=>{C.value=x,o("check",x,k);const _=[],G=new Set(x.map(E=>String(E))),F=E=>{for(let y=0;y<E.length;y++){const b=E[y];if(!b.children||b.children.length===0){if(!G.has(String(b.id))){const O=b.element_Id;b.modelId&&O&&_.push({modelId:b.modelId,elementId:O,show:!1})}}else b.children&&F(b.children)}};s.treeData&&F(s.treeData),l?.value?.setComponentVisibility&&l.value.setComponentVisibility(_),l?.value?.onTreeCheck&&l.value.onTreeCheck(x,k)},g=(x,k)=>{if(A.value=x,o("select",x,k),k.selected){const _=I(k.node);_.length>0&&l?.value?.flyToObjects&&l.value.flyToObjects({selectCpts:_})}l?.value?.onTreeSelect&&l.value.onTreeSelect(x,k)},P=()=>{o("update:visible",!1),o("close")};return(x,k)=>(c.openBlock(),c.createBlock(Pe,{visible:d.value,"onUpdate:visible":k[1]||(k[1]=_=>d.value=_),title:i.title,"initial-position":i.initialPosition,"full-height":i.fullHeight,onClose:P},{default:c.withCtx(()=>[c.createElementVNode("div",{class:c.normalizeClass(["leiting-tree-container",[`theme-${c.unref(r)}`]])},[c.createElementVNode("div",Sy,[c.createVNode(c.unref(t),{value:c.unref(v),"onUpdate:value":k[0]||(k[0]=_=>c.isRef(v)?v.value=_:null),placeholder:"搜索构件","allow-clear":"","enter-button":"",onSearch:a},null,8,["value"])]),c.createElementVNode("div",{class:"tree-wrapper",ref_key:"treeWrapperRef",ref:h},[m.value&&m.value.length?(c.openBlock(),c.createBlock(c.unref(n),{key:0,"tree-data":m.value,"field-names":u.value,height:p.value,"expanded-keys":c.unref(w),"auto-expand-parent":c.unref(S),"selected-keys":c.unref(A),"checked-keys":c.unref(C),checkable:"","block-node":"",onExpand:N,onSelect:g,onCheck:B},{title:c.withCtx(({name:_,title:G})=>[(_||G)&&c.unref(v)&&(_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())>-1?(c.openBlock(),c.createElementBlock("span",Ty,[c.createTextVNode(c.toDisplayString((_||G).substr(0,(_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())))+" ",1),c.createElementVNode("span",My,c.toDisplayString(c.unref(v)),1),c.createTextVNode(" "+c.toDisplayString((_||G).substr((_||G).toLowerCase().indexOf(c.unref(v).toLowerCase())+c.unref(v).length)),1)])):(c.openBlock(),c.createElementBlock("span",Dy,c.toDisplayString(_||G),1))]),_:1},8,["tree-data","field-names","height","expanded-keys","auto-expand-parent","selected-keys","checked-keys"])):(c.openBlock(),c.createElementBlock("div",ky,"暂无数据"))],512)],2)]),_:1},8,["visible","title","initial-position","full-height"]))}}),[["__scopeId","data-v-3748c20d"]]),Py="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEhSURBVDhP1ZRhkcIwEIWJAsDBOTgkgAJAAYcCQAFFAUgoDjgFh4Q7B+cAUFC+19kyS0hL+Ulm3nS6+/ZLNkkbOk9GURRDWUIIxyZraEoCWZLfmmcOLK/z14KAqGiGvq14zDMHNk/BHkAAehh/0ABtKMxUSFzPNfpFI+JnD7wDYVaxIIov41bIfxHfoROakhe0HDeQmbQfFzTxJj+zTXYg1kWrarISRFKzLNAfGsbL9iDzq/0j+kQZ/k1wm7onoKW3Hq42F0jLVK//Tcebott2fJAbVK1lvKwBNd6rRIsFsfJka0G2qdpQPy7+EPC0AumexKAzoH5FbgvSbHuUW6EOYubbfwX0cLPfFJS4K6mPNrbdHb+uvP498dhVn4v9FWo9V3RZzFxAv8L9AAAAAElFTkSuQmCC",al="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAERSURBVDhPvZTrEYIwEISTCrQD6EA7gA60AylBK1Aq0A7ECrQDoQPsADrACuLuTMJkIiHxjzezgyR7H3d5KJVSqRAigcaQUjYYX2JgZY/P/O4lEgYYFo7pgPcc2kSCBoIUzDeo0klPPEsNYlX7AKzA/M6ASrRzYoIGG5DAOCvzBvzMOxqQazSgLLI1QdAW5jWpUAPV0AVKIc7FRCuNy7RkWozJtj1BED7ANbpDXHhffFXUwUnZwRYp7qw7Rx8/lLkV9R4QD2w1A8pjW3sA4h5au+pXEBS76P8D6Ut9/nXXaiRQdnBXqBfEC+4GdzSxW5v6F7CTeHnbCVCBsWIE+RYVrdF4DSz6OwgiADDexbmT3X0A4fSDfDjUugcAAAAASUVORK5CYII=",Fy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAFESURBVDhPlZMNEcIwDIVXBQwFgAJAAcMBDgAFIGE4wAHgABSwOdgcIAEUjPd6aS/rfhi7y12bJl9f0sxEf3xVVV0RPoetjTFvnWqGcgSylfgihA0CKcgJgBfsAqMiKiM0+gkKlCyZCN8uhPWCFOSBxARWORU4W2CdeV9XjxSEJcwkjokTqBpzjxjCn7CyVRECzjg8wHLYCmabK7CplBcLhMr2DZCqP0dCovYZ9hYGXx1izLUGUkkfxI/sTQiCf4N1zLWAWCKV2nP6PEhB2Ngd7B4GC4SJnCcP8SAFoc/Ph/TqjVvTPogFKUiJ/VGU+GdmUAA5ObA7cyC+iPt/MjUfKRL4emyuK+cGH8tufFRUHywZ+RYlnRDdIwfzLzVUibtQv1oNhoAExtfpVdIAiQIOWiY9o2sQxJemOydTS1jR1di2Zn8B8f27apou9kMAAAAASUVORK5CYII=",Ry="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAHDSURBVDhPlZOxL0NRFIe9ECubhehoIIjJ1HYwCkIiJpUQEkN1YZBobU0kFKNI3iTGYrDRv0BIhLXCYpCwiO35fs25zWva98JNvpz37j33d8+551yvLWIEQXDG0izMe55XjvJz816MUJG1LVuvYJcQrEb5xwkV2JSHGfAhgBJiu63E4oSUzpRtusa+wBooKkWnKOujQYh7SbCShQx0m9cpds4iOseOw7BFmUPwU341IQT2MaOQgi9QND+wiqNnBxT4X7SIbrAqhNI9wiUvJ+W8A99wDEWdwrw25iVkkenAEb5LkIQPuIMJWJGQoriFd+iBCkhc8zUhfJSm7mva5l3aadubDgtpMgGKpB/eoBfuQZFoPNhBj9gTaC3kKkEEGXPswF7Y5rLro1AW8UI6GmelmAzfkUWlNaWt6/iT0DOOA5bqoSuzHfIvofATqSJQb8KoiJbtPi6x2dA9FPjXE1F/uZKrv3IwCFcNqVmoPlal7QJ9q/wZCbk7Ioo9/tehE9q1r0nIxNQbG4YEXdkVjQ5J2OZXbB88gVrgQIJNj9aaT4LboPK7J6O0Ktb1KYtc/aYxGff6h3AYY6Nvzk2GQ1WQTVj4BST70jYaqceXAAAAAElFTkSuQmCC",Oy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADhSURBVHgBvVOBEYIwDEw9B2ADO4IjuIEjwAa6Aa7ABMAEuIIjOIFsUDao37vgxVZbBI+/+0tI0+fJBaIIrLUFaMAHmNNcsMAIE+vdJLQykQ+0wFHBrsyiT/sL2I1DDTac/+4Klzobov7WHxt29qGmaYaQnlhLCmUTa2l4C2ljvamFlEvY0xpCW/kA924GblfGWciZaJyXQvSmlOoDITSdXQBbcA8eKfy/nHDFeY470FIX8tzUIu84FmLWuTzz7yhRLPm54dKJ4+A5uoJ3HgHBUfUmxGIa4QDuKA4n3kLk9ZInw0qu5b1R1aYAAAAASUVORK5CYII=",Ly="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAADFSURBVDhPxVPBDYMwDIwnKJu0G9ANYJMyQrsBbNIRGAE2gEnSO6mpIMJxkBC1lEds52zfOeK9b51zV5wte4lIr8RWbgGQh2fGmaIHJe4EetKPtDpRcA5AvwcB7FtgCcTOH0p3YzaQNd75QBiVXJG3LRtCRyQ6Jvsekd3gTsJVoDcihZLQQjXGTRMzIzPhOCCQyNYvSuEue7Qdm02yK0u1nM2m/FQyKb8JZHH+l81Ofdpdm82tvikjThyNlbSEBvIPFj+MfwA76qSYUG3g9QAAAABJRU5ErkJggg==",Ny="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAEcSURBVDhPrZSNDYIwEIXpBOIGjMAIOIE4AbgBGwAbOIJu4Aa4gW4gI+gE9b3mjjSmibSR5ALX3H33W4y1Ns+yrIe0EH7HPC8YnyGjAegkEB5cYyiwrdWXIEc1xnSREGcuiTQEWeg7gG4+CMcl9ALnLkvogwScv+wq6FMQJJCJDgBtBcSAI3QClwe2YZAHcY2Ho4kGAVLA6U5/CEvdp4KYhesFhBPpCZIAz6jStHhproJcHyAHbb5nF+6RZ8CsGslIQaHp/gSxRzlApU4GugPxNuDN/eNarAJxapUPgm8rQ9C1SAI9AOGiHhGApSdnRN8FshbEiLwiLI1rMUM6zSQ0tX9c2lp/Iw0iMIPU38iFIN1mTmOjKa98vyWB4QM5XQnvsbFsyAAAAABJRU5ErkJggg==",_y="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARzQklUCAgICHwIZIgAAAGPSURBVDhPrZT9UQIxEMUvFSgViBUoFQgVABV4VqBW4FmBUIFQgZRwVqBU4HUAVHC+X2aXycQw/sPOvLncZvdlv5JQFaTv+1upp8IyhLDHRLpLfe6FrXRt7hZShYyH+n8RauGAv/AkQNYIHICshFcRdu6fE/kGRN/mQGTIpzAzMoh6EV2fIsJ5IwNOj2IpVZ6i6difSecRVnlELZHIgHROisgXRCa78Z+IrMBf2pjLYJNENGSd1kO2pPghjKQniyqY8lFr2NfaqC18wn7nZCMlWg7xLq70TxfRLyHqtABN2lbp40mSSCzBcSebif1TPyKjDBcQ0eJJRkIUpHkMPUlnkBU+pnlWItL6ERgw8o1iqRHtgzAUGNRD2qmkvgMvNnneUQcZ4ggR6VGXG+OOA1koNvrFcY7+af++VJe0hucfyKQu+RWJc+SDZ3aNvlPpRl7T0qXdafNZYPDehLEZt/rOBR9U8QSaEKX0jHAaE4tshVrgLeJ+Xdl6rS8D3BWJXKnCEwWXEuco9grQ3bb0sP0Cn8/nPm/SMRQAAAAASUVORK5CYII=",Uy="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAACDSURBVHgB1ZFhDYAgEIWfzgBGIIINpIEViGAkG2gEbWADjWADfMw/iDgUfji/7e3gxt3uHsDXZFrrlrFBHJNpsPAgEEmORArn3lFroEZQCjcTbAhzepPsgbuCgn8FBWvsUAMfFR5OIPGS5G80JkrG2sopHKbO1BCoHy8ZNhRUT5X4BTu6qyNSwwCiMAAAAABJRU5ErkJggg==",Qy={class:"menu-container"},Gy=["onClick","title"],Hy={class:"menu-icon"},Yy=["src","alt"],Vy={key:3,style:{"font-size":"12px"}},zy={key:0,class:"sub-menu"},Wy=["onClick"],yi=c.defineComponent({__name:"LeitingMenu",props:{visible:{type:Boolean,default:!0},activeIds:{type:Array,default:()=>[]},is2d:{type:Boolean,default:!1},customItems:{type:Array,default:()=>[]}},emits:["action"],setup(i,{emit:e}){const t=i,n=c.inject("leiting-theme",c.ref("dark")),s=c.inject("leiting-menu-size",c.ref("medium")),o=c.inject("leitingMethods",c.ref({})),r=c.computed(()=>n.value||n),l=c.computed(()=>s.value||s),a=c.ref([{ID:"home",title:"主视角",src:Py,key:"homeView"},{ID:"tree",title:"目录树",src:al,key:"componentTree"},{ID:"cadLayer",title:"图层",src:al,key:"cadLayer"},{ID:"measure",title:"量算",src:Fy,key:"measurement"},{ID:"section",title:"剖切",src:Ry,key:"section"},{ID:"roam",title:"人物漫游",src:Oy,key:"roam"},{ID:"info",title:"构件信息",src:Ly,key:"componentInfo"},{ID:"cadPosition",title:"调整位置",src:Ny,key:"cadPosition"},{ID:"annotation",title:"标注",src:Uy,key:"annotation"},{ID:"setting",title:"设置",src:_y,key:"setting"}]),d=c.ref([]),h=c.ref([...t.activeIds]);c.watch(()=>t.activeIds,D=>{h.value=[...D]},{deep:!0});const f=c.computed(()=>t.visible);o.value&&o.value.menuEvents&&(o.value.menuEvents.on("setMenuListFilter",D=>{d.value=D}),o.value.menuEvents.on("setMenuActive",(D,N)=>{N?h.value.includes(D)||h.value.push(D):h.value=h.value.filter(I=>I!==D)}));const p=c.computed(()=>{let D=a.value;if(t.is2d){const N=["homeView","measurement","cadLayer","annotation"];D=D.filter(I=>I.key&&N.includes(I.key))}else{const N=["cadLayer","cadPosition","annotation"];D=D.filter(I=>!I.key||!N.includes(I.key))}if(d.value.length>0&&(D=D.filter(N=>!N.key||!d.value.includes(N.key))),t.customItems&&t.customItems.length>0){const N=t.customItems.map(I=>({...I,key:I.ID,src:I.src||I.icon}));return[...D,...N]}return D}),u=e,m=D=>{const N=["homeView"];if(D.key&&N.includes(D.key))h.value.includes(D.ID)||(h.value.push(D.ID),setTimeout(()=>{const B=h.value.indexOf(D.ID);B>-1&&h.value.splice(B,1)},1e3));else{const B=h.value.indexOf(D.ID);B>-1?h.value.splice(B,1):h.value.push(D.ID)}const I=h.value.includes(D.ID);D.func&&D.func(D),D.key&&u("action",D.key,I)},w=D=>{d.value=D},A=D=>{console.log("LeitingMenu received showMenu event:",D)},C=(D,N)=>{const I=p.value.find(B=>B.ID===D||B.key===D);if(I){const B=h.value.indexOf(I.ID);N&&B===-1?h.value.push(I.ID):!N&&B>-1&&h.value.splice(B,1)}};let v=null;const S=()=>{o.value?.menuEvents&&(v&&(v.off("setMenuListFilter",w),v.off("showMenu",A),v.off("setMenuActive",C)),v=o.value.menuEvents,v.on("setMenuListFilter",w),v.on("showMenu",A),v.on("setMenuActive",C))};return c.onMounted(()=>{S()}),c.onUnmounted(()=>{v&&(v.off("setMenuListFilter",w),v.off("showMenu",A),v.off("setMenuActive",C))}),c.watch(o,()=>{S()},{deep:!0}),(D,N)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["leiting-menu-wrapper",["leiting-theme-"+r.value,"size-"+l.value]])},[c.createElementVNode("div",Qy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.value,I=>(c.openBlock(),c.createElementBlock("div",{key:I.ID,class:c.normalizeClass(["menu-item",{active:h.value.includes(I.ID)}]),onClick:B=>m(I),title:I.title},[c.createElementVNode("div",Hy,[I.src?(c.openBlock(),c.createElementBlock("img",{key:0,src:I.src,alt:I.title},null,8,Yy)):typeof I.icon=="object"?(c.openBlock(),c.createBlock(c.resolveDynamicComponent(I.icon),{key:1})):typeof I.icon=="string"?(c.openBlock(),c.createElementBlock("i",{key:2,class:c.normalizeClass(["iconfont",`icon-${I.icon}`])},null,2)):(c.openBlock(),c.createElementBlock("span",Vy,c.toDisplayString(I.title.substring(0,2)),1))]),I.children&&I.children.length>0?(c.openBlock(),c.createElementBlock("div",zy,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.children,B=>(c.openBlock(),c.createElementBlock("div",{key:B.ID,class:c.normalizeClass(["sub-menu-item",{active:h.value.includes(B.ID)}]),onClick:c.withModifiers(g=>m(B),["stop"])},c.toDisplayString(B.title),11,Wy))),128))])):c.createCommentVNode("",!0)],10,Gy))),128))])],2)),[[c.vShow,f.value]])}}),jy={class:"leiting-section-content"},Ky={class:"section-form-item"},$y={class:"radio-group"},Xy={class:"section-form-item"},qy={class:"switch-container"},Jy={class:"switch"},Zy={class:"status-text"},e0={class:"section-form-item slider-item"},t0={class:"slider-wrapper"},i0={class:"section-form-item slider-item"},n0={class:"slider-wrapper"},s0={class:"section-form-item slider-item"},o0={class:"slider-wrapper"},r0={class:"section-form-item table-item"},a0={class:"model-table-container"},l0={class:"model-table"},c0={width:"40"},d0=["checked"],h0=["onClick"],u0=["value"],f0={class:"model-name"},Ci=Oe(c.defineComponent({__name:"LeitingSection",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"剖切控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:F=>{n("update:visible",F),n("update:open",F)}}),r=c.ref("Box"),l=c.ref(!1),a=c.ref([]),d=c.ref([]),h=c.computed(()=>d.value.length===0?!1:d.value.every(F=>a.value.includes(F.modelId))),f=F=>{F.target.checked?a.value=d.value.map(y=>y.modelId):a.value=[],P()},p=c.ref([-10,10]),u=c.ref([-10,10]),m=c.ref([-10,10]),w=c.ref([-100,100]),A=c.ref([-100,100]),C=c.ref([-100,100]);let v=!1;const S=F=>{v=!0;const{targetZPlus:E,targetZMinus:y,targetXPlus:b,targetXMinus:T,targetYPlus:R,targetYMinus:O}=F;m.value=[-y,E],p.value=[-T,b],u.value=[-O,R],setTimeout(()=>{v=!1},100)},D=()=>{v||a.value.length===0||!s?.value?.updateSectionRange||s.value.updateSectionRange({targetZPlus:m.value[1],targetZMinus:-m.value[0],targetXPlus:p.value[1],targetXMinus:-p.value[0],targetYPlus:u.value[1],targetYMinus:-u.value[0]})},N=()=>{s?.value?.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)},I=F=>{if(!s?.value?.getMapTileset||!s?.value?.openSection)return;const y=s.value.getMapTileset()[F];if(y&&y.leiting?.box){const{min:b,max:T}=y.leiting.box,R=(T.x-b.x)/2,O=(T.y-b.y)/2,L=(T.z-b.z)/2;a.value.length<=1&&(w.value=[-R*2,R*2],A.value=[-O*2,O*2],C.value=[-L*2,L*2],p.value=[-R,R],u.value=[-O,O],m.value=[-L,L],s.value.updateSectionRange&&s.value.updateSectionRange({targetZPlus:L,targetZMinus:L,targetXPlus:R,targetXMinus:R,targetYPlus:O,targetYMinus:O})),s.value.openSection(F,{moveCallBack:S}),s.value.setSectionBoxVisibility&&s.value.setSectionBoxVisibility(l.value)}},B=F=>{const E=a.value.indexOf(F);E>-1?a.value.splice(E,1):a.value.push(F),P()};let g=[];const P=()=>{const F=a.value.filter(y=>!g.includes(y)),E=g.filter(y=>!a.value.includes(y));F.forEach(y=>I(y)),E.forEach(y=>{s?.value?.closeSection&&s.value.closeSection(y)}),g=[...a.value]},x=()=>{},k=()=>{o.value=!1,n("close")},_=()=>{l.value=!1,a.value=[],g=[],p.value=[-10,10],u.value=[-10,10],m.value=[-10,10],w.value=[-100,100],A.value=[-100,100],C.value=[-100,100]};c.watch(()=>t.visible,F=>{F?G():(s?.value?.closeSection&&s.value.closeSection(),_())});const G=()=>{s?.value&&typeof s.value.getModelList=="function"&&(d.value=s.value.getModelList()||[],d.value.length>0&&a.value.length===0&&(a.value=[d.value[0].modelId],g=[...a.value]),t.visible&&a.value.length>0&&(l.value=!0,a.value.forEach(F=>I(F))))};return c.watch(()=>s?.value,()=>{G()},{immediate:!0,deep:!0}),c.onMounted(()=>{G()}),(F,E)=>(c.openBlock(),c.createBlock(Pe,{visible:o.value,title:"剖切分析","full-height":i.fullHeight,"onUpdate:visible":k},{default:c.withCtx(()=>[c.createElementVNode("div",jy,[c.createElementVNode("div",Ky,[E[8]||(E[8]=c.createElementVNode("span",{class:"label"},"模式",-1)),c.createElementVNode("div",$y,[c.createElementVNode("label",{class:c.normalizeClass(["radio-item",{active:r.value==="Box"}])},[c.withDirectives(c.createElementVNode("input",{type:"radio",value:"Box","onUpdate:modelValue":E[0]||(E[0]=y=>r.value=y),onChange:x},null,544),[[c.vModelRadio,r.value]]),E[7]||(E[7]=c.createTextVNode(" 剖切盒 ",-1))],2)])]),c.createElementVNode("div",Xy,[E[10]||(E[10]=c.createElementVNode("span",{class:"label"},"显示",-1)),c.createElementVNode("div",qy,[c.createElementVNode("label",Jy,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":E[1]||(E[1]=y=>l.value=y),onChange:N},null,544),[[c.vModelCheckbox,l.value]]),E[9]||(E[9]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",Zy,c.toDisplayString(l.value?"显示":"隐藏"),1)])]),c.createElementVNode("div",e0,[E[11]||(E[11]=c.createElementVNode("span",{class:"label"},"X 轴",-1)),c.createElementVNode("div",t0,[c.createVNode(c.unref(ge.Slider),{value:p.value,"onUpdate:value":E[2]||(E[2]=y=>p.value=y),range:"",min:w.value[0],max:w.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",i0,[E[12]||(E[12]=c.createElementVNode("span",{class:"label"},"Y 轴",-1)),c.createElementVNode("div",n0,[c.createVNode(c.unref(ge.Slider),{value:u.value,"onUpdate:value":E[3]||(E[3]=y=>u.value=y),range:"",min:A.value[0],max:A.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",s0,[E[13]||(E[13]=c.createElementVNode("span",{class:"label"},"Z 轴",-1)),c.createElementVNode("div",o0,[c.createVNode(c.unref(ge.Slider),{value:m.value,"onUpdate:value":E[4]||(E[4]=y=>m.value=y),range:"",min:C.value[0],max:C.value[1],step:.1,onChange:D},null,8,["value","min","max"])])]),c.createElementVNode("div",r0,[E[15]||(E[15]=c.createElementVNode("span",{class:"label"},"模型",-1)),c.createElementVNode("div",a0,[c.createElementVNode("table",l0,[c.createElementVNode("thead",null,[c.createElementVNode("tr",null,[c.createElementVNode("th",c0,[c.createElementVNode("input",{type:"checkbox",checked:h.value,onChange:f},null,40,d0)]),E[14]||(E[14]=c.createElementVNode("th",null,"名称",-1))])]),c.createElementVNode("tbody",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(d.value,y=>(c.openBlock(),c.createElementBlock("tr",{key:y.modelId,class:c.normalizeClass({selected:a.value.includes(y.modelId)}),onClick:b=>B(y.modelId)},[c.createElementVNode("td",null,[c.withDirectives(c.createElementVNode("input",{type:"checkbox",value:y.modelId,"onUpdate:modelValue":E[5]||(E[5]=b=>a.value=b),onClick:E[6]||(E[6]=c.withModifiers(()=>{},["stop"])),onChange:P},null,40,u0),[[c.vModelCheckbox,a.value]])]),c.createElementVNode("td",f0,c.toDisplayString(y.modelName),1)],10,h0))),128))])])])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-ee4d9a12"]]),p0={class:"leiting-player-content"},g0={class:"player-form-item"},m0={class:"switch-container"},A0={class:"switch"},y0={class:"status-text"},C0={class:"player-form-item"},E0={class:"switch-container"},w0={class:"switch"},b0={class:"status-text"},v0={class:"player-form-item"},I0={class:"switch-container"},B0={class:"switch"},x0={class:"status-text"},S0={class:"player-form-item slider-item"},T0={class:"slider-wrapper"},M0={class:"value-text"},D0={class:"instructions"},k0={class:"key-map"},P0={class:"key-row"},F0={class:"key-row"},R0={class:"key-row"},O0={class:"key-row"},L0={class:"key-row"},N0={class:"key-row"},Ei=Oe(c.defineComponent({__name:"LeitingPlayer",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},title:{type:String,default:"漫游控制"},fullHeight:{type:Boolean,default:!1}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref(!1),r=c.ref(!1),l=c.ref(!0),a=c.ref(5),d=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:I=>{n("update:visible",I),n("update:open",I)}}),h=c.ref(null),f=c.ref(null),p=c.ref(null),u=c.ref(null),m=c.ref(null),w=c.ref(null),A=()=>{o.value?v():S()},C=()=>{s?.value?.setPlayerParams&&s.value.setPlayerParams({gravityTest:r.value,collisionTest:l.value})},v=async()=>{s?.value?.openPlayer&&(await s.value.openPlayer(),s.value.setPlayerSpeed&&s.value.setPlayerSpeed(a.value),C(),s.value.bindPlayerUiKeys&&(await c.nextTick(),s.value.bindPlayerUiKeys({moveFront:h.value,moveBack:f.value,moveLeft:p.value,moveRight:u.value,moveUp:m.value,moveDown:w.value})))},S=()=>{s?.value?.closePlayer&&s.value.closePlayer()},D=()=>{s?.value?.setPlayerSpeed&&s.value.setPlayerSpeed(a.value)},N=()=>{d.value=!1,n("close")};return c.watch(()=>t.visible,I=>{I?(o.value=!0,s?.value?v():setTimeout(()=>{s?.value&&v()},100)):o.value&&(o.value=!1,S())},{immediate:!0}),(I,B)=>(c.openBlock(),c.createBlock(Pe,{title:i.title,visible:d.value,"full-height":i.fullHeight,"onUpdate:visible":N},{default:c.withCtx(()=>[c.createElementVNode("div",p0,[c.createElementVNode("div",g0,[B[5]||(B[5]=c.createElementVNode("span",{class:"label"},"启用",-1)),c.createElementVNode("div",m0,[c.createElementVNode("label",A0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[0]||(B[0]=g=>o.value=g),onChange:A},null,544),[[c.vModelCheckbox,o.value]]),B[4]||(B[4]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",y0,c.toDisplayString(o.value?"开启":"关闭"),1)])]),c.createElementVNode("div",C0,[B[7]||(B[7]=c.createElementVNode("span",{class:"label"},"重力",-1)),c.createElementVNode("div",E0,[c.createElementVNode("label",w0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[1]||(B[1]=g=>r.value=g),onChange:C},null,544),[[c.vModelCheckbox,r.value]]),B[6]||(B[6]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",b0,c.toDisplayString(r.value?"开启":"关闭"),1)])]),c.createElementVNode("div",v0,[B[9]||(B[9]=c.createElementVNode("span",{class:"label"},"碰撞",-1)),c.createElementVNode("div",I0,[c.createElementVNode("label",B0,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":B[2]||(B[2]=g=>l.value=g),onChange:C},null,544),[[c.vModelCheckbox,l.value]]),B[8]||(B[8]=c.createElementVNode("span",{class:"slider round"},null,-1))]),c.createElementVNode("span",x0,c.toDisplayString(l.value?"开启":"关闭"),1)])]),c.createElementVNode("div",S0,[B[10]||(B[10]=c.createElementVNode("span",{class:"label"},"速度",-1)),c.createElementVNode("div",T0,[c.createVNode(c.unref(ge.Slider),{value:a.value,"onUpdate:value":B[3]||(B[3]=g=>a.value=g),min:1,max:10,step:1,onChange:D},null,8,["value"])]),c.createElementVNode("span",M0,c.toDisplayString(a.value),1)]),B[19]||(B[19]=c.createElementVNode("div",{class:"divider"},null,-1)),c.createElementVNode("div",D0,[B[18]||(B[18]=c.createElementVNode("div",{class:"instruction-title"},"操作说明",-1)),c.createElementVNode("div",k0,[c.createElementVNode("div",P0,[c.createElementVNode("span",{class:"key",ref_key:"btnFront",ref:h},"W",512),B[11]||(B[11]=c.createTextVNode(" 前进 ",-1))]),c.createElementVNode("div",F0,[c.createElementVNode("span",{class:"key",ref_key:"btnBack",ref:f},"S",512),B[12]||(B[12]=c.createTextVNode(" 后退 ",-1))]),c.createElementVNode("div",R0,[c.createElementVNode("span",{class:"key",ref_key:"btnLeft",ref:p},"A",512),B[13]||(B[13]=c.createTextVNode(" 左移 ",-1))]),c.createElementVNode("div",O0,[c.createElementVNode("span",{class:"key",ref_key:"btnRight",ref:u},"D",512),B[14]||(B[14]=c.createTextVNode(" 右移 ",-1))]),c.createElementVNode("div",L0,[c.createElementVNode("span",{class:"key",ref_key:"btnUp",ref:m},"Q",512),B[15]||(B[15]=c.createTextVNode(" 上升 ",-1))]),c.createElementVNode("div",N0,[c.createElementVNode("span",{class:"key",ref_key:"btnDown",ref:w},"E",512),B[16]||(B[16]=c.createTextVNode(" 下降 ",-1))]),B[17]||(B[17]=c.createElementVNode("div",{class:"key-row"},[c.createElementVNode("span",{class:"mouse-icon"},"🖱️"),c.createTextVNode(" 按住左键拖拽旋转视角 ")],-1))])])])]),_:1},8,["title","visible","full-height"]))}}),[["__scopeId","data-v-ff3f266e"]]),_0={class:"info-content"},U0={key:0,class:"component-title"},wi=Oe(c.defineComponent({__name:"LeitingInfo",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref([]),r=c.ref(!1),l=c.ref([]),a=c.ref([]),d=c.ref(0),h=c.computed({get:()=>t.open!==void 0?t.open:t.visible,set:C=>{n("update:visible",C),n("update:open",C)}}),f=()=>{h.value=!1},p=C=>({elementID:"构件ID",elementName:"构件名",categoryName:"类别",familySymbolName:"族类型",levelName:"标高",modelName:"文件名",length:"长",width:"宽",height:"高"})[C]||C,u=["elementName","elementID","modelName","length","width","height","levelName","categoryName","familySymbolName"],m=async C=>{const v=++d.value;if(a.value=C,!C||C.length===0){o.value=[];return}if(!h.value)return;let S=C;C.length>10&&(fe.warning(`选中构件数量过多(${C.length}个),仅显示前10个`),S=C.slice(0,10));const D=s?.value;let N=D?.getMapTileset?D.getMapTileset():{};r.value=!0;const I=[],B={};if(S.forEach(x=>{const _=N[x.modelId]?.leiting?.model?.dbName;_&&x.elementId&&I.push({dbName:_,elementId:x.elementId,modelId:x.modelId})}),I.length>0){try{const x=I.map(G=>({dbName:G.dbName,elementId:G.elementId})),k=await Dr(x),_=Array.isArray(k)?k:k?.data;_&&Array.isArray(_)&&_.forEach(G=>{if(G){const F=`${G.modelId}_${G.elementId}`;B[F]=G}})}catch(x){console.warn("API fetch component details failed, falling back to local data",x)}console.log("123")}const g=new Set;if(S.forEach(x=>{const k=N[x.modelId],_=`${x.modelId}_${x.elementId}`;B[_]||k&&k.leiting&&!k.leiting?.node?.nodeExtras&&k.leiting.model?.nodeUrl&&g.add(x.modelId)}),g.size>0&&D?._loadNodeDetailsForModel)try{const x=Array.from(g).map(k=>D._loadNodeDetailsForModel(k));await Promise.all(x)}catch(x){console.error("Failed to load node details",x)}if(v!==d.value)return;N=D?.getMapTileset?D.getMapTileset():{};const P=[];S.forEach((x,k)=>{const G=N[x.modelId]?.leiting||{},F=B[`${x.modelId}_${x.elementId}`];let E={modelName:G.model?.modelId||x.modelId};E.elementID||(E.elementID=x.elementId);let y=null;if(F)y=F;else{const R=G.node?.nodeExtras?.element||G.node?.nodeExtras;if(R){const O=E.elementID;R[O]&&(y=R[O])}}y&&y.box3&&(E.length=`${y.box3.length?.toFixed(2)||0}米`,E.width=`${y.box3.width?.toFixed(2)||0}米`,E.height=`${y.box3.height?.toFixed(2)||0}米`);const b=[];y&&(y.name&&(E.elementName=y.name),y.categoryName&&(E.categoryName=y.categoryName),y.familySymbolName&&(E.familySymbolName=y.familySymbolName),y.levelName&&(E.levelName=y.levelName));const T={};if(u.forEach(R=>{E[R]!==void 0&&(T[R]=E[R])}),b.push({name:"基础信息",params:T}),y){const R=Array.isArray(y)?y:Array.isArray(y?.parameters)?y.parameters:null;if(R){if(R.flat().forEach(L=>{if(L&&L.GroupName&&Array.isArray(L.Parameters)){const M={};L.Parameters.forEach(Q=>{Q.name&&(M[Q.name]=Q.value??"")}),Object.keys(M).length>0&&b.push({name:L.GroupName,params:M})}}),!Array.isArray(y)){const{parameters:L,...M}=y,Q={};Object.keys(M).forEach(Y=>{!u.includes(Y)&&Y!=="uniqueId"&&typeof M[Y]!="object"&&(Q[Y]=M[Y])}),Object.keys(Q).length>0&&b.push({name:"其他属性",params:Q})}}else{let O=!1;if(Object.keys(y).forEach(L=>{y[L]&&typeof y[L]=="object"&&!Array.isArray(y[L])&&(O=!0,b.push({name:L,params:y[L]}))}),!O){const L={};Object.keys(y).forEach(M=>{if(!u.includes(M)&&M!=="batchId"){const Q=y[M];typeof Q=="string"&&Q.length>500?L[M]=Q.substring(0,500)+"...":L[M]=Q}}),Object.keys(L).length>0&&b.push({name:"属性",params:L})}}}P.push({id:k,title:`${E.modelName}${E.elementName?` - ${E.elementName}`:""}`,groups:b})}),o.value=P,v===d.value&&(r.value=!1),P.length>0?l.value=[`${P[0].id}-基础信息`]:l.value=[]};let w=!1;const A=()=>{if(w)return;const C=s?.value;C&&C.selectionChange&&(C.selectionChange(m),w=!0)};return c.watch(()=>s?.value,()=>{A()},{deep:!0,immediate:!0}),c.watch(h,C=>{C&&a.value.length>0&&m(a.value)}),c.onMounted(()=>{A()}),(C,v)=>(c.openBlock(),c.createBlock(Pe,{visible:h.value,title:"构件详情",width:350,align:"right","initial-position":{x:0,y:0},"full-height":i.fullHeight,onClose:f,"onUpdate:visible":v[1]||(v[1]=S=>h.value=S),class:"base-info-card"},{default:c.withCtx(()=>[c.createElementVNode("div",_0,[c.createVNode(c.unref(ge.Spin),{spinning:r.value},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.value,S=>(c.openBlock(),c.createElementBlock("div",{key:S.id,class:"component-block"},[o.value.length>1?(c.openBlock(),c.createElementBlock("div",U0,c.toDisplayString(S.title),1)):c.createCommentVNode("",!0),c.createVNode(c.unref(ge.Collapse),{activeKey:l.value,"onUpdate:activeKey":v[0]||(v[0]=D=>l.value=D),ghost:"","expand-icon-position":"end"},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(S.groups,D=>(c.openBlock(),c.createBlock(c.unref(ge.CollapsePanel),{key:`${S.id}-${D.name}`,header:D.name},{default:c.withCtx(()=>[c.createVNode(c.unref(ge.Descriptions),{size:"small",bordered:"",column:1,labelStyle:{width:"100px",background:"rgba(255,255,255,0.05)",color:"#aaa"},contentStyle:{color:"#fff"}},{default:c.withCtx(()=>[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(D.params,(N,I)=>(c.openBlock(),c.createBlock(c.unref(ge.DescriptionsItem),{key:I,label:p(String(I))},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(N),1)]),_:2},1032,["label"]))),128))]),_:2},1024)]),_:2},1032,["header"]))),128))]),_:2},1032,["activeKey"])]))),128))]),_:1},8,["spinning"])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-1fb90635"]]);class ll{viewer;Cesium;pickHandler=null;bimEntityId="";mapEntityId="";constructor(e,t){this.viewer=e,this.Cesium=t}removeMarker(e){if(!this.viewer)return;const t=e==="BIM"?this.bimEntityId:this.mapEntityId;t&&(this.viewer.entities.removeById(t),e==="BIM"?this.bimEntityId="":this.mapEntityId="")}clearMarkers(){this.removeMarker("BIM"),this.removeMarker("MAP")}addMarker(e,t){if(!this.viewer||!this.Cesium)return;this.removeMarker(e);const n=`adjust-marker-${e}-${Date.now()}`;e==="BIM"?this.bimEntityId=n:this.mapEntityId=n,this.viewer.entities.add({id:n,position:this.Cesium.Cartesian3.fromDegrees(t.longitude,t.latitude,t.height),point:{pixelSize:10,color:e==="BIM"?this.Cesium.Color.RED:this.Cesium.Color.ORANGE,outlineColor:this.Cesium.Color.WHITE,outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:`${e==="BIM"?"BIM":"地图"}标记点`,font:"14pt sans-serif",style:this.Cesium.LabelStyle.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:this.Cesium.VerticalOrigin.BOTTOM,pixelOffset:new this.Cesium.Cartesian2(0,-10),fillColor:this.Cesium.Color.WHITE,outlineColor:this.Cesium.Color.BLACK,backgroundColor:new this.Cesium.Color(.1,.1,.1,.8),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}registerPickHandler(e){this.destroyPickHandler(),!(!this.Cesium||!this.viewer)&&(this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.pickHandler.setInputAction(t=>{let n;try{n=this.viewer.scene.pickPosition(t.position)}catch(s){console.warn("pickPosition failed:",s)}if(!n){const s=this.viewer.camera.getPickRay(t.position);n=this.viewer.scene.globe.pick(s,this.viewer.scene)}if(n||(n=this.viewer.camera.pickEllipsoid(t.position,this.viewer.scene.globe.ellipsoid)),n){const s=this.Cesium.Cartographic.fromCartesian(n),o=this.Cesium.Math.toDegrees(s.longitude),r=this.Cesium.Math.toDegrees(s.latitude),l=s.height;e({longitude:o,latitude:r,height:l})}},this.Cesium.ScreenSpaceEventType.LEFT_CLICK,this.Cesium.KeyboardEventModifier.SHIFT))}destroyPickHandler(){this.pickHandler&&(this.pickHandler.destroy(),this.pickHandler=null)}calculateOffset(e,t){return{dLon:t.longitude-e.longitude,dLat:t.latitude-e.latitude,dHeight:t.height-e.height}}}const Q0={class:"adjust-panel"},G0={class:"control-panel"},H0={class:"form-item"},Y0={class:"radio-group"},V0={class:"form-item"},z0={class:"radio-group"},W0={class:"form-item"},j0={class:"value"},K0={class:"param-row"},$0={class:"param-row"},X0={class:"param-row"},q0={class:"param-row"},J0={class:"param-row"},Z0={class:"param-row"},eC={class:"param-row"},tC={class:"button-grid"},iC={key:1,class:"pick-mode-ui"},nC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},sC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},oC=["checked"],rC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},aC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},lC={class:"form-item",style:{display:"block","margin-bottom":"15px"}},cC={class:"radio-group",style:{width:"100%",display:"flex","align-items":"flex-start","flex-direction":"column"}},dC=["checked"],hC={key:0,style:{"font-size":"12px",color:"#aaa","margin-left":"20px"}},uC={key:1,style:{"font-size":"12px",color:"#666","margin-left":"20px"}},fC={class:"list-panel"},pC={class:"list-header"},gC={class:"col-check"},mC=["checked"],AC={class:"list-body"},yC={class:"col-check"},CC=["onUpdate:modelValue"],EC={class:"col-index"},wC=["title"],bC={class:"col-main"},vC=["checked","onChange"],bi=Oe(c.defineComponent({__name:"LeitingPosition",props:{visible:{type:Boolean},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean}},emits:["update:visible","update:open","close","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=c.computed({get:()=>n.open!==void 0?n.open:n.visible,set:L=>{s("update:visible",L),s("update:open",L)}}),r=c.inject("leitingMethods"),l=c.ref("BIM"),a=c.ref("param"),d=c.ref(""),h=c.ref([]),f=c.ref("BIM"),p=c.ref(null),u=c.ref(null),m=c.ref(null),w=()=>(!m.value&&r?.value?.getViewer&&r?.value?.getCesium&&(m.value=new ll(r.value.getViewer(),r.value.getCesium())),m.value),A=()=>{w()?.clearMarkers(),p.value=null,u.value=null},C=(L,M)=>{L==="BIM"?p.value=M:u.value=M,w()?.addMarker(L,M),fe.success(`${L==="BIM"?"BIM":"地图"}标记点已添加`)},v=()=>{w()?.registerPickHandler(L=>{C(f.value,L)})},S=()=>{w()?.destroyPickHandler()},D=()=>{if(!p.value||!u.value){fe.warning("请先选择BIM标记点和地图标记点");return}if(!d.value){fe.warning("请先选择主模型");return}const L=w();let M=0,Q=0,Y=0;if(L){const{dLon:W,dLat:q,dHeight:Z}=L.calculateOffset(p.value,u.value);M=W,Q=q,Y=Z}else M=u.value.longitude-p.value.longitude,Q=u.value.latitude-p.value.latitude,Y=u.value.height-p.value.height;I.value.longitude+=M,I.value.latitude+=Q,I.value.height+=Y,y(d.value,{longitude:I.value.longitude,latitude:I.value.latitude,height:I.value.height}),fe.success("位置已调整")};c.watch(()=>a.value,L=>{L==="pick"?v():S()}),e({addMarker:C,setModelType:L=>{(L==="BIM"||L==="OSGB")&&(l.value=L)}});const I=c.ref({longitude:0,latitude:0,lonlat:1e-6,heightDistance:1,rotation:30,totalRotation:0,height:0,X:0,Y:0,Z:0}),B=c.computed(()=>{const L=h.value.find(M=>M.modelId===d.value);return L?L.modelName:""}),g=c.computed(()=>x.value.length>0&&x.value.every(L=>L.selected)),P=()=>{o.value=!1,s("close")},x=c.computed(()=>h.value.filter(L=>L.type===l.value)),k=L=>{const M=L.target.checked;x.value.forEach(Q=>Q.selected=M)},_=()=>{if(!r?.value)return;const L=r.value,M=L.getMapTileset?L.getMapTileset():{},Q=[];if(Object.keys(M).forEach(Y=>{const q=M[Y].leiting||{};q.model&&Q.push({modelId:q.model.modelId,modelName:q.model.modelName,selected:!1,formData:q.model.formData||{},dbName:q.model.dbName,url:q.model.url,type:q.model.type||"BIM"})}),h.value=Q,Q.length>0){const Y=L.getBIMmodelId?L.getBIMmodelId():"";Y&&Q.find(W=>W.modelId===Y)?F(Y):F(Q[0].modelId),Q.forEach(W=>W.selected=!0)}},G=()=>{fe.info("拖动右下角标,可显示模型列表",void 0,2)},F=L=>{d.value=L;const M=h.value.find(Q=>Q.modelId===L);M&&M.formData&&Object.keys(I.value).forEach(Q=>{M.formData[Q]!==void 0&&(I.value[Q]=M.formData[Q])})},E=L=>r?.value?.getMapTileset?r.value.getMapTileset()[L]:null,y=(L,M)=>{const Q=E(L),Y=r.value.getCesium();if(Q&&Y){if(Q.leiting?.model){Q.leiting.model.formData={...Q.leiting.model.formData,...M};const W=h.value.find(q=>q.modelId===L);W&&(W.formData=Q.leiting.model.formData)}Rn({Cesium:Y,tileset:Q})}},b=L=>{if(!d.value)return;const Q=h.value.find(q=>q.modelId===d.value)?.formData?.[L]??0,Y=I.value[L],W=Y-Q;y(d.value,{[L]:Y}),W!==0&&x.value.filter(Z=>Z.selected&&Z.modelId!==d.value).forEach(Z=>{const ne=(Z.formData?.[L]??0)+W;y(Z.modelId,{[L]:ne})})},T=L=>{const M=x.value.filter(q=>q.selected);if(M.length===0){fe.warning("请先选择要调整的模型");return}const{lonlat:Q,heightDistance:Y,rotation:W}=I.value;M.forEach(q=>{const Z={...q.formData};switch(L){case"north":Z.latitude+=Q;break;case"south":Z.latitude-=Q;break;case"east":Z.longitude+=Q;break;case"west":Z.longitude-=Q;break;case"up":Z.height+=Y;break;case"down":Z.height-=Y;break;case"rotateLeft":Z.totalRotation=(Z.totalRotation||0)+W;break;case"rotateRight":Z.totalRotation=(Z.totalRotation||0)-W;break}q.modelId===d.value&&(Z.lonlat=Q,Z.heightDistance=Y,Z.rotation=W,Object.assign(I.value,Z)),y(q.modelId,Z)})},R=()=>{if(!d.value){fe.warning("请先选择主模型");return}const L=E(d.value);if(!L||!r?.value?.getViewer)return;const M=r.value.getViewer(),Q=r.value.getCesium(),Y=L.boundingSphere;M.camera.flyToBoundingSphere(Y,{offset:new Q.HeadingPitchRange(0,Q.Math.toRadians(-90),Y.radius*2),duration:1.5})},O=()=>{r?.value?.saveRegion?(r.value.saveRegion(h.value),s("save",c.unref(h))):(console.log("Save models:",h.value),fe.warning("未找到保存接口,数据已打印控制台"))};return c.watch(()=>n.visible,L=>{L?(_(),G(),a.value==="pick"&&v()):(S(),A())}),c.onMounted(()=>{n.visible&&(_(),G(),a.value==="pick"&&v())}),(L,M)=>(c.openBlock(),c.createBlock(Pe,{visible:o.value,title:"调整位置(调整前可选择正北俯视)","full-height":i.fullHeight,width:260,"onUpdate:visible":M[25]||(M[25]=Q=>o.value=Q),onClose:P,onSave:O,class:"base-position-card"},{default:c.withCtx(()=>[c.createElementVNode("div",Q0,[c.createElementVNode("div",G0,[c.createElementVNode("div",H0,[M[26]||(M[26]=c.createElementVNode("label",null,"模型类型:",-1)),c.createElementVNode("div",Y0,[c.createElementVNode("span",{class:c.normalizeClass({active:l.value==="BIM"}),onClick:M[0]||(M[0]=Q=>l.value="BIM")},"BIM模型",2),c.createElementVNode("span",{class:c.normalizeClass({active:l.value==="OSGB"}),onClick:M[1]||(M[1]=Q=>l.value="OSGB")},"倾斜摄影",2)])]),c.createElementVNode("div",V0,[M[27]||(M[27]=c.createElementVNode("label",null,"调整操作:",-1)),c.createElementVNode("div",z0,[c.createElementVNode("span",{class:c.normalizeClass({active:a.value==="param"}),onClick:M[2]||(M[2]=Q=>a.value="param")},"参数模式",2),c.createElementVNode("span",{class:c.normalizeClass({active:a.value==="pick"}),onClick:M[3]||(M[3]=Q=>a.value="pick")},"地图点选",2)])]),c.createElementVNode("div",W0,[M[28]||(M[28]=c.createElementVNode("label",null,"当前主模型:",-1)),c.createElementVNode("span",j0,c.toDisplayString(B.value||"未选择"),1)]),M[42]||(M[42]=c.createElementVNode("div",{class:"separator"},null,-1)),a.value==="param"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[M[36]||(M[36]=c.createElementVNode("div",{class:"group-header"},"当前状态",-1)),c.createElementVNode("div",K0,[M[29]||(M[29]=c.createElementVNode("label",null,"经度(东西):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[4]||(M[4]=Q=>I.value.longitude=Q),onChange:M[5]||(M[5]=Q=>b("longitude")),step:"0.000001"},null,544),[[c.vModelText,I.value.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",$0,[M[30]||(M[30]=c.createElementVNode("label",null,"纬度(南北):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[6]||(M[6]=Q=>I.value.latitude=Q),onChange:M[7]||(M[7]=Q=>b("latitude")),step:"0.000001"},null,544),[[c.vModelText,I.value.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",X0,[M[31]||(M[31]=c.createElementVNode("label",null,"高度(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[8]||(M[8]=Q=>I.value.height=Q),onChange:M[9]||(M[9]=Q=>b("height")),step:"0.1"},null,544),[[c.vModelText,I.value.height,void 0,{number:!0}]])]),c.createElementVNode("div",q0,[M[32]||(M[32]=c.createElementVNode("label",null,"累计旋转(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[10]||(M[10]=Q=>I.value.totalRotation=Q),onChange:M[11]||(M[11]=Q=>b("totalRotation")),step:"1"},null,544),[[c.vModelText,I.value.totalRotation,void 0,{number:!0}]])]),M[37]||(M[37]=c.createElementVNode("div",{class:"separator"},null,-1)),M[38]||(M[38]=c.createElementVNode("div",{class:"group-header"},"调整步长",-1)),c.createElementVNode("div",J0,[M[33]||(M[33]=c.createElementVNode("label",null,"经纬步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[12]||(M[12]=Q=>I.value.lonlat=Q),step:"0.000001"},null,512),[[c.vModelText,I.value.lonlat,void 0,{number:!0}]])]),c.createElementVNode("div",Z0,[M[34]||(M[34]=c.createElementVNode("label",null,"高度步长(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[13]||(M[13]=Q=>I.value.heightDistance=Q),step:"0.1"},null,512),[[c.vModelText,I.value.heightDistance,void 0,{number:!0}]])]),c.createElementVNode("div",eC,[M[35]||(M[35]=c.createElementVNode("label",null,"旋转步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":M[14]||(M[14]=Q=>I.value.rotation=Q),step:"1"},null,512),[[c.vModelText,I.value.rotation,void 0,{number:!0}]])]),c.createElementVNode("div",tC,[c.createElementVNode("button",{onClick:M[15]||(M[15]=Q=>T("rotateLeft"))},"左转"),c.createElementVNode("button",{onClick:M[16]||(M[16]=Q=>T("north"))},"北移"),c.createElementVNode("button",{onClick:M[17]||(M[17]=Q=>T("rotateRight"))},"右转"),c.createElementVNode("button",{onClick:M[18]||(M[18]=Q=>T("west"))},"西移"),c.createElementVNode("button",{onClick:M[19]||(M[19]=Q=>T("south"))},"南移"),c.createElementVNode("button",{onClick:M[20]||(M[20]=Q=>T("east"))},"东移"),c.createElementVNode("button",{onClick:M[21]||(M[21]=Q=>T("up"))},"上移"),c.createElementVNode("button",{onClick:M[22]||(M[22]=Q=>T("down"))},"下移"),c.createElementVNode("button",{onClick:R,class:"primary-btn"},"正北俯视"),c.createElementVNode("button",{onClick:O,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):a.value==="pick"?(c.openBlock(),c.createElementBlock("div",iC,[c.createElementVNode("div",nC,[c.createElementVNode("div",sC,[c.createElementVNode("div",{onClick:M[23]||(M[23]=Q=>f.value="BIM"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[c.createElementVNode("input",{type:"radio",checked:f.value==="BIM",style:{"margin-right":"5px"}},null,8,oC),M[39]||(M[39]=c.createElementVNode("span",{style:{"font-weight":"bold"}},"BIM标记点:",-1))]),p.value?(c.openBlock(),c.createElementBlock("div",rC,[c.createElementVNode("div",null,"经度:"+c.toDisplayString(p.value.longitude.toFixed(10)),1),c.createElementVNode("div",null,"纬度:"+c.toDisplayString(p.value.latitude.toFixed(10)),1)])):(c.openBlock(),c.createElementBlock("div",aC,"未选择"))])]),c.createElementVNode("div",lC,[c.createElementVNode("div",cC,[c.createElementVNode("div",{onClick:M[24]||(M[24]=Q=>f.value="MAP"),style:{cursor:"pointer",display:"flex","align-items":"center","margin-bottom":"5px"}},[c.createElementVNode("input",{type:"radio",checked:f.value==="MAP",style:{"margin-right":"5px"}},null,8,dC),M[40]||(M[40]=c.createElementVNode("span",{style:{"font-weight":"bold"}},"地图标记点:",-1))]),u.value?(c.openBlock(),c.createElementBlock("div",hC,[c.createElementVNode("div",null,"经度:"+c.toDisplayString(u.value.longitude.toFixed(10)),1),c.createElementVNode("div",null,"纬度:"+c.toDisplayString(u.value.latitude.toFixed(10)),1)])):(c.openBlock(),c.createElementBlock("div",uC,"未选择"))])]),c.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[c.createElementVNode("button",{onClick:D},"调整位置"),c.createElementVNode("button",{onClick:O},"保存")]),M[41]||(M[41]=c.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[c.createElementVNode("div",null,"操作指南:"),c.createElementVNode("div",null,"1. 勾选上方 BIM 或 地图 标记点选项。"),c.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),c.createElementVNode("div",null,"3. 采集两点后,点击“调整位置”进行校准。")],-1))])):c.createCommentVNode("",!0)]),c.createElementVNode("div",fC,[c.createElementVNode("div",pC,[c.createElementVNode("div",gC,[c.createElementVNode("input",{type:"checkbox",checked:g.value,onChange:k},null,40,mC)]),M[43]||(M[43]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),M[44]||(M[44]=c.createElementVNode("div",{class:"col-name"},"名称",-1)),M[45]||(M[45]=c.createElementVNode("div",{class:"col-main"},"主模型",-1))]),c.createElementVNode("div",AC,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(x.value,(Q,Y)=>(c.openBlock(),c.createElementBlock("div",{key:Q.modelId,class:c.normalizeClass(["list-item",{active:Q.modelId===d.value}])},[c.createElementVNode("div",yC,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":W=>Q.selected=W},null,8,CC),[[c.vModelCheckbox,Q.selected]])]),c.createElementVNode("div",EC,c.toDisplayString(Y+1),1),c.createElementVNode("div",{class:"col-name",title:Q.modelName},c.toDisplayString(Q.modelName),9,wC),c.createElementVNode("div",bC,[c.createElementVNode("input",{type:"radio",name:"mainModel",checked:Q.modelId===d.value,onChange:W=>F(Q.modelId)},null,40,vC)])],2))),128))])])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-9737215c"]]);function ln(){return ln=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},ln.apply(null,arguments)}const IC={locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",month:"月",year:"年",previousMonth:"上个月 (翻页上键)",nextMonth:"下个月 (翻页下键)",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",yearFormat:"YYYY年",dayFormat:"D日",dateFormat:"YYYY年M月D日",dateTimeFormat:"YYYY年M月D日 HH时mm分ss秒",previousYear:"上一年 (Control键加左方向键)",nextYear:"下一年 (Control键加右方向键)",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪"},BC={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},cl={lang:ln({placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"]},IC),timePickerLocale:ln({},BC)};cl.lang.ok="确定";var cn={exports:{}},xC=cn.exports,dl;function hl(){return dl||(dl=1,(function(i,e){(function(t,n){i.exports=n()})(xC,(function(){var t=1e3,n=6e4,s=36e5,o="millisecond",r="second",l="minute",a="hour",d="day",h="week",f="month",p="quarter",u="year",m="date",w="Invalid Date",A=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,C=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(F){var E=["th","st","nd","rd"],y=F%100;return"["+F+(E[(y-20)%10]||E[y]||E[0])+"]"}},S=function(F,E,y){var b=String(F);return!b||b.length>=E?F:""+Array(E+1-b.length).join(y)+F},D={s:S,z:function(F){var E=-F.utcOffset(),y=Math.abs(E),b=Math.floor(y/60),T=y%60;return(E<=0?"+":"-")+S(b,2,"0")+":"+S(T,2,"0")},m:function F(E,y){if(E.date()<y.date())return-F(y,E);var b=12*(y.year()-E.year())+(y.month()-E.month()),T=E.clone().add(b,f),R=y-T<0,O=E.clone().add(b+(R?-1:1),f);return+(-(b+(y-T)/(R?T-O:O-T))||0)},a:function(F){return F<0?Math.ceil(F)||0:Math.floor(F)},p:function(F){return{M:f,y:u,w:h,d,D:m,h:a,m:l,s:r,ms:o,Q:p}[F]||String(F||"").toLowerCase().replace(/s$/,"")},u:function(F){return F===void 0}},N="en",I={};I[N]=v;var B="$isDayjsObject",g=function(F){return F instanceof _||!(!F||!F[B])},P=function F(E,y,b){var T;if(!E)return N;if(typeof E=="string"){var R=E.toLowerCase();I[R]&&(T=R),y&&(I[R]=y,T=R);var O=E.split("-");if(!T&&O.length>1)return F(O[0])}else{var L=E.name;I[L]=E,T=L}return!b&&T&&(N=T),T||!b&&N},x=function(F,E){if(g(F))return F.clone();var y=typeof E=="object"?E:{};return y.date=F,y.args=arguments,new _(y)},k=D;k.l=P,k.i=g,k.w=function(F,E){return x(F,{locale:E.$L,utc:E.$u,x:E.$x,$offset:E.$offset})};var _=(function(){function F(y){this.$L=P(y.locale,null,!0),this.parse(y),this.$x=this.$x||y.x||{},this[B]=!0}var E=F.prototype;return E.parse=function(y){this.$d=(function(b){var T=b.date,R=b.utc;if(T===null)return new Date(NaN);if(k.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var O=T.match(A);if(O){var L=O[2]-1||0,M=(O[7]||"0").substring(0,3);return R?new Date(Date.UTC(O[1],L,O[3]||1,O[4]||0,O[5]||0,O[6]||0,M)):new Date(O[1],L,O[3]||1,O[4]||0,O[5]||0,O[6]||0,M)}}return new Date(T)})(y),this.init()},E.init=function(){var y=this.$d;this.$y=y.getFullYear(),this.$M=y.getMonth(),this.$D=y.getDate(),this.$W=y.getDay(),this.$H=y.getHours(),this.$m=y.getMinutes(),this.$s=y.getSeconds(),this.$ms=y.getMilliseconds()},E.$utils=function(){return k},E.isValid=function(){return this.$d.toString()!==w},E.isSame=function(y,b){var T=x(y);return this.startOf(b)<=T&&T<=this.endOf(b)},E.isAfter=function(y,b){return x(y)<this.startOf(b)},E.isBefore=function(y,b){return this.endOf(b)<x(y)},E.$g=function(y,b,T){return k.u(y)?this[b]:this.set(T,y)},E.unix=function(){return Math.floor(this.valueOf()/1e3)},E.valueOf=function(){return this.$d.getTime()},E.startOf=function(y,b){var T=this,R=!!k.u(b)||b,O=k.p(y),L=function(ne,se){var pe=k.w(T.$u?Date.UTC(T.$y,se,ne):new Date(T.$y,se,ne),T);return R?pe:pe.endOf(d)},M=function(ne,se){return k.w(T.toDate()[ne].apply(T.toDate("s"),(R?[0,0,0,0]:[23,59,59,999]).slice(se)),T)},Q=this.$W,Y=this.$M,W=this.$D,q="set"+(this.$u?"UTC":"");switch(O){case u:return R?L(1,0):L(31,11);case f:return R?L(1,Y):L(0,Y+1);case h:var Z=this.$locale().weekStart||0,oe=(Q<Z?Q+7:Q)-Z;return L(R?W-oe:W+(6-oe),Y);case d:case m:return M(q+"Hours",0);case a:return M(q+"Minutes",1);case l:return M(q+"Seconds",2);case r:return M(q+"Milliseconds",3);default:return this.clone()}},E.endOf=function(y){return this.startOf(y,!1)},E.$set=function(y,b){var T,R=k.p(y),O="set"+(this.$u?"UTC":""),L=(T={},T[d]=O+"Date",T[m]=O+"Date",T[f]=O+"Month",T[u]=O+"FullYear",T[a]=O+"Hours",T[l]=O+"Minutes",T[r]=O+"Seconds",T[o]=O+"Milliseconds",T)[R],M=R===d?this.$D+(b-this.$W):b;if(R===f||R===u){var Q=this.clone().set(m,1);Q.$d[L](M),Q.init(),this.$d=Q.set(m,Math.min(this.$D,Q.daysInMonth())).$d}else L&&this.$d[L](M);return this.init(),this},E.set=function(y,b){return this.clone().$set(y,b)},E.get=function(y){return this[k.p(y)]()},E.add=function(y,b){var T,R=this;y=Number(y);var O=k.p(b),L=function(Y){var W=x(R);return k.w(W.date(W.date()+Math.round(Y*y)),R)};if(O===f)return this.set(f,this.$M+y);if(O===u)return this.set(u,this.$y+y);if(O===d)return L(1);if(O===h)return L(7);var M=(T={},T[l]=n,T[a]=s,T[r]=t,T)[O]||1,Q=this.$d.getTime()+y*M;return k.w(Q,this)},E.subtract=function(y,b){return this.add(-1*y,b)},E.format=function(y){var b=this,T=this.$locale();if(!this.isValid())return T.invalidDate||w;var R=y||"YYYY-MM-DDTHH:mm:ssZ",O=k.z(this),L=this.$H,M=this.$m,Q=this.$M,Y=T.weekdays,W=T.months,q=T.meridiem,Z=function(se,pe,ve,V){return se&&(se[pe]||se(b,R))||ve[pe].slice(0,V)},oe=function(se){return k.s(L%12||12,se,"0")},ne=q||function(se,pe,ve){var V=se<12?"AM":"PM";return ve?V.toLowerCase():V};return R.replace(C,(function(se,pe){return pe||(function(ve){switch(ve){case"YY":return String(b.$y).slice(-2);case"YYYY":return k.s(b.$y,4,"0");case"M":return Q+1;case"MM":return k.s(Q+1,2,"0");case"MMM":return Z(T.monthsShort,Q,W,3);case"MMMM":return Z(W,Q);case"D":return b.$D;case"DD":return k.s(b.$D,2,"0");case"d":return String(b.$W);case"dd":return Z(T.weekdaysMin,b.$W,Y,2);case"ddd":return Z(T.weekdaysShort,b.$W,Y,3);case"dddd":return Y[b.$W];case"H":return String(L);case"HH":return k.s(L,2,"0");case"h":return oe(1);case"hh":return oe(2);case"a":return ne(L,M,!0);case"A":return ne(L,M,!1);case"m":return String(M);case"mm":return k.s(M,2,"0");case"s":return String(b.$s);case"ss":return k.s(b.$s,2,"0");case"SSS":return k.s(b.$ms,3,"0");case"Z":return O}return null})(se)||O.replace(":","")}))},E.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},E.diff=function(y,b,T){var R,O=this,L=k.p(b),M=x(y),Q=(M.utcOffset()-this.utcOffset())*n,Y=this-M,W=function(){return k.m(O,M)};switch(L){case u:R=W()/12;break;case f:R=W();break;case p:R=W()/3;break;case h:R=(Y-Q)/6048e5;break;case d:R=(Y-Q)/864e5;break;case a:R=Y/s;break;case l:R=Y/n;break;case r:R=Y/t;break;default:R=Y}return T?R:k.a(R)},E.daysInMonth=function(){return this.endOf(f).$D},E.$locale=function(){return I[this.$L]},E.locale=function(y,b){if(!y)return this.$L;var T=this.clone(),R=P(y,b,!0);return R&&(T.$L=R),T},E.clone=function(){return k.w(this.$d,this)},E.toDate=function(){return new Date(this.valueOf())},E.toJSON=function(){return this.isValid()?this.toISOString():null},E.toISOString=function(){return this.$d.toISOString()},E.toString=function(){return this.$d.toUTCString()},F})(),G=_.prototype;return x.prototype=G,[["$ms",o],["$s",r],["$m",l],["$H",a],["$W",d],["$M",f],["$y",u],["$D",m]].forEach((function(F){G[F[1]]=function(E){return this.$g(E,F[0],F[1])}})),x.extend=function(F,E){return F.$i||(F(E,_,x),F.$i=!0),x},x.locale=P,x.isDayjs=g,x.unix=function(F){return x(1e3*F)},x.en=I[N],x.Ls=I,x.p={},x}))})(cn)),cn.exports}var SC=hl();const ze=Gt(SC);var dn={exports:{}},TC=dn.exports,ul;function MC(){return ul||(ul=1,(function(i,e){(function(t,n){i.exports=n(hl())})(TC,(function(t){function n(r){return r&&typeof r=="object"&&"default"in r?r:{default:r}}var s=n(t),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(r,l){return l==="W"?r+"周":r+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(r,l){var a=100*r+l;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return s.default.locale(o,null,!0),o}))})(dn)),dn.exports}MC();var hn={exports:{}},DC=hn.exports,fl;function kC(){return fl||(fl=1,(function(i,e){(function(t,n){i.exports=n()})(DC,(function(){return function(t,n,s){var o=n.prototype,r=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,p,u,m,w){var A=f.name?f:f.$locale(),C=r(A[p]),v=r(A[u]),S=C||v.map((function(N){return N.slice(0,m)}));if(!w)return S;var D=A.weekStart;return S.map((function(N,I){return S[(I+(D||0))%7]}))},a=function(){return s.Ls[s.locale()]},d=function(f,p){return f.formats[p]||(function(u){return u.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(m,w,A){return w||A.slice(1)}))})(f.formats[p.toUpperCase()])},h=function(){var f=this;return{months:function(p){return p?p.format("MMMM"):l(f,"months")},monthsShort:function(p){return p?p.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(p){return p?p.format("dddd"):l(f,"weekdays")},weekdaysMin:function(p){return p?p.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(p){return p?p.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(p){return d(f.$locale(),p)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return h.bind(this)()},s.localeData=function(){var f=a();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return s.weekdays()},weekdaysShort:function(){return s.weekdaysShort()},weekdaysMin:function(){return s.weekdaysMin()},months:function(){return s.months()},monthsShort:function(){return s.monthsShort()},longDateFormat:function(p){return d(f,p)},meridiem:f.meridiem,ordinal:f.ordinal}},s.months=function(){return l(a(),"months")},s.monthsShort=function(){return l(a(),"monthsShort","months",3)},s.weekdays=function(f){return l(a(),"weekdays",null,null,f)},s.weekdaysShort=function(f){return l(a(),"weekdaysShort","weekdays",3,f)},s.weekdaysMin=function(f){return l(a(),"weekdaysMin","weekdays",2,f)}}}))})(hn)),hn.exports}var PC=kC();const FC=Gt(PC);var un={exports:{}},RC=un.exports,pl;function OC(){return pl||(pl=1,(function(i,e){(function(t,n){i.exports=n()})(RC,(function(){return function(t,n){n.prototype.weekday=function(s){var o=this.$locale().weekStart||0,r=this.$W,l=(r<o?r+7:r)-o;return this.$utils().u(s)?l:this.subtract(l,"day").add(s,"day")}}}))})(un)),un.exports}var LC=OC();const NC=Gt(LC);var fn={exports:{}},_C=fn.exports,gl;function UC(){return gl||(gl=1,(function(i,e){(function(t,n){i.exports=n()})(_C,(function(){var t="week",n="year";return function(s,o,r){var l=o.prototype;l.week=function(a){if(a===void 0&&(a=null),a!==null)return this.add(7*(a-this.week()),"day");var d=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var h=r(this).startOf(n).add(1,n).date(d),f=r(this).endOf(t);if(h.isBefore(f))return 1}var p=r(this).startOf(n).date(d).startOf(t).subtract(1,"millisecond"),u=this.diff(p,t,!0);return u<0?r(this).startOf("week").week():Math.ceil(u)},l.weeks=function(a){return a===void 0&&(a=null),this.week(a)}}}))})(fn)),fn.exports}var QC=UC();const GC=Gt(QC);var pn={exports:{}},HC=pn.exports,ml;function YC(){return ml||(ml=1,(function(i,e){(function(t,n){i.exports=n()})(HC,(function(){var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},n=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,s=/\d/,o=/\d\d/,r=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,a={},d=function(A){return(A=+A)+(A>68?1900:2e3)},h=function(A){return function(C){this[A]=+C}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(A){(this.zone||(this.zone={})).offset=(function(C){if(!C||C==="Z")return 0;var v=C.match(/([+-]|\d\d)/g),S=60*v[1]+(+v[2]||0);return S===0?0:v[0]==="+"?-S:S})(A)}],p=function(A){var C=a[A];return C&&(C.indexOf?C:C.s.concat(C.f))},u=function(A,C){var v,S=a.meridiem;if(S){for(var D=1;D<=24;D+=1)if(A.indexOf(S(D,0,C))>-1){v=D>12;break}}else v=A===(C?"pm":"PM");return v},m={A:[l,function(A){this.afternoon=u(A,!1)}],a:[l,function(A){this.afternoon=u(A,!0)}],Q:[s,function(A){this.month=3*(A-1)+1}],S:[s,function(A){this.milliseconds=100*+A}],SS:[o,function(A){this.milliseconds=10*+A}],SSS:[/\d{3}/,function(A){this.milliseconds=+A}],s:[r,h("seconds")],ss:[r,h("seconds")],m:[r,h("minutes")],mm:[r,h("minutes")],H:[r,h("hours")],h:[r,h("hours")],HH:[r,h("hours")],hh:[r,h("hours")],D:[r,h("day")],DD:[o,h("day")],Do:[l,function(A){var C=a.ordinal,v=A.match(/\d+/);if(this.day=v[0],C)for(var S=1;S<=31;S+=1)C(S).replace(/\[|\]/g,"")===A&&(this.day=S)}],w:[r,h("week")],ww:[o,h("week")],M:[r,h("month")],MM:[o,h("month")],MMM:[l,function(A){var C=p("months"),v=(p("monthsShort")||C.map((function(S){return S.slice(0,3)}))).indexOf(A)+1;if(v<1)throw new Error;this.month=v%12||v}],MMMM:[l,function(A){var C=p("months").indexOf(A)+1;if(C<1)throw new Error;this.month=C%12||C}],Y:[/[+-]?\d+/,h("year")],YY:[o,function(A){this.year=d(A)}],YYYY:[/\d{4}/,h("year")],Z:f,ZZ:f};function w(A){var C,v;C=A,v=a&&a.formats;for(var S=(A=C.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(x,k,_){var G=_&&_.toUpperCase();return k||v[_]||t[_]||v[G].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(F,E,y){return E||y.slice(1)}))}))).match(n),D=S.length,N=0;N<D;N+=1){var I=S[N],B=m[I],g=B&&B[0],P=B&&B[1];S[N]=P?{regex:g,parser:P}:I.replace(/^\[|\]$/g,"")}return function(x){for(var k={},_=0,G=0;_<D;_+=1){var F=S[_];if(typeof F=="string")G+=F.length;else{var E=F.regex,y=F.parser,b=x.slice(G),T=E.exec(b)[0];y.call(k,T),x=x.replace(T,"")}}return(function(R){var O=R.afternoon;if(O!==void 0){var L=R.hours;O?L<12&&(R.hours+=12):L===12&&(R.hours=0),delete R.afternoon}})(k),k}}return function(A,C,v){v.p.customParseFormat=!0,A&&A.parseTwoDigitYear&&(d=A.parseTwoDigitYear);var S=C.prototype,D=S.parse;S.parse=function(N){var I=N.date,B=N.utc,g=N.args;this.$u=B;var P=g[1];if(typeof P=="string"){var x=g[2]===!0,k=g[3]===!0,_=x||k,G=g[2];k&&(G=g[2]),a=this.$locale(),!x&&G&&(a=v.Ls[G]),this.$d=(function(b,T,R,O){try{if(["x","X"].indexOf(T)>-1)return new Date((T==="X"?1e3:1)*b);var L=w(T)(b),M=L.year,Q=L.month,Y=L.day,W=L.hours,q=L.minutes,Z=L.seconds,oe=L.milliseconds,ne=L.zone,se=L.week,pe=new Date,ve=Y||(M||Q?1:pe.getDate()),V=M||pe.getFullYear(),j=0;M&&!Q||(j=Q>0?Q-1:pe.getMonth());var te,Ae=W||0,Ce=q||0,Me=Z||0,Le=oe||0;return ne?new Date(Date.UTC(V,j,ve,Ae,Ce,Me,Le+60*ne.offset*1e3)):R?new Date(Date.UTC(V,j,ve,Ae,Ce,Me,Le)):(te=new Date(V,j,ve,Ae,Ce,Me,Le),se&&(te=O(te).week(se).toDate()),te)}catch{return new Date("")}})(I,P,B,v),this.init(),G&&G!==!0&&(this.$L=this.locale(G).$L),_&&I!=this.format(P)&&(this.$d=new Date("")),a={}}else if(P instanceof Array)for(var F=P.length,E=1;E<=F;E+=1){g[1]=P[E-1];var y=v.apply(this,g);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}E===F&&(this.$d=new Date(""))}else D.call(this,N)}}}))})(pn)),pn.exports}var VC=YC();const zC=Gt(VC),WC={class:"setting-panel"},jC={class:"tabs-header"},KC={class:"tab-content"},$C={key:0,class:"section"},XC={class:"setting-item"},qC={class:"setting-item"},JC={class:"setting-item"},ZC={key:1,class:"section"},eE={class:"tabs-header",style:{"margin-bottom":"8px"}},tE={key:0},iE={class:"setting-item column"},nE={class:"setting-item column"},sE={class:"setting-item"},oE={key:1},rE={class:"setting-item column"},aE={class:"setting-item column",style:{"margin-top":"12px","border-top":"1px solid rgba(255,255,255,0.1)","padding-top":"8px"}},lE={class:"search-box"},cE={key:2,class:"section"},dE={class:"setting-item"},hE={key:0,class:"setting-item column"},uE={class:"sub-label"},fE={class:"setting-item"},pE={class:"setting-item"},gE={class:"setting-item column"},mE={class:"setting-item column"},AE={class:"sub-label"},yE={class:"setting-item column"},CE={class:"sub-label"},EE={class:"setting-item column"},wE={class:"sub-label"},bE={class:"setting-item column"},vE={style:{display:"flex",gap:"8px","margin-bottom":"8px"}},IE=["onClick","title"],BE={style:{display:"flex",gap:"8px","align-items":"center"}},xE={key:3,class:"section"},SE={class:"setting-item"},TE={class:"setting-item column"},vi=Oe(c.defineComponent({__name:"LeitingSetting",props:{visible:{type:Boolean,default:!1},open:{type:Boolean,default:void 0},fullHeight:{type:Boolean,default:!1},tiandituToken:{type:String,default:""},initialConfig:{type:Object,default:()=>({})}},emits:["update:visible","update:open","close"],setup(i,{emit:e}){ze.locale("zh-cn"),ze.extend(FC),ze.extend(NC),ze.extend(GC),ze.extend(zC);const t=ge.Switch,n=ge.Radio.Group,s=ge.Radio,o=ge.Input,r=ge.Slider,l=ge.Select,a=ge.Select.Option,d=ge.DatePicker,h=i,f=e,p=c.inject("leitingMethods"),u=c.computed({get:()=>h.open!==void 0?h.open:h.visible,set:E=>{f("update:visible",E),f("update:open",E)}}),m=c.ref("GIS"),w=c.reactive({globe:!1,terrain:!1,depthTest:!1}),A=c.reactive({provider:"tianditu",tianditu:{token:"c25f14fb6bd4397cf8fe45144ff768d6",layerType:"img_w",showLabel:!1},arcgis:{url:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},baseMap:"tianditu"}),C=c.reactive({shadows:!1,shadowDarkness:.7,environmentMap:!1,ambientOcclusion:!1,time:ze("2025-06-22 10:00"),brightness:1.5,contrast:1,saturation:1,backgroundColor:"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)"}),v=c.reactive({collision:!1,habit:0}),S=E=>{E&&(E.globe!==void 0&&(w.globe=E.globe),E.terrain!==void 0&&(w.terrain=E.terrain),E.depthTest!==void 0&&(w.depthTest=E.depthTest),E.mapProvider!==void 0&&(A.provider=E.mapProvider),E.tiandituLayerType!==void 0&&(A.tianditu.layerType=E.tiandituLayerType),E.tiandituShowLabel!==void 0&&(A.tianditu.showLabel=E.tiandituShowLabel),E.arcgisUrl!==void 0&&(A.arcgis.url=E.arcgisUrl),E.shadows!==void 0&&(C.shadows=E.shadows),E.shadowDarkness!==void 0&&(C.shadowDarkness=E.shadowDarkness),E.environmentMap!==void 0&&(C.environmentMap=E.environmentMap),E.ambientOcclusion!==void 0&&(C.ambientOcclusion=E.ambientOcclusion),E.time!==void 0&&(typeof E.time=="number"?C.time=ze().startOf("day").add(E.time,"hour"):C.time=ze(E.time)),E.brightness!==void 0&&(C.brightness=E.brightness),E.contrast!==void 0&&(C.contrast=E.contrast),E.saturation!==void 0&&(C.saturation=E.saturation),E.backgroundColor!==void 0&&(C.backgroundColor=E.backgroundColor),E.collision!==void 0&&(v.collision=E.collision),E.mouseHabit!==void 0&&(v.habit=E.mouseHabit))};c.watch(()=>h.initialConfig,E=>{S(E)},{deep:!0,immediate:!0});const D=["linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)","linear-gradient(0deg, #0f2027 0%, #203a43 50%, #2c5364 100%)","linear-gradient(0deg, #cfd9df 0%, #e2ebf0 100%)"],N=[{label:"全球影像地图服务(墨卡托)",value:"img_w"},{label:"全球影像地图服务(经纬度)",value:"img_c"},{label:"全球矢量地图服务(墨卡托)",value:"vec_w"},{label:"全球矢量地图服务(经纬度)",value:"vec_c"},{label:"全球地形晕渲服务(墨卡托)",value:"ter_w"},{label:"全球地形晕渲服务(经纬度)",value:"ter_c"}],I=()=>{const E=A.provider,y={};E==="tianditu"?(y.token=A.tianditu.token,y.layerType=A.tianditu.layerType,y.showAnnotation=A.tianditu.showLabel):E==="arcgis"&&(y.url=A.arcgis.url),p.value?.changeBaseMap?.(E,y)};c.watch(()=>A.provider,I),c.watch(()=>A.tianditu.layerType,I),c.watch(()=>A.tianditu.showLabel,I),c.watch(()=>A.tianditu.token,kn(I,1e3)),c.watch(()=>A.arcgis.url,kn(I,1e3)),c.onMounted(()=>{h.tiandituToken&&(A.tianditu.token=h.tiandituToken)}),c.watch(()=>w.globe,E=>p.value?.setGlobeEnvironmentVisible?.(E)),c.watch(()=>w.terrain,E=>p.value?.setTerrainEnable?.(E)),c.watch(()=>w.depthTest,E=>p.value?.setDepthTestEnable?.(E)),c.watch(()=>p?.value,E=>{if(E){if(E.getConfigure=()=>({globe:w.globe,terrain:w.terrain,depthTest:w.depthTest,mapProvider:A.provider,tiandituLayerType:A.tianditu.layerType,tiandituShowLabel:A.tianditu.showLabel,arcgisUrl:A.arcgis.url,shadows:C.shadows,shadowDarkness:C.shadowDarkness,environmentMap:C.environmentMap,ambientOcclusion:C.ambientOcclusion,time:ze.isDayjs(C.time)?C.time.format("YYYY-MM-DD HH:mm"):C.time,brightness:C.brightness,contrast:C.contrast,saturation:C.saturation,backgroundColor:C.backgroundColor,collision:v.collision,mouseHabit:v.habit}),E.setConfigure=y=>{S(y)},E.setBackgroundColor&&C.backgroundColor&&E.setBackgroundColor(C.backgroundColor),E.setGlobeEnvironmentVisible&&E.setGlobeEnvironmentVisible(w.globe),E.setShadowsEnable&&E.setShadowsEnable(C.shadows),E.setShadowDarkness&&E.setShadowDarkness(C.shadowDarkness),E.setEnvironmentMapEnable&&E.setEnvironmentMapEnable(C.environmentMap),E.setAmbientOcclusion&&E.setAmbientOcclusion(C.ambientOcclusion),E.setTime){const y=ze.isDayjs(C.time)?C.time.toDate():new Date;E.setTime(y)}E.setModelBrightness&&E.setModelBrightness(C.brightness),E.setCollisionDetection&&E.setCollisionDetection(v.collision),E.setMouseHabit&&E.setMouseHabit(v.habit),E.changeBaseMap&&A.baseMap&&E.changeBaseMap(A.baseMap,{token:A.tianditu.token,layerType:A.tianditu.layerType,showAnnotation:A.tianditu.showLabel,url:A.arcgis.url})}},{immediate:!0});const B=c.computed({get:()=>{const E=C.backgroundColor;return/^#[0-9A-Fa-f]{6}$/.test(E)?E:"#ffffff"},set:E=>{C.backgroundColor=E}}),g=c.ref(""),P=c.ref(!1),x=c.ref([]);c.watch(()=>w.globe,E=>p.value?.setGlobeEnvironmentVisible?.(E)),c.watch(()=>w.terrain,E=>p.value?.setTerrainEnable?.(E)),c.watch(()=>A.baseMap,E=>{p.value?.changeBaseMap?.(E,{token:h.tiandituToken})}),c.watch(()=>C.shadows,E=>p.value?.setShadowsEnable?.(E)),c.watch(()=>C.shadowDarkness,E=>p.value?.setShadowDarkness?.(E)),c.watch(()=>C.environmentMap,E=>p.value?.setEnvironmentMapEnable?.(E)),c.watch(()=>C.ambientOcclusion,E=>p.value?.setAmbientOcclusion?.(E)),c.watch(()=>C.time,E=>{const y=ze.isDayjs(E)?E.toDate():new Date;p.value?.setTime?.(y)}),c.watch(()=>[C.brightness,C.contrast,C.saturation],([E,y,b])=>{const T=p.value;T?.setModelColorAdjustment?T.setModelColorAdjustment({brightness:E,contrast:y,saturation:b}):T?.setModelBrightness?.(E)}),c.watch(()=>C.backgroundColor,E=>{if(p.value?.setBackgroundColor)p.value.setBackgroundColor(E);else{const y=document.querySelector(".cesium-viewer");y&&(y.style.background=E)}}),c.watch(()=>v.collision,E=>p.value?.setCollisionDetection?.(E)),c.watch(()=>v.habit,E=>p.value?.setMouseHabit?.(E));const k=E=>{if(E?.pois&&Array.isArray(E.pois)&&E.pois.length>0){const y=E.pois[0],b=y.lonlat.split(/[, ]/).map(Number);if(b.length>=2&&!isNaN(b[0])&&!isNaN(b[1]))return{name:y.name,lon:b[0],lat:b[1],raw:y}}if(E?.area&&E.area.lonlat){const y=E.area,b=y.lonlat.split(/[, ]/).map(Number);if(b.length>=2&&!isNaN(b[0])&&!isNaN(b[1]))return{name:y.name,lon:b[0],lat:b[1],raw:y}}return null},G=kn(async()=>{const E=(g.value||"").trim();if(!E)return;const y=h.tiandituToken||"c25f14fb6bd4397cf8fe45144ff768d6";P.value=!0,x.value=[];try{if(p.value?.searchLocation){const b=await p.value.searchLocation(E,y),T=k(b);T&&(x.value=[T],fe.success(`找到:${T.name||""}`),p.value.flyToLonLatHeight(T.lon,T.lat,5e3))}else{const T=`https://api.tianditu.gov.cn/v2/search?postStr=${encodeURIComponent(JSON.stringify({keyWord:E,level:12,mapBound:"-180,-90,180,90",queryType:1,start:0,count:10}))}&type=query&tk=${encodeURIComponent(y)}`,R=await fetch(T);if(!R.ok)throw new Error(`HTTP ${R.status}`);const O=await R.json(),L=k(O);L&&(x.value=[L],fe.success(`找到:${L.name||""}`),p.value?.flyToLonLatHeight?.(L.lon,L.lat,5e3))}}catch(b){console.error("tianditu search error",b)}finally{P.value=!1}},800);c.watch(g,()=>{G()});const F=()=>{u.value=!1,f("close")};return c.onMounted(()=>{}),(E,y)=>(c.openBlock(),c.createBlock(Pe,{visible:u.value,title:"设置","full-height":i.fullHeight,onClose:F,"onUpdate:visible":y[26]||(y[26]=b=>u.value=b)},{default:c.withCtx(()=>[c.createElementVNode("div",WC,[c.createElementVNode("div",jC,[c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="GIS"}]),onClick:y[0]||(y[0]=b=>m.value="GIS")},"GIS",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="MAP"}]),onClick:y[1]||(y[1]=b=>m.value="MAP")},"地图",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="RENDER"}]),onClick:y[2]||(y[2]=b=>m.value="RENDER")},"渲染",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:m.value==="MOUSE"}]),onClick:y[3]||(y[3]=b=>m.value="MOUSE")},"鼠标",2)]),c.createElementVNode("div",KC,[m.value==="GIS"?(c.openBlock(),c.createElementBlock("div",$C,[c.createElementVNode("div",XC,[y[27]||(y[27]=c.createElementVNode("span",null,"地球 (含大气/日月/星空)",-1)),c.createVNode(c.unref(t),{checked:w.globe,"onUpdate:checked":y[4]||(y[4]=b=>w.globe=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",qC,[y[28]||(y[28]=c.createElementVNode("span",null,"地形 (高程)",-1)),c.createVNode(c.unref(t),{checked:w.terrain,"onUpdate:checked":y[5]||(y[5]=b=>w.terrain=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",JC,[y[29]||(y[29]=c.createElementVNode("span",null,"地形遮挡",-1)),c.createVNode(c.unref(t),{checked:w.depthTest,"onUpdate:checked":y[6]||(y[6]=b=>w.depthTest=b),size:"small"},null,8,["checked"])])])):c.createCommentVNode("",!0),m.value==="MAP"?(c.openBlock(),c.createElementBlock("div",ZC,[c.createElementVNode("div",eE,[c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:A.provider==="tianditu"}]),onClick:y[7]||(y[7]=b=>A.provider="tianditu")},"天地图",2),c.createElementVNode("div",{class:c.normalizeClass(["tab-item",{active:A.provider==="arcgis"}]),onClick:y[8]||(y[8]=b=>A.provider="arcgis")},"ArcGIS",2)]),A.provider==="tianditu"?(c.openBlock(),c.createElementBlock("div",tE,[c.createElementVNode("div",iE,[y[30]||(y[30]=c.createElementVNode("div",{class:"sub-label"},"Token",-1)),c.createVNode(c.unref(o),{value:A.tianditu.token,"onUpdate:value":y[9]||(y[9]=b=>A.tianditu.token=b),size:"small",placeholder:"输入天地图Token"},null,8,["value"])]),c.createElementVNode("div",nE,[y[31]||(y[31]=c.createElementVNode("div",{class:"sub-label"},"地图风格",-1)),c.createVNode(c.unref(l),{value:A.tianditu.layerType,"onUpdate:value":y[10]||(y[10]=b=>A.tianditu.layerType=b),size:"small",style:{width:"100%"}},{default:c.withCtx(()=>[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(N,b=>c.createVNode(c.unref(a),{key:b.value,value:b.value},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(b.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["value"])]),c.createElementVNode("div",sE,[y[32]||(y[32]=c.createElementVNode("span",null,"叠加注记",-1)),c.createVNode(c.unref(t),{checked:A.tianditu.showLabel,"onUpdate:checked":y[11]||(y[11]=b=>A.tianditu.showLabel=b),size:"small"},null,8,["checked"])])])):c.createCommentVNode("",!0),A.provider==="arcgis"?(c.openBlock(),c.createElementBlock("div",oE,[c.createElementVNode("div",rE,[y[33]||(y[33]=c.createElementVNode("div",{class:"sub-label"},"服务地址",-1)),c.createVNode(c.unref(o),{value:A.arcgis.url,"onUpdate:value":y[12]||(y[12]=b=>A.arcgis.url=b),size:"small",placeholder:"输入ArcGIS MapServer地址"},null,8,["value"])])])):c.createCommentVNode("",!0),c.createElementVNode("div",aE,[y[34]||(y[34]=c.createElementVNode("div",{class:"sub-label"},"位置搜索 (天地图)",-1)),c.createElementVNode("div",lE,[c.createVNode(c.unref(o),{value:g.value,"onUpdate:value":y[13]||(y[13]=b=>g.value=b),placeholder:"输入地名搜索",size:"small","allow-clear":""},null,8,["value"])])])])):c.createCommentVNode("",!0),m.value==="RENDER"?(c.openBlock(),c.createElementBlock("div",cE,[c.createElementVNode("div",dE,[y[35]||(y[35]=c.createElementVNode("span",null,"阴影",-1)),c.createVNode(c.unref(t),{checked:C.shadows,"onUpdate:checked":y[14]||(y[14]=b=>C.shadows=b),size:"small"},null,8,["checked"])]),C.shadows?(c.openBlock(),c.createElementBlock("div",hE,[c.createElementVNode("div",uE,"阴影暗度 ("+c.toDisplayString(C.shadowDarkness.toFixed(2))+")",1),c.createVNode(c.unref(r),{value:C.shadowDarkness,"onUpdate:value":y[15]||(y[15]=b=>C.shadowDarkness=b),min:0,max:1,step:.05,size:"small"},null,8,["value"])])):c.createCommentVNode("",!0),c.createElementVNode("div",fE,[y[36]||(y[36]=c.createElementVNode("span",null,"环境贴图 (HDR)",-1)),c.createVNode(c.unref(t),{checked:C.environmentMap,"onUpdate:checked":y[16]||(y[16]=b=>C.environmentMap=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",pE,[y[37]||(y[37]=c.createElementVNode("span",null,"环境光遮蔽 (AO)",-1)),c.createVNode(c.unref(t),{checked:C.ambientOcclusion,"onUpdate:checked":y[17]||(y[17]=b=>C.ambientOcclusion=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",gE,[y[38]||(y[38]=c.createElementVNode("div",{class:"sub-label"},"日期时间",-1)),c.createVNode(c.unref(d),{value:C.time,"onUpdate:value":y[18]||(y[18]=b=>C.time=b),"show-time":"",locale:c.unref(cl),format:"YYYY-MM-DD HH:mm",size:"small",style:{width:"100%"}},null,8,["value","locale"])]),c.createElementVNode("div",mE,[c.createElementVNode("div",AE,"模型亮度 ("+c.toDisplayString(C.brightness.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.brightness,"onUpdate:value":y[19]||(y[19]=b=>C.brightness=b),min:0,max:5,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",yE,[c.createElementVNode("div",CE,"模型对比度 ("+c.toDisplayString(C.contrast.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.contrast,"onUpdate:value":y[20]||(y[20]=b=>C.contrast=b),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",EE,[c.createElementVNode("div",wE,"模型饱和度 ("+c.toDisplayString(C.saturation.toFixed(1))+")",1),c.createVNode(c.unref(r),{value:C.saturation,"onUpdate:value":y[21]||(y[21]=b=>C.saturation=b),min:0,max:3,step:.1,size:"small"},null,8,["value"])]),c.createElementVNode("div",bE,[y[39]||(y[39]=c.createElementVNode("div",{class:"sub-label"},"背景颜色",-1)),c.createElementVNode("div",vE,[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(D,(b,T)=>c.createElementVNode("div",{key:T,style:c.normalizeStyle({background:b,width:"32px",height:"24px",borderRadius:"2px",cursor:"pointer",border:"1px solid #d9d9d9",flexShrink:0}),onClick:R=>C.backgroundColor=b,title:"预设 "+(T+1)},null,12,IE)),64))]),c.createElementVNode("div",BE,[c.withDirectives(c.createElementVNode("input",{type:"color","onUpdate:modelValue":y[22]||(y[22]=b=>B.value=b),style:{width:"40px",height:"24px",padding:"0",border:"1px solid #d9d9d9"}},null,512),[[c.vModelText,B.value]]),c.createVNode(c.unref(o),{value:C.backgroundColor,"onUpdate:value":y[23]||(y[23]=b=>C.backgroundColor=b),size:"small",style:{flex:"1"},placeholder:"CSS 颜色值"},null,8,["value"])])])])):c.createCommentVNode("",!0),m.value==="MOUSE"?(c.openBlock(),c.createElementBlock("div",xE,[c.createElementVNode("div",SE,[y[40]||(y[40]=c.createElementVNode("span",null,"碰撞检测",-1)),c.createVNode(c.unref(t),{checked:v.collision,"onUpdate:checked":y[24]||(y[24]=b=>v.collision=b),size:"small"},null,8,["checked"])]),c.createElementVNode("div",TE,[y[43]||(y[43]=c.createElementVNode("div",{class:"sub-label"},"操作习惯",-1)),c.createVNode(c.unref(n),{value:v.habit,"onUpdate:value":y[25]||(y[25]=b=>v.habit=b),size:"small"},{default:c.withCtx(()=>[c.createVNode(c.unref(s),{value:0},{default:c.withCtx(()=>[...y[41]||(y[41]=[c.createTextVNode("默认 (中键旋转)",-1)])]),_:1}),c.createVNode(c.unref(s),{value:1},{default:c.withCtx(()=>[...y[42]||(y[42]=[c.createTextVNode("习惯1 (左键旋转)",-1)])]),_:1})]),_:1},8,["value"])])])):c.createCommentVNode("",!0)])])]),_:1},8,["visible","full-height"]))}}),[["__scopeId","data-v-79494025"]]),ME={class:"cad-layer-panel"},DE={class:"layer-list-container"},kE={class:"list-header"},PE={class:"col-check"},FE=["checked"],RE={class:"list-body"},OE={class:"col-check"},LE=["checked","onChange"],NE={class:"col-index"},_E=["title"],UE={class:"col-color"},QE=["value"],GE={key:0,class:"empty-text"},HE=Oe(c.defineComponent({__name:"LeitingCadLayer",props:{visible:{type:Boolean,default:!1},currentModelId:{type:String,default:""}},emits:["update:visible","handleCloseCardByCadCard"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods",c.ref({})),o=c.ref(""),r=c.ref([]),l=()=>{s.value&&s.value.getDxfModels&&(r.value=s.value.getDxfModels().map(v=>({modelId:v.modelId,modelName:v.modelName}))||[])},a=c.computed(()=>r.value.map(v=>({value:v.modelId,label:v.modelName}))),d=c.ref([]),h=c.ref([]),f=c.computed(()=>d.value.length>0&&h.value.length===d.value.length),p=({modelId:v})=>{if(d.value=[],h.value=[],s.value&&s.value.getDxfLayers){const S=s.value.getDxfLayers({modelId:v});S&&Object.keys(S).forEach((D,N)=>{S[D].length&&(d.value.push({index:N+1,layerName:D,layerColor:S[D][0].color||"#ffffff",key:D}),h.value.push(D))})}},u=v=>{o.value=v,p({modelId:v})},m=v=>{v.target.checked?h.value=d.value.map(D=>D.key):h.value=[],A()},w=(v,S)=>{S.target.checked?h.value.includes(v)||h.value.push(v):h.value=h.value.filter(N=>N!==v),A()},A=()=>{if(s.value&&s.value.showDxfLayer&&(s.value.showDxfLayer({modelId:o.value,show:!0,layers:h.value}),s.value.getDxfLayers)){const v=s.value.getDxfLayers({modelId:o.value});if(v){const S=Object.keys(v).filter(D=>!h.value.includes(D));s.value.showDxfLayer({modelId:o.value,show:!1,layers:S})}}},C=()=>{n("update:visible",!1),n("handleCloseCardByCadCard")};return c.watch(()=>t.visible,v=>{v&&(l(),t.currentModelId?(o.value=t.currentModelId,p({modelId:t.currentModelId})):a.value.length>0&&(o.value=a.value[0]?.value,p({modelId:o.value})))}),c.watch(()=>t.currentModelId,v=>{v&&t.visible&&(o.value=v,p({modelId:v}))}),(v,S)=>(c.openBlock(),c.createBlock(Pe,{visible:i.visible,title:"CAD图层","onUpdate:visible":S[3]||(S[3]=D=>v.$emit("update:visible",D)),onClose:C,width:360,align:"right","initial-position":{x:0,y:60}},{"header-extra":c.withCtx(()=>[c.createElementVNode("div",{class:"header-select-container",onMousedown:S[2]||(S[2]=c.withModifiers(()=>{},["stop"]))},[S[4]||(S[4]=c.createElementVNode("span",{class:"header-label"},"图纸:",-1)),c.createVNode(c.unref(ge.Select),{value:o.value,"onUpdate:value":S[0]||(S[0]=D=>o.value=D),options:a.value,onChange:S[1]||(S[1]=D=>u(D)),placeholder:"选择模型",style:{width:"140px"},bordered:!1,class:"custom-header-select",popupClassName:"leiting-select-dropdown",size:"small"},null,8,["value","options"])],32)]),default:c.withCtx(()=>[c.createElementVNode("div",ME,[c.createElementVNode("div",DE,[c.createElementVNode("div",kE,[c.createElementVNode("div",PE,[c.createElementVNode("input",{type:"checkbox",checked:f.value,onChange:m},null,40,FE)]),S[5]||(S[5]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),S[6]||(S[6]=c.createElementVNode("div",{class:"col-name"},"图层名称",-1)),S[7]||(S[7]=c.createElementVNode("div",{class:"col-color"},"颜色",-1))]),c.createElementVNode("div",RE,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(d.value,D=>(c.openBlock(),c.createElementBlock("div",{key:D.key,class:"list-item"},[c.createElementVNode("div",OE,[c.createElementVNode("input",{type:"checkbox",checked:h.value.includes(D.key),onChange:N=>w(D.key,N)},null,40,LE)]),c.createElementVNode("div",NE,c.toDisplayString(D.index),1),c.createElementVNode("div",{class:"col-name",title:D.layerName},c.toDisplayString(D.layerName),9,_E),c.createElementVNode("div",UE,[c.createElementVNode("input",{type:"color",value:D.layerColor,disabled:""},null,8,QE)])]))),128)),d.value.length===0?(c.openBlock(),c.createElementBlock("div",GE,"暂无数据")):c.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-a4db4977"]]),YE={class:"adjust-panel"},VE={class:"control-panel"},zE={class:"form-item"},WE={class:"radio-group"},jE={class:"form-item"},KE=["title"],$E={class:"param-row"},XE=["step"],qE={class:"param-row"},JE=["step"],ZE={class:"param-row"},ew=["step"],tw={class:"param-row"},iw=["step"],nw={class:"param-row"},sw=["step"],ow={class:"param-row"},rw=["step"],aw={class:"param-row"},lw=["step"],cw={class:"button-grid"},dw={key:1,class:"pick-mode-ui"},hw=["onClick"],uw=["checked"],fw={style:{"font-size":"12px",color:"#aaa","padding-left":"10px"}},pw={class:"param-row"},gw={style:{width:"40px"}},mw=["onUpdate:modelValue"],Aw={class:"param-row"},yw={style:{width:"40px"}},Cw=["onUpdate:modelValue"],Ew={class:"param-row"},ww={style:{width:"40px"}},bw=["onUpdate:modelValue"],vw={class:"list-panel"},Iw={class:"list-header"},Bw={class:"col-check"},xw=["checked"],Sw={class:"list-body"},Tw={class:"col-check"},Mw=["onUpdate:modelValue"],Dw={class:"col-index"},kw=["title"],Pw={class:"col-main"},Fw=["checked","onChange"],Rw={key:0,style:{padding:"10px","text-align":"center",color:"#999"}},Ow=Oe(c.defineComponent({__name:"LeitingCadPosition",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","handleSavingByCadCard","clearBimPointList","save"],setup(i,{expose:e,emit:t}){const n=i,s=t,o=c.inject("leitingMethods"),r=c.ref([]),l=c.ref(""),a=c.computed(()=>r.value.length>0&&r.value.every(y=>y.selected)),d=c.ref("param"),h=c.ref("bimPoint1"),f=c.ref(null),p=c.ref("bimPoint1"),u=c.reactive({bimPoint1:{longitude:void 0,latitude:void 0,type:"CAD标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0},bimPoint2:{longitude:void 0,latitude:void 0,type:"地图标记点",longitudeText:"经度",latitudeText:"纬度",heightText:"高程",height:void 0}}),m=c.ref(1e-6),w=c.reactive({modelId:"",longitude:0,latitude:0,distance:1e-6,rotation:1,totalRotation:0,heightDistance:1,height:0,lonlat:1e-6,modelOptions:[],selectPoint:{longitude:0,latitude:0,height:0},selectedMode:!1,X:0,Y:0,Z:0}),A=c.computed(()=>{const y=r.value.find(b=>b.modelId===l.value);return y?y.modelName:""}),C=()=>{s("update:visible",!1)},v=()=>(!f.value&&o?.value?.getViewer&&o?.value?.getCesium&&(f.value=new ll(o.value.getViewer(),o.value.getCesium())),f.value),S=()=>{v()?.clearMarkers(),u.bimPoint1.longitude=void 0,u.bimPoint1.latitude=void 0,u.bimPoint1.height=void 0,u.bimPoint2.longitude=void 0,u.bimPoint2.latitude=void 0,u.bimPoint2.height=void 0},D=y=>{const b=h.value,T=u[b];if(T){T.longitude=y.longitude,T.latitude=y.latitude,T.height=y.height;const R=b==="bimPoint1"?"BIM":"MAP";v()?.addMarker(R,y),fe.success(`${T.type}已添加`)}},N=()=>{v()?.registerPickHandler(y=>{D(y)})},I=()=>{v()?.destroyPickHandler()},B=y=>{d.value=y,y!=="pick"&&s("clearBimPointList")};c.watch(()=>d.value,y=>{y==="pick"?N():I()}),c.onUnmounted(()=>{I()});const g=()=>{if(!o?.value?.getDxfModels)return;const y=o.value.getDxfModels();if(Array.isArray(y)?r.value=y.map(b=>({modelId:b.modelId,modelName:b.modelName,formData:b.formData||{},selected:!1,tileset:b})):r.value=[],r.value.length>0){const b=o.value.getCadModelId?o.value.getCadModelId():"";b&&r.value.find(T=>T.modelId===b)?P(b):P(r.value[0].modelId),r.value.forEach(T=>T.selected=!0)}},P=y=>{l.value=y;const b=r.value.find(T=>T.modelId===y);b&&b.formData&&Object.keys(w).forEach(T=>{b.formData[T]!==void 0&&(w[T]=b.formData[T])})},x=(y,b)=>{if(!o?.value?.adjustingModelByCad)return;const T=r.value.find(R=>R.modelId===y);T&&T.tileset&&(T.formData={...T.formData,...b},T.tileset.formData=T.formData,o.value.adjustingModelByCad({...T.formData,tileset:T.tileset}))},k=y=>{if(!l.value)return;const b=w[y];x(l.value,{[y]:b})},_=y=>{const b=r.value.filter(L=>L.selected);if(b.length===0){fe.warning("请先选择要调整的模型");return}const{distance:T,heightDistance:R,rotation:O}=w;b.forEach(L=>{const M={...L.formData};switch(y){case"north":M.latitude+=T;break;case"south":M.latitude-=T;break;case"east":M.longitude+=T;break;case"west":M.longitude-=T;break;case"up":M.height+=R;break;case"down":M.height-=R;break;case"rotateLeft":M.totalRotation=(M.totalRotation||0)-O;break;case"rotateRight":M.totalRotation=(M.totalRotation||0)+O;break}L.modelId===l.value&&Object.assign(w,M),x(L.modelId,M)})},G=y=>{const b=y.target.checked;r.value.forEach(T=>T.selected=b)},F=()=>{s("handleSavingByCadCard",r.value),s("save",r.value)},E=()=>{const y=u.bimPoint1,b=u.bimPoint2;if(y.longitude===void 0||b.longitude===void 0){fe.warning("请先完成点选操作");return}const T=r.value.filter(Q=>Q.selected);if(T.length===0){fe.warning("请先选择要调整的模型");return}let R=0,O=0,L=0;const M=v();if(M){const{dLon:Q,dLat:Y,dHeight:W}=M.calculateOffset(y,b);R=Q,O=Y,L=W}else R=b.longitude-y.longitude,O=b.latitude-y.latitude,L=b.height-y.height;T.forEach(Q=>{const Y={...Q.formData};Y.longitude+=R,Y.latitude+=O,Y.height+=L,Q.modelId===l.value&&Object.assign(w,Y),x(Q.modelId,Y)}),fe.success("位置已调整")};return c.watch(()=>n.visible,y=>{y?g():(I(),S())}),c.onMounted(()=>{n.visible&&g()}),e({setBIMPointsList:({longitude:y,latitude:b,height:T})=>{u[p.value].longitude=y,u[p.value].latitude=b,u[p.value].height=T},addGltfOr3dTilesModelList:y=>{console.warn("addGltfOr3dTilesModelList is deprecated, use internal loading")}}),(y,b)=>(c.openBlock(),c.createBlock(Pe,{visible:n.visible,title:"Cad校准",width:282,height:600,"onUpdate:visible":b[21]||(b[21]=T=>s("update:visible",T)),onClose:C},{default:c.withCtx(()=>[c.createElementVNode("div",YE,[c.createElementVNode("div",VE,[c.createElementVNode("div",zE,[b[22]||(b[22]=c.createElementVNode("label",null,"调整操作:",-1)),c.createElementVNode("div",WE,[c.createElementVNode("span",{class:c.normalizeClass({active:d.value==="param"}),onClick:b[0]||(b[0]=T=>B("param"))},"参数模式",2),c.createElementVNode("span",{class:c.normalizeClass({active:d.value==="pick"}),onClick:b[1]||(b[1]=T=>B("pick"))},"地图点选",2)])]),c.createElementVNode("div",jE,[b[23]||(b[23]=c.createElementVNode("label",null,"当前主模型:",-1)),c.createElementVNode("span",{class:"value",title:A.value},c.toDisplayString(A.value||"未选择"),9,KE)]),b[35]||(b[35]=c.createElementVNode("div",{class:"separator"},null,-1)),d.value==="param"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[b[31]||(b[31]=c.createElementVNode("div",{class:"group-header"},"当前状态",-1)),c.createElementVNode("div",$E,[b[24]||(b[24]=c.createElementVNode("label",null,"经度(东西):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[2]||(b[2]=T=>w.longitude=T),onChange:b[3]||(b[3]=T=>k("longitude")),step:m.value},null,40,XE),[[c.vModelText,w.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",qE,[b[25]||(b[25]=c.createElementVNode("label",null,"纬度(南北):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[4]||(b[4]=T=>w.latitude=T),onChange:b[5]||(b[5]=T=>k("latitude")),step:m.value},null,40,JE),[[c.vModelText,w.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",ZE,[b[26]||(b[26]=c.createElementVNode("label",null,"高度(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[6]||(b[6]=T=>w.height=T),onChange:b[7]||(b[7]=T=>k("height")),step:m.value},null,40,ew),[[c.vModelText,w.height,void 0,{number:!0}]])]),c.createElementVNode("div",tw,[b[27]||(b[27]=c.createElementVNode("label",null,"累计旋转(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[8]||(b[8]=T=>w.totalRotation=T),onChange:b[9]||(b[9]=T=>k("totalRotation")),step:m.value},null,40,iw),[[c.vModelText,w.totalRotation,void 0,{number:!0}]])]),b[32]||(b[32]=c.createElementVNode("div",{class:"separator"},null,-1)),b[33]||(b[33]=c.createElementVNode("div",{class:"group-header"},"调整步长",-1)),c.createElementVNode("div",nw,[b[28]||(b[28]=c.createElementVNode("label",null,"经纬步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[10]||(b[10]=T=>w.distance=T),step:m.value},null,8,sw),[[c.vModelText,w.distance,void 0,{number:!0}]])]),c.createElementVNode("div",ow,[b[29]||(b[29]=c.createElementVNode("label",null,"高度步长(m):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[11]||(b[11]=T=>w.heightDistance=T),step:m.value},null,8,rw),[[c.vModelText,w.heightDistance,void 0,{number:!0}]])]),c.createElementVNode("div",aw,[b[30]||(b[30]=c.createElementVNode("label",null,"旋转步长(°):",-1)),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":b[12]||(b[12]=T=>w.rotation=T),step:m.value},null,8,lw),[[c.vModelText,w.rotation,void 0,{number:!0}]])]),c.createElementVNode("div",cw,[c.createElementVNode("button",{onClick:b[13]||(b[13]=T=>_("rotateLeft"))},"左转"),c.createElementVNode("button",{onClick:b[14]||(b[14]=T=>_("north"))},"北移"),c.createElementVNode("button",{onClick:b[15]||(b[15]=T=>_("rotateRight"))},"右转"),c.createElementVNode("button",{onClick:b[16]||(b[16]=T=>_("west"))},"西移"),c.createElementVNode("button",{onClick:b[17]||(b[17]=T=>_("south"))},"南移"),c.createElementVNode("button",{onClick:b[18]||(b[18]=T=>_("east"))},"东移"),c.createElementVNode("button",{onClick:b[19]||(b[19]=T=>_("up"))},"上移"),c.createElementVNode("button",{onClick:b[20]||(b[20]=T=>_("down"))},"下移"),c.createElementVNode("button",{onClick:F,class:"primary-btn",style:{"grid-column":"span 3","margin-top":"5px"}},"保存当前位置")])],64)):(c.openBlock(),c.createElementBlock("div",dw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(u,(T,R)=>(c.openBlock(),c.createElementBlock("div",{key:R,class:"form-item",style:{display:"block","margin-bottom":"15px"}},[c.createElementVNode("div",{style:{"font-weight":"bold","margin-bottom":"5px",cursor:"pointer",display:"flex","align-items":"center"},onClick:O=>h.value=R},[c.createElementVNode("input",{type:"radio",checked:h.value===R,style:{"margin-right":"5px"}},null,8,uw),c.createTextVNode(" "+c.toDisplayString(T.type)+": ",1)],8,hw),c.createElementVNode("div",fw,[c.createElementVNode("div",pw,[c.createElementVNode("label",gw,c.toDisplayString(T.longitudeText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.longitude=O,readonly:"",style:{width:"100px"}},null,8,mw),[[c.vModelText,T.longitude,void 0,{number:!0}]])]),c.createElementVNode("div",Aw,[c.createElementVNode("label",yw,c.toDisplayString(T.latitudeText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.latitude=O,readonly:"",style:{width:"100px"}},null,8,Cw),[[c.vModelText,T.latitude,void 0,{number:!0}]])]),c.createElementVNode("div",Ew,[c.createElementVNode("label",ww,c.toDisplayString(T.heightText),1),c.withDirectives(c.createElementVNode("input",{type:"number","onUpdate:modelValue":O=>T.height=O,readonly:"",style:{width:"100px"}},null,8,bw),[[c.vModelText,T.height,void 0,{number:!0}]])])])]))),128)),c.createElementVNode("div",{class:"button-grid",style:{"grid-template-columns":"1fr"}},[c.createElementVNode("button",{onClick:E,class:"primary-btn"},"应用校准"),c.createElementVNode("button",{onClick:F},"保存")]),b[34]||(b[34]=c.createElementVNode("div",{class:"instructions",style:{"margin-top":"15px",color:"#999","font-size":"12px","line-height":"1.5"}},[c.createElementVNode("div",null,"操作指南:"),c.createElementVNode("div",null,"1. 勾选上方 CAD 或 地图 标记点选项。"),c.createElementVNode("div",null,"2. Shift + 左键 点击场景拾取对应坐标。"),c.createElementVNode("div",null,"3. 采集两点后,点击“应用校准”进行校准。")],-1))]))]),c.createElementVNode("div",vw,[c.createElementVNode("div",Iw,[c.createElementVNode("div",Bw,[c.createElementVNode("input",{type:"checkbox",checked:a.value,onChange:G},null,40,xw)]),b[36]||(b[36]=c.createElementVNode("div",{class:"col-index"},"序号",-1)),b[37]||(b[37]=c.createElementVNode("div",{class:"col-name"},"名称",-1)),b[38]||(b[38]=c.createElementVNode("div",{class:"col-main"},"主模型",-1))]),c.createElementVNode("div",Sw,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(r.value,(T,R)=>(c.openBlock(),c.createElementBlock("div",{key:T.modelId,class:c.normalizeClass(["list-item",{active:T.modelId===l.value}])},[c.createElementVNode("div",Tw,[c.withDirectives(c.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":O=>T.selected=O},null,8,Mw),[[c.vModelCheckbox,T.selected]])]),c.createElementVNode("div",Dw,c.toDisplayString(R+1),1),c.createElementVNode("div",{class:"col-name",title:T.modelName},c.toDisplayString(T.modelName),9,kw),c.createElementVNode("div",Pw,[c.createElementVNode("input",{type:"radio",name:"mainModel",checked:T.modelId===l.value,onChange:O=>P(T.modelId)},null,40,Fw)])],2))),128)),r.value.length===0?(c.openBlock(),c.createElementBlock("div",Rw,"暂无数据")):c.createCommentVNode("",!0)])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-e8abd49d"]]),Lw={class:"annotation-content"},Nw={class:"annotation-tools"},_w={class:"annotation-controls"},Uw={class:"control-group",title:"颜色"},Qw={class:"tool-item color-tool"},Gw={class:"control-group line-width-container",title:"线宽"},Hw=["onClick"],Yw={class:"option-label"},Vw=Oe(c.defineComponent({__name:"LeitingAnnotationCard",props:{visible:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods"),o=c.ref(""),r=c.ref("#ff0000"),l=c.ref(1),a=c.ref(!1),d=c.ref(null),h=c.ref(null),f=c.ref({top:"0px",left:"0px"}),p=[{value:6,label:"粗"},{value:3,label:"中"},{value:1,label:"细"}],u=()=>s?.value?.getAnnotationInstance?s.value.getAnnotationInstance():null,m=()=>{n("update:visible",!1)},w=B=>{o.value=B;const g=u();if(g)switch(B){case"freehandLine":g.startFreehandLine();break;case"arrow":g.startArrow();break;case"straightLine":g.startStraightLine();break;case"rectangle":g.startRectangle();break;case"ellipse":g.startEllipse();break}},A=()=>{const B=u();B&&(B.setCurrentColor(r.value),B.changeColor(r.value))},C=()=>{if(!a.value&&d.value){const B=d.value.getBoundingClientRect();f.value={top:`${B.top}px`,left:`${B.right+8}px`}}a.value=!a.value},v=B=>{l.value=B,a.value=!1;const g=u();g&&(g.setCurrentWidth(B),g.changeWidth(B))},S=()=>{const B=u();B&&B.deleteSelectedEntity()},D=()=>{const B=u();B&&B.clearAll()},N=()=>{if(s?.value?.saveAnnotations){s.value.saveAnnotations();return}const B=u();B&&B.saveAnnotations()},I=B=>{const g=B.target,P=d.value&&d.value.contains(g),x=h.value&&h.value.contains(g);!P&&!x&&(a.value=!1)};return c.onMounted(()=>{document.addEventListener("click",I)}),c.onUnmounted(()=>{document.removeEventListener("click",I)}),(B,g)=>(c.openBlock(),c.createBlock(Pe,{visible:t.visible,title:"标注",width:70,"min-width":70,height:480,"onUpdate:visible":g[6]||(g[6]=P=>n("update:visible",P)),onClose:m},{default:c.withCtx(()=>[c.createElementVNode("div",Lw,[c.createElementVNode("div",Nw,[c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="freehandLine"}]),onClick:g[0]||(g[0]=P=>w("freehandLine")),title:"手绘线"},[...g[7]||(g[7]=[c.createElementVNode("div",{class:"tool-icon"},"✏️",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="arrow"}]),onClick:g[1]||(g[1]=P=>w("arrow")),title:"箭头"},[...g[8]||(g[8]=[c.createElementVNode("div",{class:"tool-icon"},"↗️",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="straightLine"}]),onClick:g[2]||(g[2]=P=>w("straightLine")),title:"直线"},[...g[9]||(g[9]=[c.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="rectangle"}]),onClick:g[3]||(g[3]=P=>w("rectangle")),title:"矩形"},[...g[10]||(g[10]=[c.createElementVNode("div",{class:"tool-icon"},"▭",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:o.value==="ellipse"}]),onClick:g[4]||(g[4]=P=>w("ellipse")),title:"椭圆"},[...g[11]||(g[11]=[c.createElementVNode("div",{class:"tool-icon"},"⭕",-1)])],2)]),g[13]||(g[13]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",_w,[c.createElementVNode("div",Uw,[c.createElementVNode("div",Qw,[c.createElementVNode("div",{class:"color-swatch",style:c.normalizeStyle({backgroundColor:r.value})},null,4),c.withDirectives(c.createElementVNode("input",{type:"color","onUpdate:modelValue":g[5]||(g[5]=P=>r.value=P),onChange:A,class:"color-input-overlay"},null,544),[[c.vModelText,r.value]])])]),c.createElementVNode("div",Gw,[c.createElementVNode("div",{ref_key:"lineWidthBtnRef",ref:d,class:"tool-item",onClick:c.withModifiers(C,["stop"])},[c.createElementVNode("div",{class:"current-width-preview",style:c.normalizeStyle({height:l.value+"px",backgroundColor:"#fff"})},null,4)],512),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[a.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"dropdownRef",ref:h,class:"line-width-dropdown",style:c.normalizeStyle(f.value)},[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(p,P=>c.createElementVNode("div",{key:P.value,class:c.normalizeClass(["line-width-option",{selected:l.value===P.value}]),onClick:c.withModifiers(x=>v(P.value),["stop"])},[c.createElementVNode("span",Yw,c.toDisplayString(P.label),1),c.createElementVNode("div",{class:"line-preview",style:c.normalizeStyle({height:P.value+"px",backgroundColor:l.value===P.value?"#1890ff":"#ddd"})},null,4)],10,Hw)),64))],4)):c.createCommentVNode("",!0)]))]),g[12]||(g[12]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",{class:"action-buttons"},[c.createElementVNode("button",{class:"control-btn",onClick:S,title:"删除选中"}," 🗑️ "),c.createElementVNode("button",{class:"control-btn",onClick:D,title:"清空"}," ❌ "),c.createElementVNode("button",{class:"control-btn",onClick:N,title:"保存"}," 💾 ")])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-3cfc8415"]]),zw={class:"measure-content"},Ww={class:"measure-tools"},jw={key:0,class:"measure-results"},Kw={class:"result-row"},$w={class:"result-value"},Xw={class:"result-row"},qw={class:"result-value"},Jw={class:"result-row"},Zw={class:"result-value"},eb={class:"result-row"},tb={class:"result-value"},ib={key:1,class:"result-row"},nb={class:"result-value"},sb={key:2,class:"result-row"},ob={class:"result-value"},rb={class:"measure-controls"},ab={class:"control-group",title:"单位"},lb={class:"unit-display"},cb=["onClick"],db=Oe(c.defineComponent({__name:"LeitingMeasurement",props:{visible:{type:Boolean,default:!1}},emits:["update:visible","close"],setup(i,{emit:e}){const t=i,n=e,s=c.inject("leitingMethods",c.ref({})),o=c.ref(null),r=c.ref(null),l=c.ref("m"),a=c.ref(!1),d=c.ref(null),h=c.ref(!1),f=c.ref({}),p=c.ref(null),u=[{label:"米 (m)",value:"m"},{label:"厘米 (cm)",value:"cm"},{label:"毫米 (mm)",value:"mm"}],m=B=>{const g=l.value;return g==="mm"?`${(B*1e3).toFixed(0)}mm`:g==="cm"?`${(B*100).toFixed(1)}cm`:`${B.toFixed(2)}m`},w=B=>B>1e6?`${(B/1e6).toFixed(2)} km²`:`${B.toFixed(2)} m²`,A=()=>{if(!o.value&&s.value?.getViewer){const B=s.value.getViewer(),g=s.value.getCesium();B&&g&&(o.value=new il({viewer:B,cesium:g}),o.value.setUnit(l.value),o.value.setSnapping(a.value),o.value.onMeasure=P=>{d.value=P})}},C=B=>{o.value||A(),r.value===B?(r.value=null,o.value?.stop()):(r.value=B,o.value?.start(B))},v=B=>{l.value=B,h.value=!1},S=()=>{o.value&&(o.value.clearAll(),r.value=null,o.value.stop())},D=()=>{n("update:visible",!1)},N=B=>{if(h.value){h.value=!1;return}const P=B.currentTarget.getBoundingClientRect();f.value={position:"fixed",top:`${P.top}px`,left:`${P.right+5}px`,zIndex:3e3},h.value=!0},I=B=>{h.value&&p.value&&!p.value.contains(B.target)&&(h.value=!1)};return c.onMounted(()=>{document.addEventListener("click",I),t.visible&&c.nextTick(()=>A())}),c.onUnmounted(()=>{document.removeEventListener("click",I),o.value&&o.value.destroy()}),c.watch(()=>t.visible,B=>{B?c.nextTick(()=>A()):o.value&&(o.value.stop(),r.value=null)}),c.watch(s,B=>{B&&B.getViewer&&!o.value&&t.visible&&A()}),c.watch(l,B=>{o.value&&o.value.setUnit(B)}),(B,g)=>(c.openBlock(),c.createBlock(Pe,{visible:t.visible,title:"量算",width:70,"min-width":70,height:480,"onUpdate:visible":g[3]||(g[3]=P=>n("update:visible",P)),onClose:D},{default:c.withCtx(()=>[c.createElementVNode("div",zw,[c.createElementVNode("div",Ww,[c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="distance"}]),onClick:g[0]||(g[0]=P=>C("distance")),title:"距离测量"},[...g[4]||(g[4]=[c.createElementVNode("div",{class:"tool-icon"},"📏",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="angle"}]),onClick:g[1]||(g[1]=P=>C("angle")),title:"角度测量"},[...g[5]||(g[5]=[c.createElementVNode("div",{class:"tool-icon"},"📐",-1)])],2),c.createElementVNode("div",{class:c.normalizeClass(["tool-item",{active:r.value==="area"}]),onClick:g[2]||(g[2]=P=>C("area")),title:"面积测量"},[...g[6]||(g[6]=[c.createElementVNode("div",{class:"tool-icon"},"🔳",-1)])],2)]),g[15]||(g[15]=c.createElementVNode("div",{class:"separator"},null,-1)),d.value?(c.openBlock(),c.createElementBlock("div",jw,[d.value.type==="distance"?(c.openBlock(),c.createElementBlock(c.Fragment,{key:0},[c.createElementVNode("div",Kw,[g[7]||(g[7]=c.createElementVNode("span",{class:"result-label"},"总长:",-1)),c.createElementVNode("span",$w,c.toDisplayString(m(d.value.dist)),1)]),c.createElementVNode("div",Xw,[g[8]||(g[8]=c.createElementVNode("span",{class:"result-label",style:{color:"#ff4d4f"}},"ΔX:",-1)),c.createElementVNode("span",qw,c.toDisplayString(m(d.value.dx)),1)]),c.createElementVNode("div",Jw,[g[9]||(g[9]=c.createElementVNode("span",{class:"result-label",style:{color:"#52c41a"}},"ΔY:",-1)),c.createElementVNode("span",Zw,c.toDisplayString(m(d.value.dy)),1)]),c.createElementVNode("div",eb,[g[10]||(g[10]=c.createElementVNode("span",{class:"result-label",style:{color:"#1890ff"}},"ΔZ:",-1)),c.createElementVNode("span",tb,c.toDisplayString(m(d.value.dz)),1)])],64)):c.createCommentVNode("",!0),d.value.type==="angle"?(c.openBlock(),c.createElementBlock("div",ib,[g[11]||(g[11]=c.createElementVNode("span",{class:"result-label"},"角度:",-1)),c.createElementVNode("span",nb,c.toDisplayString(d.value.angle.toFixed(1))+"°",1)])):c.createCommentVNode("",!0),d.value.type==="area"?(c.openBlock(),c.createElementBlock("div",sb,[g[12]||(g[12]=c.createElementVNode("span",{class:"result-label"},"面积:",-1)),c.createElementVNode("span",ob,c.toDisplayString(w(d.value.area)),1)])):c.createCommentVNode("",!0)])):c.createCommentVNode("",!0),c.createElementVNode("div",rb,[c.createElementVNode("div",ab,[c.createElementVNode("div",{class:"tool-item",onClick:c.withModifiers(N,["stop"])},[c.createElementVNode("div",lb,c.toDisplayString(l.value),1)]),(c.openBlock(),c.createBlock(c.Teleport,{to:"body"},[h.value?(c.openBlock(),c.createElementBlock("div",{key:0,ref_key:"unitDropdownRef",ref:p,class:"unit-dropdown",style:c.normalizeStyle(f.value)},[(c.openBlock(),c.createElementBlock(c.Fragment,null,c.renderList(u,P=>c.createElementVNode("div",{key:P.value,class:c.normalizeClass(["unit-option",{selected:l.value===P.value}]),onClick:c.withModifiers(x=>v(P.value),["stop"])},c.toDisplayString(P.label),11,cb)),64))],4)):c.createCommentVNode("",!0)]))]),g[14]||(g[14]=c.createElementVNode("div",{class:"separator"},null,-1)),c.createElementVNode("div",{class:"action-buttons"},[c.createElementVNode("div",{class:"tool-item control-btn",onClick:S,title:"清空"},[...g[13]||(g[13]=[c.createElementVNode("div",{class:"tool-icon"},"🗑️",-1)])])])])])]),_:1},8,["visible"]))}}),[["__scopeId","data-v-b766acb4"]]);function hb(){const i=c.ref(!1),e=c.reactive({x:0,y:0}),t=c.ref([]),n=c.ref(null);return{visible:i,position:e,items:t,contextData:n,show:(a,d,h)=>{a instanceof MouseEvent?(a.preventDefault(),e.x=a.clientX,e.y=a.clientY):(e.x=a.x,e.y=a.y),t.value=d,n.value=h,i.value=!0},hide:()=>{i.value=!1},addItem:a=>{t.value.push(a)},removeItem:a=>{t.value=t.value.filter(d=>d.id!==a)}}}const ub=["onClick"],fb={class:"menu-label"},pb={key:0,class:"menu-arrow"},gb=Oe(c.defineComponent({__name:"LeitingContextMenu",props:{visible:{type:Boolean},position:{},items:{}},emits:["update:visible","action"],setup(i,{emit:e}){const t=i,n=e,s=r=>{r.disabled||(r.action&&r.action(),n("action",r),n("update:visible",!1))},o=()=>{t.visible&&n("update:visible",!1)};return c.onMounted(()=>{document.addEventListener("click",o),document.addEventListener("contextmenu",r=>{r.target.closest(".leiting-context-menu")||o()})}),c.onUnmounted(()=>{document.removeEventListener("click",o)}),(r,l)=>c.withDirectives((c.openBlock(),c.createElementBlock("div",{class:"leiting-context-menu",style:c.normalizeStyle({left:i.position.x+"px",top:i.position.y+"px"}),onContextmenu:l[0]||(l[0]=c.withModifiers(()=>{},["prevent"]))},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(i.items,a=>(c.openBlock(),c.createElementBlock("div",{key:a.id,class:c.normalizeClass(["menu-item",{"menu-divided":a.divided,"menu-disabled":a.disabled}]),onClick:d=>s(a)},[c.createElementVNode("span",fb,c.toDisplayString(a.label),1),a.children?(c.openBlock(),c.createElementBlock("span",pb,"▶")):c.createCommentVNode("",!0)],10,ub))),128))],36)),[[c.vShow,i.visible]])}}),[["__scopeId","data-v-f288753b"]]),gn=Oe(c.defineComponent({__name:"LeitingBIM",props:{accessToken:{},cesiumUrl:{},cesiumCssUrl:{},methods:{},viewerOptions:{},treeProps:{},showTree:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!1},playerUrl:{default:"https://leiting.chenxisoft.com/resource/person/person.glb"},playerModelName:{default:"Person"},playerModelId:{default:"player_111"},playerScale:{default:.0032},tiandituToken:{default:"c25f14fb6bd4397cf8fe45144ff768d6"},globe:{type:Boolean,default:void 0},terrain:{type:Boolean,default:void 0},depthTest:{type:Boolean,default:void 0},mapProvider:{},tiandituLayerType:{},tiandituShowLabel:{type:Boolean,default:void 0},arcgisUrl:{},teleportTarget:{},shadows:{type:Boolean,default:void 0},environmentMap:{type:Boolean,default:void 0},ambientOcclusion:{type:Boolean,default:void 0},time:{},brightness:{},backgroundColor:{},collision:{type:Boolean,default:void 0},mouseHabit:{},mode:{default:"3d"},mountAll3Dtiles:{},mountAllCad:{},saveRegion:{},saveCadRegion:{},saveCadCalibration:{},selectionChange:{},searchComponent:{}},emits:["register","init","ready"],setup(i,{expose:e,emit:t}){const n=c.ref(),s=c.ref(),o=c.getCurrentInstance(),r=c.ref(!1),l=c.ref(""),a=c.ref({}),d=c.ref("3d"),h=i,f={title:"构件树",treeData:[]},p=c.ref(!1),u=c.ref(!1),m=c.ref(!1),w=c.ref(!1),A=c.ref(!1),C=c.ref(!1),v=c.ref(!1),S=c.ref(!1),D=c.ref(!1),N=c.ref(!1),{visible:I,position:B,items:g,show:P,hide:x}=hb(),k=c.ref([]),_=V=>{k.value.push(V)},G=V=>{k.value=k.value.filter(j=>j.id!==V)},F=c.ref([]),E=c.ref(""),y=c.ref(null),b=c.ref([]),T=c.reactive({tree:!1,section:!1,roam:!1,info:!1,adjustModel:!1,setting:!1,cadLayer:!1,cadPosition:!1,annotation:!1}),R=(V,j)=>{V==="componentTree"&&(V="tree"),V==="componentInfo"&&(V="info"),V in T&&(T[V]=j)},O=c.shallowRef({});c.provide("leitingMethods",O);const L=c.ref(h.showMenu),M=c.ref([]);c.watch(()=>h.showMenu,V=>{L.value=V},{immediate:!0}),c.watch(()=>h.mode,V=>{V&&O.value?.set2d&&O.value.set2d(V==="2d")});const Q=c.ref("dark");c.provide("leiting-theme",Q);const Y=c.ref(h.teleportTarget);c.watch(()=>h.teleportTarget,V=>{Y.value=V});const W=c.ref([]),q=c.computed(()=>{const V=[];return p.value&&(V.push("tree"),V.push("componentTree")),u.value&&V.push("section"),m.value&&V.push("roam"),w.value&&(V.push("info"),V.push("componentInfo")),A.value&&V.push("adjust"),C.value&&V.push("setting"),v.value&&V.push("cadLayer"),S.value&&V.push("cadPosition"),D.value&&V.push("annotation"),N.value&&(V.push("measure"),V.push("measurement")),V.push(...W.value),V}),Z=c.ref(null),oe=(V,j)=>{V==="componentTree"||V==="tree"?p.value=j:V==="section"?u.value=j:V==="roam"?m.value=j:V==="componentInfo"||V==="info"?w.value=j:V==="homeView"?O.value?.is2dMode?.()?O.value?.flyToTopView?.({}):O.value?.getBIMmodelId()?O.value?.flyToTileset?.({}):O.value?.getCadModelId()&&O.value?.flyToTopView?.({}):V==="adjustModel"?(A.value=j,j&&Z.value&&Z.value.setModelType("BIM")):V==="osgbAdjust"?(A.value=j,j&&Z.value&&Z.value.setModelType("OSGB")):V==="setting"?C.value=j:V==="cadLayer"?v.value=j:V==="cadPosition"?S.value=j:V==="annotation"?D.value=j:V==="measurement"?N.value=j:j?W.value.includes(V)||W.value.push(V):W.value=W.value.filter(te=>te!==V)};c.watch(p,async V=>{if(V&&O.value?.loadTreeForModel&&O.value?.getMapTileset){const j=O.value.getMapTileset(),te=Object.values(j).map(async Ae=>{if(Ae.leiting&&Ae.leiting.model?.treeUrl){const Ce=Ae.leiting.model.modelId;try{Ae.leiting?.node?.batchIdEIDInfos||await O.value.loadNodeDetailsForModel(Ce);const Me=await O.value.loadTreeForModel(Ce);Me&&(Array.isArray(Me)?Me:[Me]).forEach(Ne=>{Ne&&!b.value.find(st=>st.id===Ne.id)&&(Ne.modelId=Ce,b.value=[...b.value,Ne])})}catch(Me){console.warn(`Failed to lazy load tree for ${Ce}`,Me)}}});await Promise.all(te)}});const ne=()=>{O.value&&(O.value.getDxfModels&&(F.value=O.value.getDxfModels()||[]),O.value.getCadModelId&&(E.value=O.value.getCadModelId()||""))};let se;c.watch(v,V=>{V&&ne()}),c.watch(S,V=>{V&&(ne(),y.value&&F.value.length&&y.value.addGltfOr3dTilesModelList(F.value))});const pe=t,ve=V=>{O.value&&O.value.saveCadCalibration&&O.value.saveCadCalibration(V),O.value&&O.value.saveCadRegion&&O.value.saveCadRegion(V)};return c.onMounted(async()=>{if(s.value&&fe.setContainer(s.value),!!n.value)try{const V={...mt,cesiumUrl:h.cesiumUrl||mt.cesiumUrl,cesiumCssUrl:h.cesiumCssUrl||mt.cesiumCssUrl,accessToken:h.accessToken||wn()||mt.accessToken};await En(V);const j=h.accessToken||wn()||mt.accessToken;j&&(Cesium.Ion.defaultAccessToken=j),r.value=!0,se=async(Ae={},Ce)=>{if(n.value){const{showMenu:Me,showTree:Le,globe:Ne,terrain:st,depthTest:mn,mapProvider:Ii,tiandituLayerType:jt,tiandituShowLabel:ks,arcgisUrl:yb,shadows:Cb,environmentMap:Eb,ambientOcclusion:wb,time:bb,brightness:vb,backgroundColor:Ib,collision:Bb,mouseHabit:xb,heightBasedZoom:Sb,mode:yl,...Ze}=Ae||{},Tb=h.showMenu!==void 0?h.showMenu:Me!==void 0?Me:!0;L.value=Tb;const De=(X,Ee,We)=>X!==void 0?X:Ee!==void 0?Ee:We,Cl=De(h.globe,Ne,!1),El=De(h.terrain,st,!1),wl=De(h.depthTest,mn,!1),bl=De(h.mapProvider,Ii,"tianditu"),vl=De(h.tiandituLayerType,jt,"img_w"),Il=De(h.tiandituShowLabel,ks,!1),Bl=De(h.arcgisUrl,yb,"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"),xl=De(h.shadows,Cb,!1),Sl=De(h.environmentMap,Eb,!1),Tl=De(h.ambientOcclusion,wb,!1),Ml=De(h.time,bb,void 0),Dl=De(h.brightness,vb,1),An=h.mode||yl||"3d";console.log("LeitingBIM Mode:",An,"Props:",h.mode,"Options:",yl),d.value=An;const Mb=An==="2d"?"#000000":"linear-gradient(0deg, rgb(238, 247, 255) 0%, rgb(178, 218, 244) 70%, rgb(141, 190, 221) 100%)",kl=De(h.backgroundColor,Ib,Mb),Pl=De(h.collision,Bb,!1),Fl=De(h.mouseHabit,xb,0),Rl=De(h.heightBasedZoom,Sb,!1);a.value={globe:Cl,terrain:El,depthTest:wl,mapProvider:bl,tiandituLayerType:vl,tiandituShowLabel:Il,arcgisUrl:Bl,shadows:xl,environmentMap:Sl,ambientOcclusion:Tl,time:Ml,brightness:Dl,backgroundColor:kl,collision:Pl,mouseHabit:Fl,heightBasedZoom:Rl};const Bi=dy({container:n.value,appContext:o?.appContext,methods:{...O.value,handleMenuAction:oe,setCardFullHeight:R,onLoadingStatus:X=>{X?fe.loading(X,"",s.value):fe.close()},...Ze,tilesLoad3dTiles:async X=>{let Ee=X.leiting?.tree;const We=X.leiting?.model?.modelId;if(!Ee&&p.value&&O.value?.loadTreeForModel)try{Ee=await O.value.loadTreeForModel(We)}catch(Si){console.warn("Failed to lazy load tree",Si)}Ee&&(Array.isArray(Ee)?Ee:[Ee]).forEach(Dt=>{Dt&&!b.value.find(Ll=>Ll.id===Dt.id)&&(Dt.modelId=We,b.value=[...b.value,Dt])});const{brightness:Ps,contrast:Fs,saturation:ot}=Bi.methods.getConfigure();Bi.methods.setModelColorAdjustment({brightness:Ps,contrast:Fs,saturation:ot}),Ze.tilesLoad3dTiles?.(X)},mountAll3Dtiles:X=>{h.mountAll3Dtiles&&h.mountAll3Dtiles(X),Ze.mountAll3Dtiles?.(X)},updateModels:X=>{if(Array.isArray(X))if(X.length===0)b.value=[];else{const Ee=X.map(We=>We.modelId);b.value=b.value.filter(We=>Ee.includes(We.modelId))}},mountAllCad:X=>{if(Bi.methods.setModelBrightness){const Ee=h.brightness!==void 0?h.brightness:a.value.brightness;Ee!==void 0&&Bi.methods.setModelBrightness(Ee)}h.mountAllCad&&h.mountAllCad(X),Ze.mountAllCad?.(X)},saveRegion:X=>{h.saveRegion&&h.saveRegion(X),Ze.saveRegion?.(X)},saveCadRegion:X=>{h.saveCadRegion&&h.saveCadRegion(X),Ze.saveCadRegion?.(X)},saveCadCalibration:X=>{h.saveCadCalibration&&h.saveCadCalibration(X),Ze.saveCadCalibration?.(X)},selectionChange:X=>{h.selectionChange&&h.selectionChange(X),Ze.selectionChange?.(X)},onSearchComponent:X=>{h.searchComponent&&h.searchComponent(X),Ze.searchComponent?.(X)}},viewerOptions:h.viewerOptions,options:{...Ze,mode:An,playerUrl:h.playerUrl,playerModelName:h.playerModelName,playerModelId:h.playerModelId,playerScale:h.playerScale,globe:Cl,terrain:El,depthTest:wl,mapProvider:bl,tiandituLayerType:vl,tiandituShowLabel:Il,tiandituToken:h.tiandituToken,arcgisUrl:Bl,shadows:xl,environmentMap:Sl,ambientOcclusion:Tl,time:Ml,brightness:Dl,backgroundColor:kl,collision:Pl,mouseHabit:Fl,heightBasedZoom:Rl},callbacks:{onLoading:X=>X?fe.loading(X,"",s.value):fe.close(),onSuccess:X=>fe.success(X,"",void 0,s.value),onError:X=>fe.error(X,"",void 0,s.value)}}),{Cesium:Mt,viewer:Kt,methods:yn,menuEvents:xi}=Bi,le=yn;xi.on("showMenu",X=>{L.value=X}),xi.on("insertMenu",X=>{M.value=[...M.value,...X]}),xi.on("setMenuActive",(X,Ee)=>{oe(X,Ee)}),O.value=le,Ce&&(Ce.value=le),xi.on("setMode",X=>{d.value=X}),xi.on("deleteAllModels",()=>{b.value=[]}),new Mt.ScreenSpaceEventHandler(Kt.scene.canvas).setInputAction(async X=>{if(x(),d.value==="2d")return;const Ee=Kt.scene.pick(X.position),We=Kt.container.getBoundingClientRect(),Ps=We.left+X.position.x,Fs=We.top+X.position.y,ot=[];if(Mt.defined(Ee)&&Ee instanceof Mt.Cesium3DTileFeature){const Si=le.baseCompt.getFeatureId(Ee),Dt=ai(Ee.tileset);le.baseCompt.hasSelectedFeaturesMap[Dt]?.some(Ti=>Ti.batchId===Si&&Ti.rank===0)||(await le.baseCompt.clearSelection(),await le.baseCompt.toggleMultiSelect(Dt,Si,le.baseCompt.selectedColor)),ot.push({id:"details",label:"构件详情",action:()=>{w.value=!0}}),ot.push({id:"hide",label:"隐藏选中构件",action:async()=>{const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,show:!1}));le.baseCompt.setComponentVisibility(Mi)}}),ot.push({id:"translucent",label:"半透明选中构件",action:async()=>{const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,rgba:{...rt.rgba,a:.3}}));await le.baseCompt.setSelectColorUserModelCpt(Mi,{rank:0})}}),ot.push({id:"isolate",label:"隔离选中构件",divided:!0,action:async()=>{await le.baseCompt.loadAllNodeDetailsForModel();const Mi=(await le.baseCompt.getSelected()).map(rt=>({elementId:rt.elementId,modelId:rt.modelId,show:!0}));le.isolateComponents(Mi)}})}ot.push({id:"showAll",label:"显示所有",action:async()=>{le.baseCompt.setAllComponentsVisibility(!0),await le.baseCompt.clearSelection()}}),ot.push(...k.value),P({x:Ps,y:Fs},ot)},Mt.ScreenSpaceEventType.RIGHT_CLICK),le.addContextMenuItems=_,le.insertContextMenu=le.addContextMenuItems,le.removeContextMenuItems=G,le.deleteContextMenu=le.removeContextMenuItems,le.closeContextMenu=x,le.hideContextMenu=le.closeContextMenu,le.onSetTeleportTarget=X=>{Y.value=X},await c.nextTick();const Ol=Ae?.onLoaded||Ae?.onloaded;Ol&&Ol({Cesium:Mt,viewer:Kt,methods:yn}),pe("init",{Cesium:Mt,viewer:Kt,methods:yn}),pe("ready",{Cesium:Mt,viewer:Kt,methods:yn})}};let te=!1;pe("register",(Ae,Ce)=>{te=!0,se(Ae,Ce)}),te||setTimeout(()=>{O.value.getViewer||se()},0)}catch(V){l.value="Failed to load Cesium: "+(V.message||V),console.error(V)}}),c.onUnmounted(()=>{fe.setContainer(null)}),e({initMap:()=>O.value,initializeViewer:(V,j)=>se(V,j)}),(V,j)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(["leiting-bim-container",[`theme-${Q.value}`]]),onContextmenu:j[11]||(j[11]=c.withModifiers(()=>{},["prevent","stop"]))},[!r.value&&!l.value?(c.openBlock(),c.createBlock(c.unref(ge.Spin),{key:0,class:"loading",size:"large",tip:"加载基础组件中..."})):c.createCommentVNode("",!0),l.value?(c.openBlock(),c.createBlock(c.unref(ge.Alert),{key:1,class:"error",type:"error",message:l.value,"show-icon":""},null,8,["message"])):c.createCommentVNode("",!0),c.createElementVNode("div",{ref_key:"containerRef",ref:n,class:"cesium-viewer"},[c.createVNode(yi,{visible:L.value,"active-ids":q.value,"custom-items":M.value,onAction:oe,"is-2d":d.value==="2d"},null,8,["visible","active-ids","custom-items","is-2d"]),(c.openBlock(),c.createBlock(c.Teleport,{to:Y.value||"body",disabled:!Y.value},[c.createElementVNode("div",{ref_key:"uiOverlayRef",ref:s,class:"leiting-ui-overlay"},[c.createVNode(wi,{visible:w.value,"full-height":T.info,"onUpdate:visible":j[0]||(j[0]=te=>w.value=te)},null,8,["visible","full-height"]),c.createVNode(bi,{ref_key:"LeitingPositionRef",ref:Z,visible:A.value,"full-height":T.adjustModel,"onUpdate:visible":j[1]||(j[1]=te=>A.value=te)},null,8,["visible","full-height"]),c.createVNode(vi,{visible:C.value,"full-height":T.setting,"tianditu-token":h.tiandituToken,"initial-config":a.value,"onUpdate:visible":j[2]||(j[2]=te=>C.value=te)},null,8,["visible","full-height","tianditu-token","initial-config"]),i.showTree!==!1?(c.openBlock(),c.createBlock(an,c.mergeProps({key:0},{...f,...i.treeProps},{visible:p.value,"full-height":T.tree,"tree-data":b.value.length>0?b.value:i.treeProps?.treeData||[],"onUpdate:visible":j[3]||(j[3]=te=>{p.value=te})}),null,16,["visible","full-height","tree-data"])):c.createCommentVNode("",!0),c.createVNode(Vw,{visible:D.value,"onUpdate:visible":j[4]||(j[4]=te=>D.value=te)},null,8,["visible"]),c.createVNode(db,{visible:N.value,"onUpdate:visible":j[5]||(j[5]=te=>N.value=te)},null,8,["visible"]),c.createVNode(Ci,{visible:u.value,"full-height":T.section,"onUpdate:visible":j[6]||(j[6]=te=>u.value=te)},null,8,["visible","full-height"]),c.createVNode(Ei,{visible:m.value,"full-height":T.roam,"onUpdate:visible":j[7]||(j[7]=te=>m.value=te)},null,8,["visible","full-height"]),c.createVNode(HE,{visible:v.value,"current-model-id":E.value,"onUpdate:visible":j[8]||(j[8]=te=>v.value=te)},null,8,["visible","current-model-id"]),c.createVNode(Ow,{ref_key:"cadPositionRef",ref:y,visible:S.value,"onUpdate:visible":j[9]||(j[9]=te=>S.value=te),onSave:ve},null,8,["visible"]),c.createVNode(gb,{visible:c.unref(I),position:c.unref(B),items:c.unref(g),"onUpdate:visible":j[10]||(j[10]=te=>I.value=te)},null,8,["visible","position","items"]),c.renderSlot(V.$slots,"default",c.normalizeProps(c.guardReactiveProps({methods:O.value,isReady:r.value})),void 0,!0)],512)],8,["to","disabled"]))],512)],34))}}),[["__scopeId","data-v-2c7554a8"]]);function Al(i){const e=c.ref(),t=c.ref(i.theme||"dark"),n=c.ref(i.menuSize||"medium");c.provide("leiting-theme",t),c.provide("leiting-menu-size",n);function s(l){c.onUnmounted(()=>{e.value=null}),l(i,e)}function o(){const l=c.unref(e);return l||console.error("未获取到leiting实例!"),l}const r=new Proxy({},{get(l,a){const d=o();if(!d)return;const h=d[a];return typeof h=="function"?h.bind(d):h},set(l,a,d){const h=o();return h?(h[a]=d,!0):!1}});return[s,r]}const mb=mt,Ab={install:(i,e)=>{if(i.component("LeitingBIM",gn),i.component("LeitingTree",an),i.component("LeitingDraggableCard",Pe),i.component("leiting-draggable-card",Pe),i.component("LeitingMenu",yi),i.component("leiting-menu",yi),i.component("LeitingSection",Ci),i.component("leiting-section",Ci),i.component("LeitingPlayer",Ei),i.component("leiting-player",Ei),i.component("LeitingInfo",wi),i.component("leiting-info",wi),i.component("LeitingPosition",bi),i.component("leiting-position",bi),i.component("LeitingSetting",vi),i.component("leiting-setting",vi),!e)return;const t={...mb,...e};t.cesiumUrl&&En(t).catch(n=>{console.error("[LeitingBim] Failed to load Cesium resources:",n)}),i.config.globalProperties.$leitingBimOptions=t}};U.DEFAULT_CESIUM_CONFIG=mt,U.LeiTingBIM=gn,U.LeiTingDraggableCard=Pe,U.LeiTingInfo=wi,U.LeiTingMenu=yi,U.LeiTingPlayer=Ei,U.LeiTingPosition=bi,U.LeiTingSection=Ci,U.LeiTingSetting=vi,U.LeiTingTree=an,U.LeitingBIM=gn,U.LeitingDraggableCard=Pe,U.LeitingInfo=wi,U.LeitingMenu=yi,U.LeitingPlayer=Ei,U.LeitingPosition=bi,U.LeitingSection=Ci,U.LeitingSetting=vi,U.LeitingTree=an,U.default=Ab,U.getAccessToken=wn,U.leitingBim=gn,U.loadCesium=En,U.useLeiTing=Al,U.useLeiting=Al,U.waitForCesium=Ql,Object.defineProperties(U,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));