@geoscene/core 4.34.9 → 4.34.11
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.
- package/LICENSE.md +18 -18
- package/analysis/ViewshedVideo.js +5 -0
- package/analysis/viewshedVideo/ViewshedAnalysisView3DVideo.js +5 -0
- package/analysis/viewshedVideo/ViewshedComputedDataVideo.js +5 -0
- package/analysis/viewshedVideo/ViewshedSubVisualizationVideo.js +5 -0
- package/analysis/viewshedVideo/ViewshedVisualizationVideo.js +5 -0
- package/analysis/viewshedVideo/render/ViewshedTechniqueVideo.js +5 -0
- package/analysis/viewshedVideo/render/ViewshedVideo.glsl.js +243 -0
- package/analysis/viewshedVideo/render/ViewshedVideo.js +5 -0
- package/assets/geoscene/core/workers/chunks/0f735b0dec173142f3b6.js +1 -1
- package/assets/geoscene/core/workers/chunks/3a457e718a901a45902e.js +1 -1
- package/assets/geoscene/core/workers/chunks/49571d6875de1f2e7e25.js +32 -32
- package/assets/geoscene/core/workers/chunks/7565b382f6b3d2cb46a3.js +1 -1
- package/assets/geoscene/core/workers/chunks/9ff8ee6ed6b98c03ae7e.js +1 -1
- package/assets/geoscene/core/workers/chunks/aa78b69219d9a0ef1c54.js +1 -1
- package/assets/geoscene/core/workers/chunks/ce16489cf7eb0d78c741.js +1 -1
- package/assets/geoscene/core/workers/chunks/d6e0528eacee7ea4c1ce.js +1 -1
- package/assets/geoscene/core/workers/chunks/f651c05604eab83aef5f.js +1 -1
- package/bundle/lib/fflate.js +12 -0
- package/copyright.txt +1654 -1654
- package/layers/mixins/SceneService.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterFormats/ImageCanvasDecoder.js +1 -1
- package/layers/support/rasterFormats/RasterCodec.js +1 -1
- package/layers/voxel/drill/VoxelContinuousDrill.js +5 -0
- package/layers/voxel/drill/VoxelDiscreteDrill.js +5 -0
- package/layers/voxel/drill/common.js +5 -0
- package/package.json +30 -30
- package/views/3d/analysis/analysisViewModuleImportUtils.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/ViewshedLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/support/LayerViewAnalysisViewManager.js +1 -1
- package/views/draw/expert/AttackArrowDrawer.js +5 -0
- package/views/draw/expert/AttackTailedArrowDrawer.js +5 -0
- package/views/draw/expert/BaseDrawer.js +5 -0
- package/views/draw/expert/Constant.js +5 -0
- package/views/draw/expert/CurveDrawer.js +5 -0
- package/views/draw/expert/CurveFlagDrawer.js +5 -0
- package/views/draw/expert/CurvedArrowDrawer.js +5 -0
- package/views/draw/expert/EllipseDrawer.js +5 -0
- package/views/draw/expert/ExpertDraw.js +5 -0
- package/views/draw/expert/GatheringPlaceDrawer.js +5 -0
- package/views/draw/expert/LuneDrawer.js +5 -0
- package/views/draw/expert/PincerArrowDrawer.js +5 -0
- package/views/draw/expert/SectorDrawer.js +5 -0
- package/views/draw/expert/SquadCombatDrawer.js +5 -0
- package/views/draw/expert/StraightArrowDrawer.js +5 -0
- package/views/draw/expert/TailedSquadCombatDrawer.js +5 -0
- package/views/draw/expert/plot/Constants.js +5 -0
- package/views/draw/expert/plot/PlotTypes.js +5 -0
- package/views/draw/expert/plot/plots/Arc.js +41 -0
- package/views/draw/expert/plot/plots/AssaultDirection.js +15 -0
- package/views/draw/expert/plot/plots/AttackArrow.js +5 -0
- package/views/draw/expert/plot/plots/Circle.js +5 -0
- package/views/draw/expert/plot/plots/ClosedCurve.js +5 -0
- package/views/draw/expert/plot/plots/Curve.js +5 -0
- package/views/draw/expert/plot/plots/CurveFlag.js +5 -0
- package/views/draw/expert/plot/plots/CurvedArrow.js +5 -0
- package/views/draw/expert/plot/plots/DoubleArrow.js +5 -0
- package/views/draw/expert/plot/plots/Ellipse.js +5 -0
- package/views/draw/expert/plot/plots/FineArrow.js +5 -0
- package/views/draw/expert/plot/plots/FreehandLine.js +19 -0
- package/views/draw/expert/plot/plots/FreehandPolygon.js +19 -0
- package/views/draw/expert/plot/plots/GatheringPlace.js +5 -0
- package/views/draw/expert/plot/plots/Lune.js +5 -0
- package/views/draw/expert/plot/plots/Marker.js +16 -0
- package/views/draw/expert/plot/plots/Plot.js +5 -0
- package/views/draw/expert/plot/plots/Polygon.js +18 -0
- package/views/draw/expert/plot/plots/Polyline.js +19 -0
- package/views/draw/expert/plot/plots/Rectangle.js +28 -0
- package/views/draw/expert/plot/plots/Sector.js +5 -0
- package/views/draw/expert/plot/plots/SquadCombat.js +5 -0
- package/views/draw/expert/plot/plots/StraightArrow.js +5 -0
- package/views/draw/expert/plot/plots/TailedAttackArrow.js +5 -0
- package/views/draw/expert/plot/plots/TailedSquadCombat.js +5 -0
- package/views/draw/expert/plot/utils/plot_util.js +5 -0
package/LICENSE.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# Licensing
|
|
2
|
-
|
|
3
|
-
易智瑞信息技术有限公司版权所有 © 2025并保留所有权利。发行于中华人民共和国。
|
|
4
|
-
|
|
5
|
-
本材料在 GeoScene 主许可协议(MLA)下许可使用,并受该协议条款的约束。
|
|
6
|
-
只要遵守主许可协议中的条款并包括此版权声明,您即可在不进行修改的情况下
|
|
7
|
-
重新分发和使用这些代码。
|
|
8
|
-
|
|
9
|
-
查看 https://links.geoscene.cn/legal/full-master-agreement 了解使用限制
|
|
10
|
-
|
|
11
|
-
更多信息可以联系:
|
|
12
|
-
|
|
13
|
-
易智瑞信息技术有限公司 (GeoScene Information Technology Co. Ltd.)
|
|
14
|
-
电话: 010-57632288
|
|
15
|
-
传真: 010-57632299
|
|
16
|
-
热线: 400-819-2881
|
|
17
|
-
Email: info@geoscene.cn
|
|
18
|
-
网址: www.geoscene.cn
|
|
1
|
+
# Licensing
|
|
2
|
+
|
|
3
|
+
易智瑞信息技术有限公司版权所有 © 2025并保留所有权利。发行于中华人民共和国。
|
|
4
|
+
|
|
5
|
+
本材料在 GeoScene 主许可协议(MLA)下许可使用,并受该协议条款的约束。
|
|
6
|
+
只要遵守主许可协议中的条款并包括此版权声明,您即可在不进行修改的情况下
|
|
7
|
+
重新分发和使用这些代码。
|
|
8
|
+
|
|
9
|
+
查看 https://links.geoscene.cn/legal/full-master-agreement 了解使用限制
|
|
10
|
+
|
|
11
|
+
更多信息可以联系:
|
|
12
|
+
|
|
13
|
+
易智瑞信息技术有限公司 (GeoScene Information Technology Co. Ltd.)
|
|
14
|
+
电话: 010-57632288
|
|
15
|
+
传真: 010-57632299
|
|
16
|
+
热线: 400-819-2881
|
|
17
|
+
Email: info@geoscene.cn
|
|
18
|
+
网址: www.geoscene.cn
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.33/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import{featureReferenceEquals as r}from"../analysis/featureReferenceUtils.js";import{equalsMaybe as a}from"../core/maybe.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import geosceneError from"../core/Error.js";import{Texture}from"../views/3d/webgl-engine/lib/Texture.js";import VideoElement from"../layers/support/VideoElement.js";import Color from"../Color.js";import Viewshed from"../analysis/Viewshed.js";async function loadVideo(b){if(b instanceof HTMLVideoElement||b instanceof ImageData){return b}const videoParamTemp=new VideoElement({video:b,});await videoParamTemp.load();return videoParamTemp.content}function formatColor(b){return b instanceof Color?b:new Color(b)}let u=class extends(Viewshed){constructor(s){super(s);this._texture=undefined;this._type='video';this._limitHorizontal=90.0;this._limitVertical=60.0;this._textureVertical=1.0;this._parameters={opacity:0.7,fisheyeLens:false,frustum:false,shadowColor:[0,0,0,0.5],trimmingVertical:0.0,...s,}}get textureVertical(){return this._textureVertical}get limitHorizontal(){return this._limitHorizontal}get limitVertical(){return this._limitVertical}set fisheyeLens(fisheye){this._parameters.fisheyeLens=fisheye}get fisheyeLens(){return this._parameters?.fisheyeLens}get type(){return this._type}get parameters(){return this._parameters}get texture(){return this._texture}set texture(tex){this._texture=tex}get video(){return this.texture?._data}get opacity(){return this._texture?._parameters.opacity}set opacity(opa){if(this._texture){this._texture._parameters.opacity=opa}}async loadVideo(videoUrl){if(!videoUrl){throw new Error("请传入视频地址")}const video=await loadVideo(videoUrl);const width=video instanceof HTMLImageElement?video.naturalWidth:video.width,height=video instanceof HTMLImageElement?video.naturalHeight:video.height;if("getFrame"in video)throw new geosceneError("media-layer-view-3d","animation is not supported");const{opacity,fisheyeLens,view}=this.parameters;const shadowColorTemp=formatColor(this.parameters.shadowColor)?.toRgba();const shadowColor=shadowColorTemp.slice(0,3);const shadowOpacity=shadowColorTemp[3];this.texture=new Texture(video,{wrap:{s:33071,t:33071},preMultiplyAlpha:!0,width,height,mipmap:!0,reloadable:!0,opacity,fisheyeLens,shadowColor,shadowOpacity,textureVertical:this.textureVertical,view,updateCallback:function(){return view.basemapTerrain.overlayManager.requestRender()}});return this.texture}equals(e){return a(this.observer,e.observer)&&this.farDistance===e.farDistance&&this.heading===e.heading&&this.tilt===e.tilt&&this.horizontalFieldOfView===e.horizontalFieldOfView&&this.verticalFieldOfView===e.verticalFieldOfView&&this.trimmingVertical===e.trimmingVertical&&this.frustum===e.frustum&&r(this.feature,e.feature)}clearVideo(){this._texture?._data?.pause();this._texture?._data?.remove()}destroy(){this.clearVideo();this._texture?.unload();this._texture?.dispose();super.destroy()}};e([l({type:Number,nonNullable:!0,range:{min:-10,max:10},json:{write:{isRequired:!0}}})],u.prototype,"trimmingVertical",void 0),e([l({type:Boolean,})],u.prototype,"frustum",void 0),u=e([p("geoscene.analysis.ViewshedVideo")],u);export{u as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import{getFeatureId as t,updatePointsFromFeatureReference as s}from"../../analysis/featureReferenceUtils.js";import"../../core/has.js";import i from"../../core/Logger.js";import{mapCollection as r}from"../../core/mapCollectionUtils.js";import{abortMaybe as o,destroyMaybe as a}from"../../core/maybe.js";import{watch as d,initial as n,when as l,syncAndInitial as h}from"../../core/reactiveUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{d as u,q as m}from"../../chunks/vec32.js";import{create as v}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{canProjectWithoutEngine as w,isLoaded as f,projectOrLoad as V}from"../../geometry/projectionUtils.js";import{projectBoundingRect as y}from"../../geometry/projection/projectBoundingRect.js";import{empty as _,containsPoint as g}from"../../geometry/support/aaBoundingRect.js";import{AnalysisView3D as j}from"../../views/3d/analysis/AnalysisView3D.js";import{logFailedGeometryProjectionError as R}from"../../views/3d/analysis/support/projectionUtils.js";import{ViewshedComputedDataVideo as b}from"../../analysis/viewshedVideo/ViewshedComputedDataVideo.js";import D from"../../views/3d/analysis/Viewshed/ViewshedTool.js";import{ViewshedVisualizationVideo as C}from"../../analysis/viewshedVideo/ViewshedVisualizationVideo.js";import{Intersector as F}from"../../views/3d/webgl-engine/lib/Intersector.js";import{ViewshedVideo as H}from"../../analysis/viewshedVideo/render/ViewshedVideo.js";import{connectAnalysisViewToTool as O,removeAnalysisViewTool as U,startPlaceOperation as S}from"../../views/analysis/analysisViewUtils.js";let A=class extends j{constructor(e){super(e),this.type="viewshed-view-3d",this.analysis=null,this.tool=null,this._selectedViewshed=null,this.viewshedComputedDataHandles=null,this.userOperation=null,this._viewshedRenderNode=null,this._intersector=null}get visible(){return super.visible}set visible(e){super.visible=e}get interactive(){return super.interactive}set interactive(e){super.interactive=e}get selectedViewshed(){return this._selectedViewshed}set selectedViewshed(e){this._unselectOtherViewsheds(e),this._selectedViewshed=e}get selectedViewshedComputedData(){return this.tool?.selectedViewshedComputedData}get _isDecoration(){return!this.parent}initialize(){const e=this.view;this._viewshedRenderNode=new H({view:e,selectedViewshed:()=>this.selectedViewshed??this.tool?.stagedViewshed,isDecoration:this._isDecoration}),this._intersector=new F(this.view.state.viewingMode),this._intersector.options.hud=!1,this._intersector.options.store=0,this.viewshedComputedDataHandles=r(()=>this.analysis.viewsheds,t=>{const s=new b({renderCoordsHelper:e.renderCoordsHelper,viewshed:t}),r=Symbol();return this.addHandles([d(()=>({valid:s.valid,canProject:w(s.observer?.spatialReference,this.view.spatialReference)||f()}),({valid:e,canProject:t},r)=>{this.visible&&(e&&t?this._addViewshedsToRenderer(s):r?.valid&&r?.canProject&&this._removeViewshedsFromRenderer(s),t||R(this.analysis,s.observer.spatialReference,i.getLogger(this)))},n),...this._createFeatureReferenceHandles(s)],r),{viewshedComputedData:s,remove:()=>{this.removeHandles(r),this._removeViewshedsFromRenderer(s),s.destroy()}}}),this._visualization=new C({view:e,analysisViewData:this,isDecoration:this._isDecoration}),this.addHandles([d(()=>this.visible,e=>{const t=this.viewshedComputedDataHandles;if(null==t)return;e||(this.selectedViewshed=null);const s=t.map(e=>e.viewshedComputedData).filter(e=>e.valid).toArray();e?this._addViewshedsToRenderer(s):this._removeViewshedsFromRenderer(s)}),d(()=>e.renderCoordsHelper,e=>{this.viewshedComputedDataHandles?.forEach(({viewshedComputedData:t})=>t.renderCoordsHelper=e)}),O(this,D),l(()=>this.interactive,()=>{this._unselectOtherViewsheds(this.selectedViewshed)},h)])}destroy(){this.userOperation=o(this.userOperation),U(this),this._visualization=a(this._visualization);const e=this.viewshedComputedDataHandles;null!=e&&this._removeViewshedsFromRenderer(e.map(e=>e.viewshedComputedData).toArray())}_createFeatureReferenceHandles(e){const{view:t}=this;return[d(()=>[t.state.camera,t.slice.plane,e.viewshed.observer,e.targetRenderSpace,e.verticalFieldOfView,e.horizontalFieldOfView,e.feature],()=>{this._updateObserverFromFeature(t,e)},n),this._createElevationUpdateHandle(e),l(()=>e.needUpdateByFeature,()=>{this._updateObserverFromFeature(t,e),e.needUpdateByFeature=!1})]}_createElevationUpdateHandle(e){const t=(s,i)=>{const{view:r}=this,{observer:o}=e;if(null==o)return;const a=V(o,r.spatialReference);if(null!=a.pending)return void a.pending.finally(()=>t(s,i));const d=a.geometry;null!=d&&(y(s,i,z,r.spatialReference),g(z,[d.x,d.y])&&(e.needUpdateByFeature=!0))};return this.view.elevationProvider.on("elevation-change",({extent:e,spatialReference:s})=>t(e,s))}async createViewsheds(e){await S(this,{placementOptions:e,onToolActivated:e=>e.place("multiple")})}place(e){return S(this,{placementOptions:e,onToolActivated:e=>e.place("single")})}_addViewshedsToRenderer(e){this._viewshedRenderNode.updateViewsheds({adds:e})}_removeViewshedsFromRenderer(e){this._viewshedRenderNode.updateViewsheds({removes:e})}_updateObserverFromFeature(e,i){const r=i.observerRenderSpace,o=i.targetRenderSpace,a=u(v(),r),d={observer:r,observerSurfaceNormal:null,observerAdjusted:a,observerFeatureId:t(i.feature),target:o,targetSurfaceNormal:null,targetAdjusted:u(v(),o),targetFeatureId:null};s(e,this._intersector,d,e=>Math.min(e,.05*i.farDistanceRenderSpace)),i.observerRenderSpaceOverride=m(a,r)?null:a}_unselectOtherViewsheds(e){if(null!=e)for(const t of this.view.tools.items)t!==this.tool&&t instanceof D&&(t.analysisViewData.selectedViewshed=null)}get test(){}};e([p({readOnly:!0})],A.prototype,"type",void 0),e([p({constructOnly:!0,nonNullable:!0})],A.prototype,"analysis",void 0),e([p()],A.prototype,"tool",void 0),e([p()],A.prototype,"_selectedViewshed",void 0),e([p()],A.prototype,"selectedViewshed",null),e([p()],A.prototype,"selectedViewshedComputedData",null),e([p()],A.prototype,"viewshedComputedDataHandles",void 0),e([p()],A.prototype,"userOperation",void 0),e([p()],A.prototype,"_visualization",void 0),e([p()],A.prototype,"_viewshedRenderNode",void 0),A=e([c("geoscene.views.3d.analysis.ViewshedAnalysisView3DVideo")],A);const N=A,z=_();export{N as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{deg2rad as r}from"../../core/mathUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{create as s}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as n,g as l,h,i as a,n as p,u as c}from"../../chunks/vec32.js";import{create as d,fromArray as f,fromValues as u}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import v from"../../geometry/Point.js";import{rotateBy as g}from"../../views/3d/analysis/Viewshed/viewshedToolUtils.js";var S;let m=S=class extends t{constructor(e){super(e),this.observerRenderSpaceOverride=null,this.needUpdateByFeature=!1}get observer(){return this.viewshed.observer??new v}get effectiveObserverRenderSpace(){return this.observerRenderSpaceOverride??this.observerRenderSpace}get effectiveObserver(){return this.renderSpaceToPoint(this.effectiveObserverRenderSpace,this.observer.spatialReference)}get effectiveTargetRenderSpace(){return this._computeTargetRenderSpace(this.effectiveObserverRenderSpace)}get farDistance(){return this.viewshed.farDistance}get farDistanceRenderSpace(){return this.farDistance/this.metersPerUnit}get heading(){return this.viewshed.heading}get tilt(){return this.viewshed.tilt}get feature(){return this.viewshed.feature}get tiltParallelToSurface(){return this.tilt-90}get horizontalFieldOfView(){return this.viewshed.horizontalFieldOfView}get verticalFieldOfView(){return this.viewshed.verticalFieldOfView}get observerRenderSpace(){return this._pointToRenderSpace(this.observer,d())}get target(){const e=this.targetRenderSpace;return this.renderSpaceToPoint(e,this.observer.spatialReference)}get targetRenderSpace(){return this._computeTargetRenderSpace(this.observerRenderSpace)}get targetDirection(){const e=n(d(),this.targetRenderSpace,this.observerRenderSpace);return p(e,e)}get tiltedUpVector(){const e=g(d(),this.upVector,-r(this.tiltParallelToSurface),this.leftVector);return p(e,e)}get _basis(){return this.renderCoordsHelper.basisMatrixAtPosition(this.observerRenderSpace,s())}get upVector(){const e=this._basis;return u(e[8],e[9],e[10])}get northVector(){const e=this._basis;return u(e[4],e[5],e[6])}get leftVector(){const e=this.upVector,t=g(d(),this.northVector,-r(this.heading),e);return a(t,e,t)}get rightVector(){return c(d(),this.leftVector)}clone(){return new S({renderCoordsHelper:this.renderCoordsHelper,viewshed:this.viewshed.clone()})}get valid(){return this.viewshed.valid}get metersPerUnit(){return this.renderCoordsHelper.spatialReference.metersPerUnit}pointOnSphere(e,t,o){const{observerRenderSpace:i,targetRenderSpace:s}=this,p=n(R,s,i);return g(p,p,-r(t),this.leftVector),g(p,p,-r(e),this.tiltedUpVector),l(o,p,i)}cornerPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2+this.trimmingVertical;this.pointOnSphere(-t,r,e.topLeft),this.pointOnSphere(t,r,e.topRight),this.pointOnSphere(-t,-r,e.bottomLeft),this.pointOnSphere(t,-r,e.bottomRight)}arcCentersPoints(e){const t=this.horizontalFieldOfView/2,r=this.verticalFieldOfView/2;this.pointOnSphere(0,r,e.top),this.pointOnSphere(0,-r,e.bottom),this.pointOnSphere(-t,0,e.left),this.pointOnSphere(t,0,e.right)}parallelCenterPoints(e){const t=this.observerRenderSpace,o=this.farDistanceRenderSpace*Math.sin(r(this.verticalFieldOfView/2)),i=h(R,this.tiltedUpVector,o);l(e.top,t,i),n(e.bottom,t,i)}renderSpaceToPoint(e,t){const r=R;return this.renderCoordsHelper.fromRenderCoords(e,r,t),new v(r[0],r[1],r[2],t)}_pointToRenderSpace(e,t){const r=f(e.toArray());return this.renderCoordsHelper.toRenderCoords(r,e.spatialReference,t),t}_computeTargetRenderSpace(e){const{leftVector:t,northVector:o,upVector:i}=this,s=this.farDistanceRenderSpace,n=d();return h(n,o,s),g(n,n,-r(this.heading),i),g(n,n,-r(this.tiltParallelToSurface),t),l(n,e,n),n}};e([o()],m.prototype,"renderCoordsHelper",void 0),e([o()],m.prototype,"viewshed",void 0),e([o()],m.prototype,"observerRenderSpaceOverride",void 0),e([o()],m.prototype,"needUpdateByFeature",void 0),e([o()],m.prototype,"observer",null),e([o()],m.prototype,"effectiveObserverRenderSpace",null),e([o()],m.prototype,"effectiveObserver",null),e([o()],m.prototype,"effectiveTargetRenderSpace",null),e([o()],m.prototype,"farDistance",null),e([o()],m.prototype,"farDistanceRenderSpace",null),e([o()],m.prototype,"heading",null),e([o()],m.prototype,"tilt",null),e([o()],m.prototype,"feature",null),e([o()],m.prototype,"tiltParallelToSurface",null),e([o()],m.prototype,"horizontalFieldOfView",null),e([o()],m.prototype,"verticalFieldOfView",null),e([o()],m.prototype,"observerRenderSpace",null),e([o()],m.prototype,"target",null),e([o()],m.prototype,"targetRenderSpace",null),e([o()],m.prototype,"targetDirection",null),e([o()],m.prototype,"tiltedUpVector",null),e([o()],m.prototype,"_basis",null),e([o()],m.prototype,"upVector",null),e([o()],m.prototype,"northVector",null),e([o()],m.prototype,"leftVector",null),e([o()],m.prototype,"rightVector",null),e([o()],m.prototype,"valid",null),e([o()],m.prototype,"metersPerUnit",null),m=S=e([i("geoscene.views.3d.analysis.Viewshed.ViewshedComputedDataVideo")],m);const R=d();export{m as ViewshedComputedDataVideo};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Color.js";import i from"../../core/Accessor.js";import"../../core/has.js";import{equals as s}from"../../core/lang.js";import{deg2rad as o}from"../../core/mathUtils.js";import{destroyMaybe as r}from"../../core/maybe.js";import{initial as l,watch as a}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{fromRotation as h}from"../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as p,d as E,g as b,H as _,h as f,j as u,n as V,p as v,t as d,u as w}from"../../chunks/vec32.js";import{clone as C,create as g}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{arcAnglePerSegment as A,viewshedVisualizationConfiguration as L}from"../../views/3d/analysis/Viewshed/ViewshedConfiguration.js";import{ViewshedShapeVisualElement as D}from"../../views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js";import y from"../../views/3d/analysis/Viewshed/ViewshedTool.js";import{LineVisualElement as j}from"../../views/3d/interactive/visualElements/LineVisualElement.js";import{PointVisualElement as F}from"../../views/3d/interactive/visualElements/PointVisualElement.js";import{createStipplePatternSimple as R}from"../../views/3d/webgl-engine/materials/lineStippleUtils.js";import Graphic from"../../Graphic.js";import Mesh from"../../geometry/Mesh.js";import GraphicsLayer from"../../layers/GraphicsLayer.js";let S=class extends i{constructor(e){super(e),this.visible=!0,this._viewshedCorners={topLeft:g(),topRight:g(),bottomLeft:g(),bottomRight:g()},this._arcCenterPoints={top:g(),bottom:g(),left:g(),right:g()},this._parallelCenters={top:g(),bottom:g()}}initialize(){const e={view:this.view,isDecoration:!0},t={...e,color:this._color,renderOccluded:4},i={...t,stipplePattern:R(2)};this._observerVisualElement=new F({...e,...L.observerPointConfiguration}),this._shapeVisualElement=new D({...e,isDecoration:this.isDecoration}),this._frameLinesVisualElement=new j(t),this._leftArcVisualElement=new j(t),this._rightArcVisualElement=new j(t),this._topArcVisualElement=new j(t),this._bottomArcVisualElement=new j(t),this._centralLongitude=new j(i),this._centralLatitude=new j(i),this.addHandles([a(()=>{const e=this.viewshedComputedData;if(!e?.valid)return null;const viewshed=this.viewshedComputedData.viewshed;if(viewshed?.type!=='video'||viewshed?.fisheyeLens){e.trimmingVertical=0.0}else{e.trimmingVertical=viewshed.trimmingVertical??0.0}const t=this._viewshedCorners,i=this._arcCenterPoints,s=this._parallelCenters;return e.cornerPoints(t),e.arcCentersPoints(i),e.parallelCenterPoints(s),{viewshedComputedData:e,corners:t,arcCenters:i,parallelCenters:s,interactive:this.analysisViewData.interactive,selected:this._selected}},e=>{const t=null!=e;e.viewshedComputedData.viewshed.finishedVideo=this.analysisViewData?.tool?.selectedViewshed?true:false;this._forEachVisualElement(e=>e.attached=t),t&&this._updateVisualElements(e)},{initial:!0,equals:s}),a(()=>{const{viewshedComputedData:e}=this,{horizontalFieldOfView:t,verticalFieldOfView:i}=e??{};return{viewshedComputedData:e,horizontalFieldOfView:t,verticalFieldOfView:i}},({viewshedComputedData:e})=>{const{_shapeVisualElement:t}=this;e!==t.viewshedComputedData&&(t.viewshedComputedData=e),this._shapeVisualElement.recreateGeometry()},l),a(()=>{const{interactive:e}=this.analysisViewData;return{visible:this.visible,selected:e&&this._selected,staged:e&&this._staged,horFovNot360:360!==this.viewshedComputedData?.horizontalFieldOfView}},({visible:e,selected:t,staged:i,horFovNot360:s})=>{const o=t||i;this._shapeVisualElement.visible=e,this._topArcVisualElement.visible=e,this._bottomArcVisualElement.visible=e,this._frameLinesVisualElement.visible=e&&s;const r=e&&(t||s);this._leftArcVisualElement.visible=r,this._rightArcVisualElement.visible=r,this._forEachLineVisualElement(e=>{e.width=o?L.frameWidthSelected:L.frameWidthNotSelected,e.renderOccluded=t?4:1}),[this._centralLatitude,this._centralLongitude].forEach(i=>{i.width=2*(o?L.frameWidthSelected:L.frameWidthNotSelected),i.visible=e&&t})},l),a(()=>{const{analysisViewData:{interactive:e,tool:t},_selected:i,visible:s}=this,o=this.view.activeTool,r=!t?.active&&o instanceof y&&o.creating;return{observerVisible:s&&!i&&(!e||(t?.creating??!1)||r),color:this._color}},({observerVisible:e,color:t})=>{this._observerVisualElement.visible=e,this._forEachLineVisualElement(e=>e.color=t)},l)])}get _color(){const{viewshedComputedData:e,_selected:i,analysisViewData:s}=this;if(null==e)return t.toUnitRGBA(L.frameColor);const o=s.tool?.active||s.interactive,r=e.viewshed===s.tool?.stagedViewshed,a=o&&(i||r)?this.view.effectiveTheme.accentColor:L.frameColor;return t.toUnitRGBA(a)}get _selected(){const{viewshedComputedData:e,analysisViewData:{selectedViewshedComputedData:t}}=this;return null!=e&&e===t}get _staged(){const{analysisViewData:{tool:e},viewshedComputedData:t}=this;return null!=e&&e.creating&&e.stagedViewshed===t?.viewshed}destroy(){this._observerVisualElement=r(this._observerVisualElement),this._shapeVisualElement=r(this._shapeVisualElement),this._frameLinesVisualElement=r(this._frameLinesVisualElement),this._leftArcVisualElement=r(this._leftArcVisualElement),this._rightArcVisualElement=r(this._rightArcVisualElement),this._topArcVisualElement=r(this._topArcVisualElement),this._bottomArcVisualElement=r(this._bottomArcVisualElement),this._centralLongitude=r(this._centralLongitude),this._centralLatitude=r(this._centralLatitude);this._videoFrustumLayer?.removeAll();this._videoFrustumLayer=undefined}_forEachLineVisualElement(e){[this._frameLinesVisualElement,this._leftArcVisualElement,this._rightArcVisualElement,this._topArcVisualElement,this._bottomArcVisualElement,this._centralLatitude,this._centralLongitude].forEach(e)}_forEachVisualElement(e){this._forEachLineVisualElement(e),e(this._observerVisualElement),e(this._shapeVisualElement)}_updateVisualElements(e){const{viewshedComputedData:t,corners:i,arcCenters:s,parallelCenters:o}=e,r=C(t.observerRenderSpace);const tool=this.analysisViewData.tool;const viewshed=t.viewshed;const finishedVideo=viewshed.finishedVideo;if(viewshed.type==='video'){let horizontalFieldOfView=t.horizontalFieldOfView;let verticalFieldOfView=t.verticalFieldOfView;const fieldOfViewH=viewshed.limitHorizontal;const fieldOfViewV=viewshed.limitVertical;if(horizontalFieldOfView>fieldOfViewH){e.viewshedComputedData.horizontalFieldOfView=fieldOfViewH;return};if(verticalFieldOfView>fieldOfViewV){e.viewshedComputedData.verticalFieldOfView=fieldOfViewV;return}if(!this._videoFrustumLayer){this._videoFrustumLayer=new GraphicsLayer({title:'视频融合视椎体',listMode:'hide'});this.view.map.add(this._videoFrustumLayer);a((()=>this.visible),(e=>this._videoFrustumLayer.visible=e),l);a((()=>viewshed.frustum),(e=>{this._videoFrustumLayer.visible=e;this._updateVideoFrustum(e.viewshedComputedData,s)}),l)}if(!tool||(finishedVideo||tool?.selectedViewshed)){this._forEachVisualElement((e=>e.attached=false));if(viewshed.frustum===true){this._updateVideoFrustum(e.viewshedComputedData,s)}else{this._videoFrustumLayer.visible=false}}}this._observerVisualElement.geometry=t.observer,this._shapeVisualElement.updateTransform(),this._updateFrameLines(r,i),this._updateFrameArcs(t,i,o),this._updateCentralHelperArcs(t,s)}_updateVideoFrustum(){const{_viewshedCorners,viewshedComputedData}=this;let center=_viewshedCorners.center||viewshedComputedData.observerRenderSpace;let bottomLeft=_viewshedCorners.bottomLeft;let bottomRight=_viewshedCorners.bottomRight;let topLeft=_viewshedCorners.topLeft;let topRight=_viewshedCorners.topRight;const spatialReference=viewshedComputedData.observer.spatialReference;function renderSpaceToPoint(renderSpace){const spatialCoordinates=viewshedComputedData.renderSpaceToPoint(renderSpace,spatialReference);return[spatialCoordinates.x,spatialCoordinates.y,spatialCoordinates.z,]};let cameraPositionGeographic=[...renderSpaceToPoint(center),...renderSpaceToPoint(topLeft),...renderSpaceToPoint(topRight),...renderSpaceToPoint(bottomRight),...renderSpaceToPoint(bottomLeft)];const transparentMaterial={color:"transparent"};const faceConfigurations=[[0,2,1],[0,2,3],[0,3,4],[0,4,1],[1,2,4],[2,3,4]];const mesh=new Mesh({vertexAttributes:{position:cameraPositionGeographic,},components:faceConfigurations.map(faces=>({faces,material:transparentMaterial})),spatialReference,});const frustumGraphic=new Graphic({geometry:mesh,symbol:{type:"mesh-3d",symbolLayers:[{type:"fill",material:{color:"red"},edges:{type:"solid",color:"rgba(255, 127, 0, 1)",size:2},},],},});this._videoFrustumLayer.graphics=[frustumGraphic]}_updateFrameLines(e,t){this._frameLinesVisualElement.geometry=[[e,t.topLeft],[e,t.topRight],[e,t.bottomLeft],[e,t.bottomRight]]}_updateFrameArcs(e,t,i){const{observerRenderSpace:s,rightVector:r,horizontalFieldOfView:a,tiltedUpVector:l}=e,n=o(a),c=g(),p=m();h(p,n/2,l),d(c,r,p),O(this._leftArcVisualElement,s,t.bottomLeft,t.topLeft,"forward",c),h(p,-n/2,l),u(c,0,0,0),d(c,r,p),O(this._rightArcVisualElement,s,t.bottomRight,t.topRight,"forward",c);const _=a>180?"backward":"forward";O(this._topArcVisualElement,i.top,t.topRight,t.topLeft,_,l),O(this._bottomArcVisualElement,i.bottom,t.bottomRight,t.bottomLeft,_,l)}_updateCentralHelperArcs(e,t){const i=e.observerRenderSpace,s=e.horizontalFieldOfView>=180?"backward":"forward";O(this._centralLatitude,i,t.right,t.left,s,e.tiltedUpVector),O(this._centralLongitude,i,t.top,t.bottom,"forward",e.leftVector)}get test(){}};function O(e,t,i,s,o,r,a=A){const l=g();p(l,i,t);const n=_(l),c=g();p(c,s,t),V(c,c),f(c,c,n);let u=v(l,c);const L=C(r);"backward"===o&&(w(L,L),u=-(2*Math.PI-u));const D=[],y=Math.ceil(Math.abs(u)/a),j=m();h(j,u/y,L);const F=g();E(F,l);const R=g();E(R,i);for(let h=0;h<y;h++){const e=g();E(e,R),d(F,F,j),b(R,t,F);const i=g();E(i,R),D.push([e,i])}e.geometry=D}e([n()],S.prototype,"view",void 0),e([n({constructOnly:!0})],S.prototype,"isDecoration",void 0),e([n()],S.prototype,"analysisViewData",void 0),e([n()],S.prototype,"viewshedComputedData",void 0),e([n()],S.prototype,"visible",void 0),e([n()],S.prototype,"_color",null),e([n()],S.prototype,"_selected",null),e([n()],S.prototype,"_staged",null),S=e([c("geoscene.views.3d.analysis.Viewshed.ViewshedSubVisualizationVideo")],S);export{S as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as i}from"tslib";import s from"../../core/Accessor.js";import{destroyHandle as o}from"../../core/handleUtils.js";import"../../core/has.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{initial as r,watch as e}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as l}from"../../core/accessorSupport/decorators/subclass.js";import n from"./ViewshedSubVisualizationVideo.js";let c=class extends s{get visible(){return this.analysisViewData.visible}constructor(i){super(i)}initialize(){const i=this.analysisViewData,s=t(()=>this.analysisViewData.viewshedComputedDataHandles,({viewshedComputedData:s})=>{const o=new n({view:this.view,viewshedComputedData:s,analysisViewData:i,isDecoration:this.isDecoration});return{visualization:o,remove:()=>o.destroy()}});this._subVisualizations=s,this.addHandles([o(s),e(()=>this.visible,i=>this._subVisualizations.forEach(({visualization:s})=>s.visible=i),r)])}get test(){}};i([a({constructOnly:!0})],c.prototype,"analysisViewData",void 0),i([a({constructOnly:!0,nonNullable:!0})],c.prototype,"view",void 0),i([a({constructOnly:!0})],c.prototype,"isDecoration",void 0),i([a()],c.prototype,"visible",null),c=i([l("geoscene.views.3d.analysis.Viewshed.ViewshedVisualizationVideo")],c);export{c as ViewshedVisualizationVideo};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{ReloadableShaderModule as e}from"../../../views/3d/webgl-engine/core/shaderTechnique/ReloadableShaderModule.js";import{ShaderTechnique as r}from"../../../views/3d/webgl-engine/core/shaderTechnique/ShaderTechnique.js";import{Pos2Locations as o}from"../../../views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js";import{a as i}from"./ViewshedVideo.glsl.js";import{makePipelineState as s,unpremultipliedAlphaToPremultipliedAlpha as t,defaultColorWrite as l}from"../../../views/webgl/renderState.js";class a extends r{constructor(r,s){super(r,s,new e(i,()=>import("./ViewshedVideo.glsl.js")),o)}initializePipeline(){return s({colorWrite:l,blending:t})}}export{a as ViewshedTechniqueVideo};
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{invertOrIdentity as e}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{IDENTITY as i,create as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{ScreenSpacePass as t}from"../../../views/3d/webgl-engine/core/shaderLibrary/ScreenSpacePass.glsl.js";import{ReadDepth as s}from"../../../views/3d/webgl-engine/core/shaderLibrary/output/ReadDepth.glsl.js";import{PiUtils as a}from"../../../views/3d/webgl-engine/core/shaderLibrary/shading/PiUtils.glsl.js";import{LocalFromScreenSpacePassParameters as r,localFromScreenSpace as n}from"../../../views/3d/webgl-engine/core/shaderLibrary/util/LocalFromScreenSpace.glsl.js";import{Float2PassUniform as d}from"../../../views/3d/webgl-engine/core/shaderModules/Float2PassUniform.js";import{Float3PassUniform as l}from"../../../views/3d/webgl-engine/core/shaderModules/Float3PassUniform.js";import{FloatPassUniform as h}from"../../../views/3d/webgl-engine/core/shaderModules/FloatPassUniform.js";import{FloatsPassUniform as v}from"../../../views/3d/webgl-engine/core/shaderModules/FloatsPassUniform.js";import{glsl as c}from"../../../views/3d/webgl-engine/core/shaderModules/glsl.js";import{IntegerPassUniform as w}from"../../../views/3d/webgl-engine/core/shaderModules/IntegerPassUniform.js";import{Matrix4BindUniform as f}from"../../../views/3d/webgl-engine/core/shaderModules/Matrix4BindUniform.js";import{Matrix4sPassUniform as p}from"../../../views/3d/webgl-engine/core/shaderModules/Matrix4sPassUniform.js";import{Texture2DBindUniform as m}from"../../../views/3d/webgl-engine/core/shaderModules/Texture2DBindUniform.js";import{Texture2DPassUniform as g}from"../../../views/3d/webgl-engine/core/shaderModules/Texture2DPassUniform.js";import{ShaderBuilder as u}from"../../../views/webgl/ShaderBuilder.js";class x extends r{constructor(){super(...arguments),this.shadowMap={depthTexture:null,nearFar:[1,100],numActiveFaces:1,atlasRegions:[[0,0,1,1]]},this.targetVector=[1,0,0],this.upVector=[0,0,1],this.fovs=[45,45],this.headingAndTilt=[0,0],this.observerOffset=[0,0,0],this.projectionMatrices=i.flat(),this.viewMatrices=i.flat(),this.volumeOffset=0}}function V() {const i = new u, o = i.fragment;return i.include(t), i.include(n), o.include(s), o.include(a), o.uniforms.add(new m("depthTexture", e => e.depth?.attachment), new f("inverseProjectionMatrix", e => e.camera.inverseProjectionMatrix), new f("inverseViewNormalMatrix", ({camera: i}) => e(b, i.viewInverseTransposeMatrix)), new l("viewshedObserverOffset", e => e.observerOffset), new l("viewshedTargetVector", e => e.targetVector), new l("viewshedUpVector", e => e.upVector), new d("viewshedFOVs", e => e.fovs), new d("viewshedHeadingAndTilt", e => e.headingAndTilt), new h("videoFlag",function(e,i){return e.viewshedVideo?1:0}),new h("fisheyeLens",function(e,i){return e.viewshedVideo&&e.viewshedVideo.parameters.fisheyeLens?1:0}),new h("videoOpacity",function(e,i){return e.viewshedVideo?e.viewshedVideo.parameters.opacity:1}),new g("videoTexture",function(e,i){const o=e.viewshedVideo,s=o?._data;if(s&&!s.paused&&o&&o.update){const e=o.parameters.view;o.loadedToView||(o.load(e._stage.renderView.renderingContext),e._stage.addTexture(o),o.loadedToView=!0),o?.update(),s.playEvent||(s.addEventListener("play",function(){e._stage.renderView.requestRender()}),s.playEvent=!0)}return o?.glTexture}),new l("shadowColor",function(e){if(e.viewshedVideo){const i=e.viewshedVideo.parameters.shadowColor;return Array.isArray(i)?i:[0,0,0]}return[1,0,0]}),new h("shadowOpacity",function(e,i){return e.viewshedVideo?e.viewshedVideo.parameters.shadowOpacity:.5}),new h("textureVertical",function(e,i){return e.viewshedVideo?e.viewshedVideo.parameters.textureVertical:1}), new d("viewshedNearFar", e => e.shadowMap.nearFar ?? [1, 100]), new h("viewshedVolumeOffset", e => e.volumeOffset), new g("viewshedShadowMap", e => e.shadowMap.depthTexture), new p("viewshedProjectionMatrices", e => e.projectionMatrices, 6), new p("viewshedViewMatrices", e => e.viewMatrices, 6), new w("viewshedNumFaces", e => e.shadowMap.numActiveFaces), new v("viewshedAtlasRegions", e => e.shadowMap.atlasRegions.flat(), 24), new g("normalMap", e => e.normals)), o.constants.add("visibleColor", "vec4", [0, 1, 0, .5]), o.constants.add("occludedColor", "vec4", [1, 0, 0, .5]), o.code.add(c`vec2 getViewshedUv(vec4 worldPosition, int face) {
|
|
6
|
+
mat4 viewshedMatrix = viewshedProjectionMatrices[face];
|
|
7
|
+
vec4 viewshedUv4 = viewshedMatrix * worldPosition;
|
|
8
|
+
vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w;
|
|
9
|
+
return viewshedUv.xy;
|
|
10
|
+
}
|
|
11
|
+
float viewshedDepthToFloat(float depth) {
|
|
12
|
+
return (depth - viewshedNearFar[0]) / (viewshedNearFar[1] - viewshedNearFar[0]);
|
|
13
|
+
}
|
|
14
|
+
float getOrthographicDepthToViewshed(vec4 worldPosition, int face) {
|
|
15
|
+
mat4 viewshedViewMatrix = viewshedViewMatrices[face];
|
|
16
|
+
vec4 viewshedUv4 = viewshedViewMatrix * worldPosition;
|
|
17
|
+
vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w;
|
|
18
|
+
float depth = -viewshedUv.z;
|
|
19
|
+
return viewshedDepthToFloat(depth);
|
|
20
|
+
}
|
|
21
|
+
float viewshedReadShadowMapDepth(sampler2D _viewshedShadowmap, ivec2 uv) {
|
|
22
|
+
return texelFetch(_viewshedShadowmap, uv, 0).r;
|
|
23
|
+
}
|
|
24
|
+
float viewshedFilterShadow(sampler2D _viewshedShadowmap, vec2 uv) {
|
|
25
|
+
vec2 uvScaled = uv * vec2(textureSize(_viewshedShadowmap, 0));
|
|
26
|
+
vec2 st = fract(uvScaled);
|
|
27
|
+
ivec2 base = ivec2(uvScaled);
|
|
28
|
+
float s00 = viewshedReadShadowMapDepth( _viewshedShadowmap, ivec2(base.x, base.y ));
|
|
29
|
+
float s10 = viewshedReadShadowMapDepth( _viewshedShadowmap, ivec2(base.x + 1, base.y ));
|
|
30
|
+
float s11 = viewshedReadShadowMapDepth( _viewshedShadowmap, ivec2(base.x + 1, base.y + 1));
|
|
31
|
+
float s01 = viewshedReadShadowMapDepth( _viewshedShadowmap, ivec2(base.x, base.y + 1));
|
|
32
|
+
return mix(mix(s00, s10, st.x), mix(s01, s11, st.x), st.y);
|
|
33
|
+
}
|
|
34
|
+
float viewshedTextureAtlasLookup(sampler2D _viewshedShadowmap, vec2 uv, vec4 atlasRegion) {
|
|
35
|
+
vec2 atlasScale = atlasRegion.zw - atlasRegion.xy;
|
|
36
|
+
vec2 uvAtlas = fract(uv) * atlasScale + atlasRegion.xy;
|
|
37
|
+
return viewshedFilterShadow(_viewshedShadowmap, uvAtlas);
|
|
38
|
+
}
|
|
39
|
+
float getDepthFromShadowMap(vec2 uv, int face) {
|
|
40
|
+
int index = 4 * face;
|
|
41
|
+
float umin = viewshedAtlasRegions[index];
|
|
42
|
+
float umax = viewshedAtlasRegions[index + 1];
|
|
43
|
+
float vmin = viewshedAtlasRegions[index + 2];
|
|
44
|
+
float vmax = viewshedAtlasRegions[index + 3];
|
|
45
|
+
vec4 atlasRegion = vec4(umin, vmin, umax, vmax);
|
|
46
|
+
return viewshedTextureAtlasLookup(viewshedShadowMap, uv, atlasRegion);
|
|
47
|
+
}
|
|
48
|
+
struct ViewshedPoint {
|
|
49
|
+
int face;
|
|
50
|
+
vec2 uv;
|
|
51
|
+
bool isWithin;
|
|
52
|
+
float orthographicDepth;
|
|
53
|
+
};
|
|
54
|
+
mat3 rotationMatrix(vec3 axis, float angle)
|
|
55
|
+
{
|
|
56
|
+
float s = sin(angle);
|
|
57
|
+
float c = cos(angle);
|
|
58
|
+
float oc = 1.0 - c;
|
|
59
|
+
return mat3(
|
|
60
|
+
oc * axis.xxz * axis.xyx + vec3(c, axis.zy) * vec3(1., -s, s),
|
|
61
|
+
oc * axis.xyy * axis.yyz + vec3(axis.z, c, axis.x) * vec3(s, 1., -s),
|
|
62
|
+
oc * axis.zyz * axis.xzz + vec3(axis.yx, c) * vec3(-s, s, 1.)
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
float distanceToPlane(vec3 position, vec3 normal) {
|
|
66
|
+
return dot(position, normal);
|
|
67
|
+
}
|
|
68
|
+
bool outsideViewshed(float distance) {
|
|
69
|
+
return distance > -viewshedVolumeOffset;
|
|
70
|
+
}
|
|
71
|
+
bool isWithinViewshed(vec3 position) {
|
|
72
|
+
float positionLength = length(position - viewshedObserverOffset);
|
|
73
|
+
float farSphereDistance = positionLength - viewshedNearFar[1];
|
|
74
|
+
if (outsideViewshed(farSphereDistance)) { return false; }
|
|
75
|
+
float nearSphereDistance = viewshedNearFar[0] - positionLength;
|
|
76
|
+
if (outsideViewshed(nearSphereDistance)) { return false; }
|
|
77
|
+
vec3 westVector = normalize(cross(viewshedUpVector, viewshedTargetVector));
|
|
78
|
+
bool leftOfTarget = distanceToPlane(position, westVector) > 0.0;
|
|
79
|
+
if (viewshedFOVs[0] < TWO_PI) {
|
|
80
|
+
float horAngle = viewshedFOVs[0] / 2.0;
|
|
81
|
+
horAngle = leftOfTarget ? horAngle : -horAngle;
|
|
82
|
+
vec3 sideVector = viewshedTargetVector * rotationMatrix(viewshedUpVector, horAngle);
|
|
83
|
+
bool inFront = distanceToPlane(position, sideVector) > 0.0;
|
|
84
|
+
if (inFront) {
|
|
85
|
+
vec3 sideNormal = cross(viewshedUpVector, sideVector) * (leftOfTarget ? 1. : -1.);
|
|
86
|
+
float sideDistance = distanceToPlane(position, normalize(sideNormal));
|
|
87
|
+
if (outsideViewshed(sideDistance)) { return false; }
|
|
88
|
+
} else if (viewshedFOVs[0] < PI) { return false; }
|
|
89
|
+
}
|
|
90
|
+
if (viewshedFOVs[1] < PI) {
|
|
91
|
+
float t = dot(viewshedUpVector, position);
|
|
92
|
+
vec3 nProjVector = normalize(position - t * viewshedUpVector);
|
|
93
|
+
float heading = acos(clamp(dot(normalize(viewshedTargetVector), nProjVector), -1.0, 1.0));
|
|
94
|
+
heading = leftOfTarget ? heading : -heading;
|
|
95
|
+
bool aboveTarget = distanceToPlane(position, viewshedUpVector) > 0.0;
|
|
96
|
+
float verFOV = viewshedFOVs[1] / 2.0;
|
|
97
|
+
verFOV = aboveTarget ? -verFOV : verFOV;
|
|
98
|
+
mat3 rotateByHeading = rotationMatrix(viewshedUpVector, heading);
|
|
99
|
+
vec3 sideVector = viewshedTargetVector * rotationMatrix(westVector, verFOV) * rotateByHeading;
|
|
100
|
+
vec3 leftVector = westVector * rotateByHeading;
|
|
101
|
+
vec3 sideNormal = cross(sideVector, leftVector) * (aboveTarget ? 1. : -1.);
|
|
102
|
+
float sideDistance = distanceToPlane(position, normalize(sideNormal));
|
|
103
|
+
if (outsideViewshed(sideDistance)) { return false; }
|
|
104
|
+
}
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
bool getViewshedPoint(vec4 localPosition, out ViewshedPoint point) {
|
|
108
|
+
for(int i=0; i < viewshedNumFaces; i++) {
|
|
109
|
+
vec2 viewshedUv = getViewshedUv(localPosition, i);
|
|
110
|
+
if (viewshedUv.x > 0. && viewshedUv.x < 1. && viewshedUv.y > 0. && viewshedUv.y < 1.) {
|
|
111
|
+
float orthoDepth = getOrthographicDepthToViewshed(localPosition, i);
|
|
112
|
+
if (orthoDepth >= 0.) {
|
|
113
|
+
bool isWithin = isWithinViewshed(localPosition.xyz);
|
|
114
|
+
point = ViewshedPoint(i, viewshedUv, isWithin, orthoDepth);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
float normalCosAngle(float linearDepth, vec3 localPosition) {
|
|
122
|
+
vec4 normal4 = texture(normalMap, uv);
|
|
123
|
+
vec3 normalN = normalize(normal4.xyz * 2.0 - 1.0);
|
|
124
|
+
vec3 normal = normalize((inverseViewNormalMatrix * vec4(normalN, 1.0)).xyz);
|
|
125
|
+
vec3 viewingDir = normalize(localPosition);
|
|
126
|
+
return dot(normal, viewingDir);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
// 源码修改 第二处修改 start ======================================================
|
|
133
|
+
// 可视域三维坐标
|
|
134
|
+
vec3 getViewshedXyz(vec4 worldPosition, int face) {
|
|
135
|
+
mat4 viewshedMatrix = viewshedProjectionMatrices[face];
|
|
136
|
+
vec4 viewshedUv4 = viewshedMatrix * worldPosition;
|
|
137
|
+
vec3 viewshedUv = viewshedUv4.xyz / viewshedUv4.w;
|
|
138
|
+
return viewshedUv.xyz;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
bool isWithinViewshed_complete(vec3 position) {
|
|
142
|
+
float positionLength = length(position - viewshedObserverOffset);
|
|
143
|
+
float farSphereDistance = positionLength - viewshedNearFar[1];
|
|
144
|
+
if (outsideViewshed(farSphereDistance)) { return false; }
|
|
145
|
+
float nearSphereDistance = viewshedNearFar[0] - positionLength;
|
|
146
|
+
if (outsideViewshed(nearSphereDistance)) { return false; }
|
|
147
|
+
vec3 westVector = normalize(cross(viewshedUpVector, viewshedTargetVector));
|
|
148
|
+
bool leftOfTarget = distanceToPlane(position, westVector) > 0.0;
|
|
149
|
+
if (viewshedFOVs[0] < TWO_PI) {
|
|
150
|
+
float horAngle = viewshedFOVs[0] / 2.0;
|
|
151
|
+
horAngle = leftOfTarget ? horAngle : -horAngle;
|
|
152
|
+
vec3 sideVector = viewshedTargetVector * rotationMatrix(viewshedUpVector, horAngle);
|
|
153
|
+
bool inFront = distanceToPlane(position, sideVector) > 0.0;
|
|
154
|
+
if (inFront) {
|
|
155
|
+
vec3 sideNormal = cross(viewshedUpVector, sideVector) * (leftOfTarget ? 1. : -1.);
|
|
156
|
+
float sideDistance = distanceToPlane(position, normalize(sideNormal));
|
|
157
|
+
if (outsideViewshed(sideDistance)) { return false; }
|
|
158
|
+
} else if (viewshedFOVs[0] < PI) { return false; }
|
|
159
|
+
}
|
|
160
|
+
if (viewshedFOVs[1] < PI) {
|
|
161
|
+
bool aboveTarget = distanceToPlane(position, viewshedUpVector) > 0.0;
|
|
162
|
+
float verFOV = viewshedFOVs[1] / 2.0;
|
|
163
|
+
verFOV = aboveTarget ? -verFOV : verFOV;
|
|
164
|
+
vec3 sideVector = viewshedTargetVector *
|
|
165
|
+
rotationMatrix(westVector, verFOV * textureVertical * 2.0f);
|
|
166
|
+
bool inFront = distanceToPlane(position, sideVector) > 0.0;
|
|
167
|
+
if (inFront) {
|
|
168
|
+
vec3 sideNormal = -cross(westVector, sideVector) * (aboveTarget ? 1. : -1.);
|
|
169
|
+
float sideDistance = distanceToPlane(position, normalize(sideNormal));
|
|
170
|
+
if (outsideViewshed(sideDistance)) { return false; }
|
|
171
|
+
} else {
|
|
172
|
+
return false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return true;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
bool getViewshedPointVideo(vec4 localPosition, out ViewshedPoint point) {
|
|
179
|
+
for (int i=0; i < viewshedNumFaces; i++) {
|
|
180
|
+
vec3 viewshedXyz = getViewshedXyz(localPosition, i);
|
|
181
|
+
if (!(any(lessThan(viewshedXyz.xyz, vec3(0.0)))
|
|
182
|
+
|| any(greaterThan(viewshedXyz.xyz, vec3(1.0))))) {
|
|
183
|
+
float orthoDepth = getOrthographicDepthToViewshed(localPosition, i);
|
|
184
|
+
if (orthoDepth >= 0.) {
|
|
185
|
+
bool isWithin = (fisheyeLens == 1.0) ? isWithinViewshed(localPosition.xyz)
|
|
186
|
+
: isWithinViewshed_complete(localPosition.xyz);
|
|
187
|
+
point = ViewshedPoint(i, viewshedXyz.xy, isWithin, orthoDepth);
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
// 源码修改 第二处修改 end ======================================================
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
`), o.main.add(c`
|
|
201
|
+
|
|
202
|
+
float depth = depthFromTexture(depthTexture, uv);
|
|
203
|
+
if (depth >= 1.0 || depth <= 0.0) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
float linearDepth = linearizeDepth(depth);
|
|
207
|
+
vec4 localPosition = reconstructLocalPosition(gl_FragCoord.xy, linearDepth);
|
|
208
|
+
ViewshedPoint point;
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
// 源码修改 第三处修改 start ======================================================
|
|
212
|
+
bool foundFace = (videoFlag == 1.0) ? getViewshedPointVideo(localPosition, point)
|
|
213
|
+
: getViewshedPoint(localPosition, point);
|
|
214
|
+
|
|
215
|
+
if (!foundFace || !point.isWithin) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
float viewshedDepth = getDepthFromShadowMap(point.uv, point.face);
|
|
219
|
+
float distance = point.orthographicDepth;
|
|
220
|
+
bool visible = distance < viewshedDepth;
|
|
221
|
+
|
|
222
|
+
vec4 occludedColorShadow = vec4(shadowColor,shadowOpacity);
|
|
223
|
+
|
|
224
|
+
if(videoFlag == 1.0){
|
|
225
|
+
point.uv.x -= 0.0885;
|
|
226
|
+
point.uv.x *= 1.215;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
vec4 videoColor = (videoFlag == 1.0) ? vec4(texture(videoTexture, point.uv).xyz,videoOpacity)
|
|
230
|
+
: visibleColor;
|
|
231
|
+
|
|
232
|
+
fragColor = visible ? videoColor :
|
|
233
|
+
((videoFlag == 1.0) ? occludedColorShadow : occludedColor);
|
|
234
|
+
|
|
235
|
+
float cosAngle = normalCosAngle(linearDepth, localPosition.xyz);
|
|
236
|
+
float threshold = -0.01;
|
|
237
|
+
if (cosAngle > threshold) {
|
|
238
|
+
fragColor = (videoFlag == 1.0) ? occludedColorShadow : occludedColor;
|
|
239
|
+
}
|
|
240
|
+
// 源码修改 第三处修改 end ======================================================
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
`), i}const b=o(),M=Object.freeze(Object.defineProperty({__proto__:null,ViewshedPassParameters:x,build:V},Symbol.toStringTag,{value:"Module"}));export{x as V,M as a,V as b};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright GeoScene, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.geoscene.cn/4.34/geoscene/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{__decorate as e}from"tslib";import s from"../../../core/Collection.js";import{deg2rad as t}from"../../../core/mathUtils.js";import{disposeMaybe as r}from"../../../core/maybe.js";import{watch as i,when as o,initial as a,sync as n}from"../../../core/reactiveUtils.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{translate as c,fromTranslation as p,scale as w,mul as l}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{a as u,k as f}from"../../../chunks/vec32.js";import{create as v,fromValues as _}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{j as V}from"../../../chunks/sphere.js";import{InternalRenderCategory as g}from"../../../views/3d/webgl.js";import M from"../../../views/3d/webgl/RenderNode.js";import{ViewshedShadowMap as b}from"../../../views/3d/webgl-engine/lib/ViewshedShadowMap.js";import{V as S}from"../../../analysis/viewshedVideo/render/ViewshedVideo.glsl.js";import{ViewshedTechniqueVideo as y}from"../../../analysis/viewshedVideo/render/ViewshedTechniqueVideo.js";let j=class extends M{get shadowMap(){return this._shadowMap}get hasViewsheds(){return this._viewsheds.length>0}get _contentPixelRatio(){return this.view.state.contentPixelRatio}get _viewshedsInView(){return this._viewsheds.items.filter(e=>x(this.view,e))}constructor(e){super(e),this.isDecoration=!1,this._passParameters=new S,this._viewsheds=new s,this._shadowMap=null,this.consumes={required:[g.VIEWSHED,"normals"]},this.produces=g.VIEWSHED,this.requireGeometryDepth=!0}initialize(){this._shadowMap=new b(this.fboCache),this.addHandles([i(()=>this.view.resolutionScale,e=>{const s=this._shadowMap;s&&(s.settings.textureSizeQuality=e)},a),o(()=>!this.hasViewsheds,()=>this._shadowMap?.dispose()),i(()=>this._viewshedsInView.map(e=>[e.observerRenderSpace,e.heading,e.tilt,e.farDistance,e.horizontalFieldOfView,e.verticalFieldOfView]),()=>this.requestRender(1),n)])}destroy(){this._shadowMap=r(this._shadowMap)}precompile(){if(this.hasViewsheds){this.techniques.precompile(y);for(const e of this._viewshedsInView)if(this._shadowMap?.isActive(e))return void this.view.stage.renderer.precompileViewshedShadowMap()}}render(e){const s=this.bindParameters,t=this.renderingContext,r=e.find(({name:e})=>e===g.VIEWSHED);if(!this.hasViewsheds||!s.depth||this.isDecoration&&!s.decorations)return r;this._passParameters.shadowMap=this._shadowMap??this._passParameters.shadowMap,this._passParameters.normals=e.find(({name:e})=>"normals"===e)?.getTexture();const i=this.techniques.get(y);if(!i?.compiled)return this.requestRender(1),r;const o=this.view.stage.renderer.isFeatureEnabled(7);for(const a of this._viewshedsInView){if(!this._renderShadowCubeMap(s,a,o)||!this._shadowMap?.ready)continue;const e=this._setupViewshedParameters(a,s.camera);t.bindTechnique(i,s,e),t.bindFramebuffer(r.fbo),t.screen.draw()}return this.shadowMap?.dispose(),r}updateViewsheds(e){const s=this._viewsheds,{removes:t,adds:r}=e;if(t&&(Array.isArray(t)?s.removeMany(t):s.remove(t)),r)if(Array.isArray(r)){const e=r.filter(e=>!s.includes(e));s.addMany(e)}else s.includes(r)||s.add(r)}_renderShadowCubeMap(e,s,t){const r=this._shadowMap;if(!r)return!1;const i=this.view.basemapTerrain.hasStencilEnabledExtents,o=r.start(e.camera,s,t,this._contentPixelRatio,i);return o&&r.faces.forEach(e=>this.view.stage.renderer.renderViewshedShadowMap(e)),r.finish(),o}_setupViewshedParameters(e,s){const r=this._shadowMap;if(!r)return this._passParameters;const i=this._passParameters,o=e.effectiveObserverRenderSpace;i.localOrigin=o,i.observerOffset=u(E,e.observerRenderSpace,e.effectiveObserverRenderSpace),i.fovs=[t(e.horizontalFieldOfView),t(e.verticalFieldOfView)],i.headingAndTilt=[t(e.heading),t(e.tiltParallelToSurface)],i.upVector=e.tiltedUpVector;i.viewshedVideo=e.viewshed.texture;const a=R(e.targetRenderSpace,o);i.targetVector=a;const n=new Array,h=new Array;for(let t=0;t<r.numActiveFaces;t++)c(I,r.viewshedViewMatrices[t],o),n.push(...I),P(r.viewshedProjectionMatrices[t],I,D),h.push(...D);return i.viewMatrices=n,i.projectionMatrices=h,i.volumeOffset=this.selectedViewshed?.()===e.viewshed?A(e,this.view,s.eye):0,i}get test(){return{viewsheds:this._viewsheds,shadowMap:this._shadowMap,viewshedsInView:this._viewshedsInView}}};function R(e,s){const t=v();return u(t,e,s)}function P(e,s,t){const r=_(.5,.5,.5);return p(t,r),w(t,t,r),l(t,t,e),l(t,t,s),t}function x(e,s){const t=V(s.observerRenderSpace,s.farDistanceRenderSpace);return!!e.ready&&e.frustum.intersectsSphere(t)}function A(e,s,t){if(null==e)return 0;const{observerRenderSpace:r,targetRenderSpace:i}=e,o=f(t,r)>f(t,i)?e.observer:e.target;return s.pixelSizeAt(o)}e([h()],j.prototype,"selectedViewshed",void 0),e([h()],j.prototype,"isDecoration",void 0),e([h()],j.prototype,"shadowMap",null),e([h()],j.prototype,"hasViewsheds",null),e([h()],j.prototype,"_contentPixelRatio",null),e([h()],j.prototype,"_viewshedsInView",null),e([h()],j.prototype,"consumes",void 0),e([h()],j.prototype,"produces",void 0),j=e([d("geoscene.views.3d.webgl-engine.lib.ViewshedVideo")],j);const E=v(),I=m(),D=m();export{j as ViewshedVideo,A as computeOffsetScale};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see 0f735b0dec173142f3b6.js.LICENSE.txt */
|
|
1
|
+
/*! For license information please see 0f735b0dec173142f3b6.js.LICENSE.txt */
|
|
2
2
|
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5455],{37836:(t,e,n)=>{n.r(e),n.d(e,{Button:()=>$}),n(30357),n(32239);var a=n(34088),o=n(46337),r=n(48015),c=n(52567),l=n(41557),i=n(50941),s=n(21796),d=n(60992),u=n(93174),b=n(4643),p=n(83623),h=n(75572),v=n(79e3),g=n(20307);const f="content--slotted",k="icon",m="icon--start",x="icon--end",y="icon-start-empty",w="icon-end-empty",z="button-padding",E="button-padding--shrunk",C=o.AH`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host([disabled]){cursor:default;-webkit-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-block;inline-size:auto;vertical-align:middle;border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, 0))}:host a,:host button{--calcite-internal-button-content-margin: .5rem;--calcite-internal-button-padding-x: 7px;--calcite-internal-button-padding-y: 3px;position:relative;box-sizing:border-box;display:flex;block-size:100%;inline-size:100%;cursor:pointer;-webkit-user-select:none;user-select:none;appearance:none;align-items:center;justify-content:center;border-style:none;text-align:center;font-family:inherit;font-weight:var(--calcite-font-weight-normal);text-decoration-line:none;outline-color:transparent;box-shadow:var(--calcite-button-shadow, var(--calcite-shadow-none));background-color:var(--calcite-button-background-color, var(--calcite-internal-button-background-color, var(--calcite-color-transparent)));border-block-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-block-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-block-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-start-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-start-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-inline-end-color:var(--calcite-button-border-color, var(--calcite-internal-button-border-inline-end-color, var(--calcite-internal-button-border-color, var(--calcite-color-transparent))));border-style:solid;border-width:var(--calcite-border-width-sm);border-radius:var(--calcite-button-corner-radius, var(--calcite-internal-button-corner-radius, 0));color:var(--calcite-button-text-color, var(--calcite-internal-button-text-color, currentColor));padding-block:var(--calcite-internal-button-padding-y);padding-inline:var(--calcite-internal-button-padding-x);transition:color var(--calcite-animation-timing) ease-in-out,background-color var(--calcite-animation-timing) ease-in-out,box-shadow var(--calcite-animation-timing) ease-in-out,outline-color var(--calcite-internal-animation-timing-fast) ease-in-out}:host a:hover,:host button:hover{text-decoration-line:none}:host a:focus,:host button:focus{outline:var(--calcite-border-width-md) solid var(--calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)));outline:var(--calcite-border-width-md) solid var(--calcite-internal-color-focus);outline-offset:calc(var(--calcite-spacing-base) * calc(1 - (2*clamp(0,var(--calcite-offset-invert-focus),1))))}:host a span,:host button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host a calcite-loader,:host button calcite-loader{color:var(--calcite-button-loader-color, var(--calcite-internal-button-loader-color, var(--calcite-button-text-color, var(--calcite-internal-button-text-color))))}:host([round]){--calcite-internal-button-corner-radius: 50px}.content{margin-inline:var(--calcite-internal-button-content-margin)}.icon-start-empty .content{margin-inline-start:unset}.icon-end-empty .content{margin-inline-end:unset}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-content-margin: .75rem}:host([scale=l]) button,:host([scale=l]) a{--calcite-internal-button-content-margin: 1rem}:host([width=auto]){inline-size:auto}:host([width=half]){inline-size:50%}:host([width=full]){inline-size:100%}:host([alignment=center]:not([width=auto])) a,:host([alignment=center]:not([width=auto])) button{justify-content:center}:host([alignment=start]:not([width=auto])) a,:host([alignment=start]:not([width=auto])) button{justify-content:flex-start}:host([alignment=end]:not([width=auto])) a,:host([alignment=end]:not([width=auto])) button{justify-content:flex-end}:host([alignment*=space-between]:not([width=auto])) a,:host([alignment*=space-between]:not([width=auto])) button{justify-content:space-between}:host([alignment=icon-start-space-between]:not([width=auto])) .icon--start{margin-inline-end:auto}:host([alignment=icon-start-space-between]:not([width=auto])) a,:host([alignment=icon-start-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=icon-end-space-between]:not([width=auto])) .icon--end{margin-inline-start:auto}:host([alignment=icon-end-space-between]:not([width=auto])) a,:host([alignment=icon-end-space-between]:not([width=auto])) button{text-align:unset}:host([alignment=center]) a:not(.content--slotted) .icon--start+.icon--end,:host([alignment=center]) button:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:var(--calcite-internal-button-content-margin)}.icon--start,.icon--end{color:var(--calcite-button-icon-color, var(--calcite-icon-color))}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}@keyframes loader-in{0%{inline-size:0;opacity:0;transform:scale(.5)}to{inline-size:1em;opacity:1;transform:scale(1)}}@keyframes loader-out{0%{inline-size:1em;opacity:1;transform:scale(1)}to{inline-size:0;opacity:0;transform:scale(.5)}}.calcite-button--loader{display:flex}.calcite-button--loader calcite-loader{margin:0}:host([loading]) button.content--slotted .calcite-button--loader calcite-loader,:host([loading]) a.content--slotted .calcite-button--loader calcite-loader{margin-inline-end:var(--calcite-internal-button-content-margin)}:host([loading]) button:not(.content--slotted) .icon--start,:host([loading]) button:not(.content--slotted) .icon--end,:host([loading]) a:not(.content--slotted) .icon--start,:host([loading]) a:not(.content--slotted) .icon--end{display:none}:host([appearance]) button,:host([appearance]) a{--calcite-internal-button-border-color: var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([kind=brand]) button,:host([kind=brand]) a{--calcite-internal-button-text-color: var(--calcite-color-text-inverse);--calcite-internal-button-background-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse)}:host([kind=brand]) button:hover,:host([kind=brand]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-brand-hover)}:host([kind=brand]) button:active,:host([kind=brand]) a:active{--calcite-internal-button-background-color: var(--calcite-color-brand-press)}:host([kind=danger]) button,:host([kind=danger]) a{--calcite-internal-button-text-color: var(--calcite-color-text-inverse);--calcite-internal-button-background-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse)}:host([kind=danger]) button:hover,:host([kind=danger]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-status-danger-hover)}:host([kind=danger]) button:active,:host([kind=danger]) a:active{--calcite-internal-button-background-color: var(--calcite-color-status-danger-press)}:host([kind=neutral]) button,:host([kind=neutral]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-background-color: var(--calcite-color-foreground-3);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([kind=neutral]) button:hover,:host([kind=neutral]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-foreground-2)}:host([kind=neutral]) button:active,:host([kind=neutral]) a:active{--calcite-internal-button-background-color: var(--calcite-color-foreground-1)}:host([kind=inverse]) button,:host([kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-inverse);--calcite-internal-button-background-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-inverse)}:host([kind=inverse]) button:hover,:host([kind=inverse]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-inverse-hover)}:host([kind=inverse]) button:active,:host([kind=inverse]) a:active{--calcite-internal-button-background-color: var(--calcite-color-inverse-press)}:host([appearance=outline-fill]) button,:host([appearance=outline-fill]) a{--calcite-internal-button-background-color: var(--calcite-color-foreground-1);border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline-fill]) button:hover,:host([appearance=outline-fill]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-foreground-2)}:host([appearance=outline-fill]) button:active,:host([appearance=outline-fill]) a:active{--calcite-internal-button-background-color: var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=brand]) button,:host([appearance=outline-fill][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:hover,:host([appearance=outline-fill][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline-fill][kind=brand]) button:focus,:host([appearance=outline-fill][kind=brand]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=brand]) button:active,:host([appearance=outline-fill][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline-fill][kind=brand]) button calcite-loader,:host([appearance=outline-fill][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline-fill][kind=danger]) button,:host([appearance=outline-fill][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:hover,:host([appearance=outline-fill][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline-fill][kind=danger]) button:focus,:host([appearance=outline-fill][kind=danger]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=danger]) button:active,:host([appearance=outline-fill][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline-fill][kind=danger]) button calcite-loader,:host([appearance=outline-fill][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline-fill][kind=neutral]) button,:host([appearance=outline-fill][kind=neutral]) a{--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=neutral]) button:hover,:host([appearance=outline-fill][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline-fill][kind=neutral]) button:focus,:host([appearance=outline-fill][kind=neutral]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-foreground-3)}:host([appearance=outline-fill][kind=neutral]) button:active,:host([appearance=outline-fill][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=solid][kind=neutral]) button:hover,:host([appearance=solid][kind=neutral]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-border-3)}:host([appearance=solid][kind=neutral]) button:active,:host([appearance=solid][kind=neutral]) a:active{--calcite-internal-button-background-color: var(--calcite-color-border-2)}:host([appearance=outline-fill][kind=inverse]) button,:host([appearance=outline-fill][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline-fill][kind=inverse]) button:hover,:host([appearance=outline-fill][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline-fill][kind=inverse]) button:focus,:host([appearance=outline-fill][kind=inverse]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-inverse)}:host([appearance=outline-fill][kind=inverse]) button:active,:host([appearance=outline-fill][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline]) button,:host([appearance=outline]) a{--calcite-internal-button-background-color: var(--calcite-color-transparent);border-style:solid;border-width:var(--calcite-button-border-size, 1px)}:host([appearance=outline]) button:hover,:host([appearance=outline]) a:hover{--calcite-internal-button-background-color: var(--calcite-color-transparent-hover)}:host([appearance=outline]) button:active,:host([appearance=outline]) a:active{--calcite-internal-button-background-color: var(--calcite-color-transparent-press)}:host([appearance=outline][kind=brand]) button,:host([appearance=outline][kind=brand]) a{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:hover,:host([appearance=outline][kind=brand]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-brand-hover);--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=outline][kind=brand]) button:focus,:host([appearance=outline][kind=brand]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-brand);--calcite-internal-button-text-color: var(--calcite-color-brand)}:host([appearance=outline][kind=brand]) button:active,:host([appearance=outline][kind=brand]) a:active{--calcite-internal-button-border-color: var(--calcite-color-brand-press);--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=outline][kind=brand]) button calcite-loader,:host([appearance=outline][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=outline][kind=danger]) button,:host([appearance=outline][kind=danger]) a{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:hover,:host([appearance=outline][kind=danger]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-status-danger-hover);--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=outline][kind=danger]) button:focus,:host([appearance=outline][kind=danger]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-status-danger);--calcite-internal-button-text-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=danger]) button:active,:host([appearance=outline][kind=danger]) a:active{--calcite-internal-button-border-color: var(--calcite-color-status-danger-press);--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=outline][kind=danger]) button calcite-loader,:host([appearance=outline][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=outline][kind=neutral]) button,:host([appearance=outline][kind=neutral]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-border-1);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=neutral]) button:hover,:host([appearance=outline][kind=neutral]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-border-input)}:host([appearance=outline][kind=neutral]) button:focus,:host([appearance=outline][kind=neutral]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-foreground-3)}:host([appearance=outline][kind=neutral]) button:active,:host([appearance=outline][kind=neutral]) a:active{--calcite-internal-button-border-color: var(--calcite-color-text-3)}:host([appearance=outline][kind=inverse]) button,:host([appearance=outline][kind=inverse]) a{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-border-color: var(--calcite-color-inverse);--calcite-internal-button-loader-color: var(--calcite-color-text-1)}:host([appearance=outline][kind=inverse]) button:hover,:host([appearance=outline][kind=inverse]) a:hover{--calcite-internal-button-border-color: var(--calcite-color-inverse-hover)}:host([appearance=outline][kind=inverse]) button:focus,:host([appearance=outline][kind=inverse]) a:focus{--calcite-internal-button-border-color: var(--calcite-color-inverse)}:host([appearance=outline][kind=inverse]) button:active,:host([appearance=outline][kind=inverse]) a:active{--calcite-internal-button-border-color: var(--calcite-color-inverse-press)}:host([appearance=outline-fill][split-child=primary]) button,:host([appearance=outline][split-child=primary]) button,:host([appearance=outline-fill][split-child=primary]) a,:host([appearance=outline][split-child=primary]) a{border-inline-end-width:0;border-inline-start-width:1px}:host([appearance=outline-fill][split-child=secondary]) button,:host([appearance=outline][split-child=secondary]) button,:host([appearance=outline-fill][split-child=secondary]) a,:host([appearance=outline][split-child=secondary]) a{border-inline-start-width:0;border-inline-end-width:1px}:host([appearance=transparent]) button,:host([appearance=transparent]) a{--calcite-internal-button-background-color: var(--calcite-color-transparent)}:host([appearance=transparent]) button:hover,:host([appearance=transparent]) button:focus,:host([appearance=transparent]) a:hover,:host([appearance=transparent]) a:focus{--calcite-internal-button-background-color: var(--calcite-color-transparent-hover)}:host([appearance=transparent]) button:active,:host([appearance=transparent]) a:active{--calcite-internal-button-background-color: var(--calcite-color-transparent-press)}:host([appearance=transparent]:not(.enable-editing-button)) button,:host([appearance=transparent]:not(.enable-editing-button)) a{background-color:var(--calcite-color-transparent)}:host([appearance=transparent]:not(.enable-editing-button)) button:hover,:host([appearance=transparent]:not(.enable-editing-button)) a:hover{background-color:var(--calcite-color-transparent-hover)}:host([appearance=transparent]:not(.enable-editing-button)) button:active,:host([appearance=transparent]:not(.enable-editing-button)) a:active{background-color:var(--calcite-color-transparent-press)}:host([appearance=transparent][kind=brand]) button,:host([appearance=transparent][kind=brand]) a{--calcite-internal-button-text-color: var(--calcite-color-brand);--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:hover,:host([appearance=transparent][kind=brand]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-brand-hover)}:host([appearance=transparent][kind=brand]) button:focus,:host([appearance=transparent][kind=brand]) a:focus{--calcite-internal-button-text-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=brand]) button:active,:host([appearance=transparent][kind=brand]) a:active{--calcite-internal-button-text-color: var(--calcite-color-brand-press)}:host([appearance=transparent][kind=brand]) button calcite-loader,:host([appearance=transparent][kind=brand]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-brand)}:host([appearance=transparent][kind=danger]) button,:host([appearance=transparent][kind=danger]) a{--calcite-internal-button-text-color: var(--calcite-color-status-danger);--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:hover,:host([appearance=transparent][kind=danger]) a:hover{--calcite-internal-button-text-color: var(--calcite-color-status-danger-hover)}:host([appearance=transparent][kind=danger]) button:focus,:host([appearance=transparent][kind=danger]) a:focus{--calcite-internal-button-text-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=danger]) button:active,:host([appearance=transparent][kind=danger]) a:active{--calcite-internal-button-text-color: var(--calcite-color-status-danger-press)}:host([appearance=transparent][kind=danger]) button calcite-loader,:host([appearance=transparent][kind=danger]) a calcite-loader{--calcite-internal-button-loader-color: var(--calcite-color-status-danger)}:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) button,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) a,:host([appearance=transparent][kind=neutral]:not(.cancel-editing-button)) calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-1)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button{--calcite-internal-button-text-color: var(--calcite-color-text-3)}:host([appearance=transparent][kind=neutral].cancel-editing-button) button:hover{--calcite-internal-button-text-color: var(--calcite-color-text-1);--calcite-internal-button-padding-y: 0}:host(.confirm-changes-button) button:focus,:host(.cancel-editing-button) button:focus,:host(.enable-editing-button) button:focus{outline-offset:-2px}:host([appearance=transparent][kind=inverse]) button:hover,:host([appearance=transparent][kind=inverse]) a:hover{background-color:var(--calcite-color-transparent-inverse-hover)}:host([appearance=transparent][kind=inverse]) button:active,:host([appearance=transparent][kind=inverse]) a:active{background-color:var(--calcite-color-transparent-inverse-press)}:host([appearance=transparent][kind=inverse]) button calcite-loader,:host([appearance=transparent][kind=inverse]) a calcite-loader{--calcite-internal-button-text-color: var(--calcite-color-text-inverse)}:host([scale=s]) button.content--slotted,:host([scale=s]) a.content--slotted{font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s][appearance=transparent]) button.content--slotted,:host([scale=s][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .5rem}:host([scale=s]) button,:host([scale=s]) a{--calcite-internal-button-padding-y: 3px}:host([scale=m]) button.content--slotted,:host([scale=m]) a.content--slotted{--calcite-internal-button-padding-x: 11px;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) button,:host([scale=m]) a{--calcite-internal-button-padding-y: 7px}:host([scale=m][appearance=transparent]) button.content--slotted,:host([scale=m][appearance=transparent]) a.content--slotted{--calcite-internal-button-padding-x: .75rem}:host([scale=l]) button.content--slotted,:host([scale=l]) a.content--slotted{--calcite-internal-button-padding-x: 15px;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .button-padding{--calcite-internal-button-padding-x: 1rem;--calcite-internal-button-padding-y: 11px}:host([scale=l]) .button-padding--shrunk{--calcite-internal-button-padding-y: 9px}:host([scale=s]) button:not(.content--slotted),:host([scale=s]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 3px;inline-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:1.5rem}:host([scale=m]) button:not(.content--slotted),:host([scale=m]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 7px;inline-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2rem}:host([scale=l]) button:not(.content--slotted),:host([scale=l]) a:not(.content--slotted){--calcite-internal-button-padding-x: .125rem;--calcite-internal-button-padding-y: 9px;inline-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;min-block-size:2.75rem}:host(:is([scale=s],[scale=m],[scale=l])[width=full]) a:not(.content--slotted),:host(:is([scale=s],[scale=m],[scale=l])[width=full]) button:not(.content--slotted){inline-size:var(--calcite-container-size-content-fluid)}:host([scale=l][appearance=transparent]) button:not(.content--slotted),:host([scale=l][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-y: .625rem}:host([scale=s][icon-start][icon-end]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 23px;block-size:1.5rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=s][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=s][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 1.5rem}:host([scale=m][icon-start][icon-end]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2rem;block-size:2rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=m][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=m][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 33px}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end]) a:not(.content--slotted){--calcite-internal-button-padding-x: 43px;block-size:2.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l][icon-start][icon-end]) button:not(.content--slotted) .icon--start+.icon--end,:host([scale=l][icon-start][icon-end]) a:not(.content--slotted) .icon--start+.icon--end{margin-inline-start:1rem}:host([scale=l][icon-start][icon-end][appearance=transparent]) button:not(.content--slotted),:host([scale=l][icon-start][icon-end][appearance=transparent]) a:not(.content--slotted){--calcite-internal-button-padding-x: 2.75rem}:host([hidden]){display:none}[hidden]{display:none}`;class $ extends l.WF{constructor(){super(...arguments),this.attributeWatch=(0,i.oW)(["aria-expanded"],this.handleGlobalAttributesChanged),this.contentRef=(0,r._)(),this.mutationObserver=(0,b.c)("mutation",()=>this.updateHasContent()),this.resizeObserver=(0,b.c)("resize",()=>this.setTooltipText()),this.focusSetter=(0,g.u)()(this),this.messages=(0,h.u)(),this.hasContent=!1,this.alignment="center",this.appearance="solid",this.disabled=!1,this.download=!1,this.kind="brand",this.loading=!1,this.round=!1,this.scale="m",this.splitChild=!1,this.type="button",this.width="auto"}static{this.properties={hasContent:[16,{},{state:!0}],tooltipText:[16,{},{state:!0}],alignment:[3,{},{reflect:!0}],appearance:[3,{},{reflect:!0}],disabled:[7,{},{reflect:!0,type:Boolean}],download:[3,{converter:l.pf},{reflect:!0}],form:[3,{},{reflect:!0}],href:[3,{},{reflect:!0}],iconEnd:[3,{},{reflect:!0}],iconFlipRtl:[3,{},{reflect:!0}],iconStart:[3,{},{reflect:!0}],kind:[3,{},{reflect:!0}],label:1,loading:[7,{},{reflect:!0,type:Boolean}],messageOverrides:[0,{},{attribute:!1}],name:[3,{},{reflect:!0}],rel:[3,{},{reflect:!0}],round:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],splitChild:[3,{},{reflect:!0}],target:[3,{},{reflect:!0}],type:[3,{},{reflect:!0}],width:[3,{},{reflect:!0}]}}static{this.styles=C}async setFocus(t){return this.focusSetter(()=>this.childEl,t)}connectedCallback(){super.connectedCallback(),this.setupTextContentObserver(),(0,u.c)(this),this.formEl=(0,s.f)(this)}async load(){o.S$||this.updateHasContent()}updated(){(0,d.u)(this)}loaded(){this.setTooltipText()}disconnectedCallback(){super.disconnectedCallback(),this.mutationObserver?.disconnect(),(0,u.d)(this),this.resizeObserver?.disconnect(),this.formEl=null}handleGlobalAttributesChanged(){this.requestUpdate()}updateHasContent(){this.hasContent=(0,v.D)(this.el)}setupTextContentObserver(){this.mutationObserver?.observe(this.el,{childList:!0,subtree:!0})}onLabelClick(){this.handleClick(),this.setFocus()}handleClick(){const{type:t}=this;this.href||("submit"===t?(0,s.s)(this):"reset"===t&&(0,s.r)(this))}setTooltipText(){const{contentRef:{value:t}}=this;t&&(this.tooltipText=t.offsetWidth<t.scrollWidth&&this.el.innerText||null)}setChildEl(t){(0,b.u)(this.resizeObserver,this.childEl,t),this.childEl=t}render(){const t=this.href?"a":"button",e=this.href?c.eu`a`:c.eu`button`,n=this.loading?o.qy`<div class=${(0,l.CP)("calcite-button--loader")}><calcite-loader class=${(0,l.CP)(this.loading?"loading-in":"loading-out")} inline .label=${this.messages.loading} .scale=${"l"===this.scale?"m":"s"}></calcite-loader></div>`:null,a=!this.iconStart&&!this.iconEnd,i=o.qy`<calcite-icon class=${(0,l.CP)({[k]:!0,[m]:!0})} .flipRtl=${"start"===this.iconFlipRtl||"both"===this.iconFlipRtl} .icon=${this.iconStart} .scale=${(0,p.g)(this.scale)}></calcite-icon>`,s=o.qy`<calcite-icon class=${(0,l.CP)({[k]:!0,[x]:!0})} .flipRtl=${"end"===this.iconFlipRtl||"both"===this.iconFlipRtl} .icon=${this.iconEnd} .scale=${(0,p.g)(this.scale)}></calcite-icon>`,b=o.qy`<span class=${(0,l.CP)("content")} ${(0,r.K)(this.contentRef)}><slot></slot></span>`;return(0,d.I)({disabled:this.disabled,children:c.qy`<${e} .ariaBusy=${this.loading} .ariaExpanded=${this.el.ariaExpanded?this.el.ariaExpanded:null} .ariaLabel=${this.loading?this.messages.loading:(0,u.g)(this)} aria-live=polite class=${(0,l.CP)({[z]:a,[E]:!a,[f]:this.hasContent,[y]:!this.iconStart,[w]:!this.iconEnd})} .disabled=${"button"===t?this.disabled:null} download=${("a"===t?!0===this.download||""===this.download?"":this.download||null:null)??o.s6} href=${("a"===t&&this.href)??o.s6} name=${("button"===t&&this.name)??o.s6} @click=${this.handleClick} rel=${("a"===t&&this.rel)??o.s6} tabindex=${(this.disabled?-1:null)??o.s6} target=${("a"===t&&this.target)??o.s6} title=${this.tooltipText??o.s6} type=${("button"===t?this.type:null)??o.s6} ${(0,r.K)(this.setChildEl)}>${n}${this.iconStart?i:null}${this.hasContent?b:null}${this.iconEnd?s:null}</${e}>`})}}(0,a.c)("calcite-button",$)},93174:(t,e,n)=>{n.d(e,{a:()=>y,b:()=>c,c:()=>h,d:()=>v,g:()=>f,l:()=>r});var a=n(79e3);const o="calciteInternalLabelClick",r="calciteInternalLabelConnected",c="calciteInternalLabelDisconnected",l="calcite-label",i=new WeakMap,s=new WeakMap,d=new WeakMap,u=new WeakMap,b=new Set,p=t=>{const{id:e}=t,n=e&&(0,a.q)(t,{selector:`${l}[for="${e}"]`});if(n)return n;const o=(0,a.l)(t,l);return!o||function(t,e){let n;const a="custom-element-ancestor-check",o=a=>{a.stopImmediatePropagation();const o=a.composedPath();n=o.slice(o.indexOf(e),o.indexOf(t))};t.addEventListener(a,o,{once:!0}),e.dispatchEvent(new CustomEvent(a,{composed:!0,bubbles:!0})),t.removeEventListener(a,o);return n.filter(n=>n!==e&&n!==t).filter(t=>t.tagName?.includes("-")).length>0}(o,t)?null:o};function h(t){if(!t)return;const e=p(t.el);if(s.has(e)&&e===t.labelEl||!e&&b.has(t))return;const n=x.bind(t);if(e){t.labelEl=e;const a=i.get(e)||[];a.push(t),i.set(e,a.sort(g)),s.has(t.labelEl)||(s.set(t.labelEl,k),t.labelEl.addEventListener(o,k)),b.delete(t),document.removeEventListener(r,d.get(t)),u.set(t,n),document.addEventListener(c,n)}else b.has(t)||(n(),document.removeEventListener(c,u.get(t)))}function v(t){if(!t)return;if(b.delete(t),document.removeEventListener(r,d.get(t)),document.removeEventListener(c,u.get(t)),d.delete(t),u.delete(t),!t.labelEl)return;const e=i.get(t.labelEl);1===e.length&&(t.labelEl.removeEventListener(o,s.get(t.labelEl)),s.delete(t.labelEl)),i.set(t.labelEl,e.filter(e=>e!==t).sort(g)),t.labelEl=null}function g(t,e){return(0,a.m)(t.el,e.el)?-1:1}function f(t){return t.label||t.labelEl?.textContent?.trim()||""}function k(t){const e=t.detail.sourceEvent.target,n=i.get(this),a=n.find(t=>t.el===e);if(n.includes(a))return;const o=n[0];o.disabled||o.onLabelClick(t)}function m(){b.has(this)&&h(this)}function x(){b.add(this);const t=d.get(this)||m.bind(this);d.set(this,t),document.addEventListener(r,t)}async function y(t){if(await t.componentOnReady(),i.has(t))return;const e=t.ownerDocument?.getElementById(t.for);e&&requestAnimationFrame(()=>{for(const t of b)if(t.el===e){h(t);break}})}}}]);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/*! For license information please see 3a457e718a901a45902e.js.LICENSE.txt */
|
|
1
|
+
/*! For license information please see 3a457e718a901a45902e.js.LICENSE.txt */
|
|
2
2
|
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1436],{4643:(t,e,n)=>{n.d(e,{c:()=>o,u:()=>i});var s=n(46337);function o(t,e,n){if(s.S$)return;const o=function(t){class e extends window.MutationObserver{constructor(t){super(t),this.observedEntry=[],this.callback=t}observe(t,e){return this.observedEntry.push({target:t,options:e}),super.observe(t,e)}unobserve(t){const e=this.observedEntry.filter(e=>e.target!==t);this.observedEntry=[],this.callback(super.takeRecords(),this),this.disconnect(),e.forEach(t=>this.observe(t.target,t.options))}}return"intersection"===t?window.IntersectionObserver:"mutation"===t?e:window.ResizeObserver}(t);return new o(e,n)}function i(t,e,n,s){t&&(e&&t.unobserve(e),n&&(t instanceof MutationObserver?t.observe(n,s):t.observe(n)))}},20307:(t,e,n)=>{n.d(e,{u:()=>r});var s=n(50941),o=n(83623),i=n(79e3);const r=()=>(0,s.aK)((t,e)=>{let n;function s(){n?.abort()}return e.onLoad(()=>{t.listen("focus",()=>{n=new AbortController,t.el.addEventListener("focusout",s,{signal:n.signal})})}),e.onDisconnected(()=>{t.el.removeEventListener("focusout",s)}),async(e,r)=>{if(t.disabled)return;const a=function(t){if(t)return function(t){return"target"in t&&("includeContainer"in t||"strategy"in t)}(t)?t:{target:t}}(e());if(!a)return;const{target:c,includeContainer:l,strategy:h}=a,u=(0,i.k)(t.el),p=u.activeElement;return await(0,o.c)(t),p!==u.activeElement||n&&!n?.signal.aborted?void 0:(t.el.removeEventListener("focus",s),(0,i.b)(c,l,h,t.el,r))}})},32239:(t,e,n)=>{var s=n(34088),o=n(46337),i=n(41557),r=n(79e3),a=n(4643),c=n(84137);const l="flip-rtl",h="svg",u={},p={},d={s:16,m:24,l:32};function b({icon:t,scale:e}){const n=d[e],s=function(t){const e=!isNaN(Number(t.charAt(0))),n=t.split("-");if(n.length>0){const e=/[a-z]/i;t=n.map((t,n)=>t.replace(e,function(t,e){return 0===n&&0===e?t:t.toUpperCase()})).join("")}return e?`i${t}`:t}(t),o="F"===s.charAt(s.length-1);return`${o?s.substring(0,s.length-1):s}${n}${o?"F":""}`}function v(t){return u[t]}const f=o.AH`:host{--calcite-internal-color-focus: var( --calcite-color-focus, var(--calcite-ui-focus-color, var(--calcite-color-brand)) )}:host{display:inline-flex;color:var(--calcite-icon-color, var(--calcite-ui-icon-color, currentColor))}:host([scale=s]){inline-size:16px;block-size:16px;min-inline-size:16px;min-block-size:16px}:host([scale=m]){inline-size:24px;block-size:24px;min-inline-size:24px;min-block-size:24px}:host([scale=l]){inline-size:32px;block-size:32px;min-inline-size:32px;min-block-size:32px}.flip-rtl{transform:scaleX(-1)}.svg{display:block}:host([hidden]){display:none}[hidden]{display:none}`;class g extends i.WF{constructor(){super(...arguments),this.visible=!1,this.flipRtl=!1,this.icon=null,this.preload=!1,this.scale="m"}static{this.properties={pathData:[16,{},{state:!0}],visible:[16,{},{state:!0}],flipRtl:[7,{},{reflect:!0,type:Boolean}],icon:[3,{},{reflect:!0}],preload:[7,{},{reflect:!0,type:Boolean}],scale:[3,{},{reflect:!0}],textLabel:1}}static{this.styles=f}connectedCallback(){if(super.connectedCallback(),this.preload)return this.visible=!0,void this.loadIconPathData();this.visible||this.waitUntilVisible(()=>{this.visible=!0,this.loadIconPathData()})}willUpdate(t){(t.has("icon")&&(this.hasUpdated||null!==this.icon)||t.has("scale")&&(this.hasUpdated||"m"!==this.scale))&&this.loadIconPathData()}disconnectedCallback(){super.disconnectedCallback(),this.intersectionObserver?.disconnect(),this.intersectionObserver=null}async loadIconPathData(){const{icon:t,scale:e,visible:n}=this;if(o.S$||!t||!n)return;const i={icon:t,scale:e},r=v(b(i))||await async function(t){const e=b(t),n=v(e);if(n)return n;p[e]||(p[e]=fetch((0,s.g)(`./assets/icon/${e}.json`)).then(t=>t.json()).catch(()=>(c.l.error(`${t.icon} (${t.scale}) icon failed to load`),"")));const o=await p[e];return u[e]=o,o}(i);t===this.icon&&(this.pathData=r)}waitUntilVisible(t){this.intersectionObserver=(0,a.c)("intersection",e=>{e.forEach(e=>{e.isIntersecting&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null,t())})},{rootMargin:"50px"}),this.intersectionObserver?this.intersectionObserver.observe(this.el):t()}render(){const{el:t,flipRtl:e,pathData:n,scale:s,textLabel:a}=this,c=(0,r.g)(t),u=d[s],p=!!a,b=[].concat(n||"");return this.el.ariaHidden=(0,r.t)(!p),this.el.ariaLabel=p?a:null,this.el.role=p?"img":null,o.qy`<svg aria-hidden=true class=${(0,i.CP)({[l]:"rtl"===c&&e,[h]:!0})} fill=currentColor height=100% viewBox=${`0 0 ${u} ${u}`} width=100% xmlns=http://www.w3.org/2000/svg>${b.map(t=>"string"==typeof t?o.JW`<path d=${t??o.s6} />`:o.JW`<path d=${t.d??o.s6} opacity=${("opacity"in t?t.opacity:1)??o.s6} />`)}</svg>`}}(0,s.c)("calcite-icon",g)},50941:(t,e,n)=>{n.d(e,{aK:()=>v,yr:()=>y,oW:()=>w});var s=n(55333),o=n(94667);var i=n(46337),r=n(20150);const a="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),c=new Set(a),l="en",h={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},u={},p=async(t,e)=>{const n=`${e}${t}.json`;try{const t=await fetch(n);if(t.ok)return await t.json()}catch(t){return console.error(t),{}}return t===l?{}:await p(l,e)},d=t=>{const e=(0,r.Zj)(t,"lang",globalThis.navigator?.language||l);return{lang:e,t9nLocale:b(e)}},b=t=>{const[e,n]=t.split("-"),s=e.toLowerCase();let o=s;return n&&(o=`${s}-${n.toUpperCase()}`),o=h[o]??o,c.has(o)?o:n?b(s):l},v=t=>e=>g(e,t);class f extends s.C{constructor(t,e){super(t);const n=this.exports;try{(0,o.s)(this.component);const t=e(this.component,this),s=this.exports!==n;if((0,o.i)(t)){s||this.setProvisionalExports(t);const e=t.then(t=>{this.exports=t,super.catchUpLifecycle()}).catch(t=>{this.P.reject(t),console.error(t)});this.onLoad(async()=>await e)}else s&&void 0===t||(this.exports=t),queueMicrotask(()=>super.catchUpLifecycle())}catch(t){this.P.reject(t),console.error(t)}}catchUpLifecycle(){}}const g=(m=f,(...t)=>{const e=(0,o.d)(),n=new m(...t),i=n.exports;(0,o.b)(e.at(-1));const r=n.component.manager;r.W(n,i),n.watchExports(r.W.bind(r,n)),(0,o.j)(n);const a=[n.component,...e].reverse();return(0,s.t)(a,t=>void 0===t?void 0:((t,{host:e,key:n,isReactive:s},i)=>{const r=e,a=r[n]!==t.exports,c=r[n]!==i,l=i!==t.exports;if(a&&!c&&l&&(r[n]=t.exports),e===t.component){if(s){const e=t.component.manager;c&&e.W(t,r[n]),t.onUpdate(s=>{if(s.has(n)){const s=r[n];s!==t.exports&&e.W(t,s)}})}t.O=s?void 0:n}const h=t.component.constructor.elementProperties.get(n)?.readOnly;t.watchExports(()=>{r[n]!==t.exports&&(h?(0,o.f)(()=>{r[n]=t.exports}):r[n]=t.exports)})})(n,t,i),i)});var m;const w=(t,e)=>new x(t,e);class x extends s.C{#t;#e;#n;constructor(t,e){super(),i.S$||(this.#e=t,this.#n=e,this.#t=new MutationObserver(n=>{n.forEach(n=>{t.includes(n.attributeName)&&e.call(this.component,this.component.el.getAttribute(n.attributeName),n.oldValue,n.attributeName)})}))}hostConnected(){this.#e.forEach(t=>{this.component.el.hasAttribute(t)&&this.#n.call(this.component,null,this.component.el.getAttribute(t),t)}),this.#t.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#e})}hostDisconnected(){this.#t.disconnect()}}const y=t=>(e={})=>g(void 0,(n,s)=>{const o=d(n.el),i={_lang:o.lang,_t9nLocale:o.t9nLocale,_loading:!0},a=n;s.onLifecycle(()=>((e,o,i,l)=>{let h;const b=()=>(async(t,e,n=t.localName.split("-").slice(1).join("-"))=>{const{lang:s,t9nLocale:o}=d(t),i=`${e}/${n}/t9n`,r=null===n?{}:await(async(t,e,n="")=>{const s=`${e}/${n}`,o=`${s}${t}.json`;return u[o]??(u[o]=p(t,s)),await u[o]})(o,i,"messages.");return{lang:s,t9nLocale:o,t9nStrings:r}})(e,t("./assets"),l).then(t=>{h?.lang===t.lang&&h.t9nLocale===t.t9nLocale&&h.t9nStrings===t.t9nStrings||(({t9nLocale:t,t9nStrings:e,lang:o})=>{const i={...e,_lang:o,_t9nLocale:t,_loading:!1};s.exports=i;const r=e.componentLabel;"string"==typeof r&&"label"in n&&null==n.label&&(n.label??=r),c(a.messageOverrides)})(t),h=t}).catch(console.error);return queueMicrotask(b),(0,r.Yt)(e,["lang"],b)})(n.el,0,0,e.name));const c=t=>{const e=s.exports,n=e._original??e,o=$(n,t);t&&(o._original=n),s.exports=o};return"messageOverrides"in a&&s.onUpdate(t=>{t.has("messageOverrides")&&c(a.messageOverrides)}),e.blocking?(s.setProvisionalExports(i,!1),s.ready):i}),$=(t,e)=>{if(!e)return t;const n={...t};return Object.entries(e).forEach(([e,s])=>{n[e]="object"==typeof s?$(t[e],s):s??t[e]}),n}},75572:(t,e,n)=>{n.d(e,{u:()=>i});var s=n(50941),o=n(34088);const i=(0,s.yr)(o.g)},83623:(t,e,n)=>{function s(t){return"l"===t?"m":"s"}async function o(t){await t.componentOnReady(),await t.updateComplete}n.d(e,{c:()=>o,g:()=>s}),n(84137)},84137:(t,e,n)=>{n.d(e,{l:()=>c});var s=n(34088);const o=new Set,i={trace:0,debug:1,info:2,warn:4,error:8,off:10};function r(t,...e){(function(t){return i[t]>=i[s.l]})(t)&&console[t].call(this,"%ccalcite","background: #007AC2; color: #fff; border-radius: 4px; padding: 2px 4px;",...e)}let a;const c={debug:t=>r("debug",t),info:t=>r("info",t),warn:t=>r("warn",t),error:t=>r("error",t),trace:t=>r("trace",t),deprecated:function(t,{component:e,name:n,suggested:s,removalVersion:i}){const c=`${t}:${"component"===t?"":e}${n}`;if(o.has(c))return;o.add(c);const l=Array.isArray(s);l&&!a&&(a=new Intl.ListFormat("en",{style:"long",type:"disjunction"})),r("warn",`[${n}] ${t} is deprecated and will be removed in ${"future"===i?"a future version":`v${i}`}.${s?` Use ${l?a.format(s.map(t=>`"${t}"`)):`"${s}"`} instead.`:""}`)}}}}]);
|