@arcgis/core 5.0.0-next.35 → 5.0.0-next.36
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/06462b267ff8d5984882.js +1 -0
- package/assets/esri/core/workers/chunks/{b48bb38e5d60fc7a9097.js → 08ef90e3fcfd4eda4301.js} +1 -1
- package/assets/esri/core/workers/chunks/0a58b57e1777a8b0ea23.js +1 -0
- package/assets/esri/core/workers/chunks/{7115c52e22b7becff8de.js → 103153951ba312dc5e9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{f55328aabf84770c8e6a.js → 1817cf11e85afca947d3.js} +1 -1
- package/assets/esri/core/workers/chunks/20e4243ea563d05a5256.js +1 -0
- package/assets/esri/core/workers/chunks/24a3c6f0154787968724.js +1 -0
- package/assets/esri/core/workers/chunks/{fafbacf2467e6883b6c9.js → 28db329528def851efd7.js} +1 -1
- package/assets/esri/core/workers/chunks/{2367bd1cb34799a3f08a.js → 30184e39129d9c66ea54.js} +1 -1
- package/assets/esri/core/workers/chunks/3f03165487c1c2340fff.js +1 -0
- package/assets/esri/core/workers/chunks/48e2737182c75005fb8f.js +1 -0
- package/assets/esri/core/workers/chunks/{05e55118dc0023d500fc.js → 5000a37fba27464d10ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa01d1813fa78034526e.js → 51355866a0dcf41cfded.js} +1 -1
- package/assets/esri/core/workers/chunks/{a372d9af43ade7c6314c.js → 52c8687b473c9953c2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/640085b5ade5c7f16228.js +1 -0
- package/assets/esri/core/workers/chunks/727804cf901094b1d620.js +1 -0
- package/assets/esri/core/workers/chunks/{0446562aee0639c61485.js → 7420fa18ba12014b22ea.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9c2e00fed979c21e2f0.js → 8a946cbc816f373c136b.js} +1 -1
- package/assets/esri/core/workers/chunks/8c271e9272e4eaf1325a.js +1 -0
- package/assets/esri/core/workers/chunks/{2a0fe1aede5c68374ccf.js → 8ec238b5b59ef18a1713.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1dfb1323d50247e80f9.js → 9110287f272141f60c35.js} +1 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +1 -0
- package/assets/esri/core/workers/chunks/9664d9e679abc41f6c42.js +1 -0
- package/assets/esri/core/workers/chunks/{2921f05a40fda12f9f81.js → a00bba1c7cbf8cd7892c.js} +1 -1
- package/assets/esri/core/workers/chunks/a716b8fdeda4e16f03ab.js +1 -0
- package/assets/esri/core/workers/chunks/aead7c9830fa310e5b53.js +1 -0
- package/assets/esri/core/workers/chunks/{483dc4ee5d73cdfe6229.js → b075d3714fab0591d67c.js} +1 -1
- package/assets/esri/core/workers/chunks/{82cc758bddd9f8397b9f.js → b451dc416eebd0931ef8.js} +4 -4
- package/assets/esri/core/workers/chunks/b59be95949445ff5afab.js +1 -0
- package/assets/esri/core/workers/chunks/b6dec5dfdeca54bae88d.js +1 -0
- package/assets/esri/core/workers/chunks/{4356274cfa477eb6d749.js → bfb9cbe59d36d18f9157.js} +1 -1
- package/assets/esri/core/workers/chunks/{6afd59412bfc134bdf75.js → c052fb8c952cda0b5d13.js} +1 -1
- package/assets/esri/core/workers/chunks/{f2ebd6471e1259a6eac0.js → c9e7cc5d853908ab5b2f.js} +1 -1
- package/assets/esri/core/workers/chunks/{97650ee3d0eecb69ccbb.js → d8623f5f13a084e439c2.js} +5 -5
- package/assets/esri/core/workers/chunks/dd105d6e0fcedee32644.js +1 -0
- package/assets/esri/core/workers/chunks/e1148067ceae7d9eaaf8.js +1 -0
- package/assets/esri/core/workers/chunks/{b536fdb655ad293d9024.js → eb6218634a492667506a.js} +1 -1
- package/assets/esri/core/workers/chunks/{7804be2f5b3d86188a24.js → edc3d98f33d7bf959154.js} +1 -1
- package/assets/esri/core/workers/chunks/eefad79be500667af96e.js +1 -0
- package/assets/esri/core/workers/chunks/{63933cbcb5c12df09715.js → f1ac1c8b1331ec79e898.js} +1 -1
- package/assets/esri/core/workers/chunks/{2b7f9a57a2cfbc108673.js → f1b99529e2055873b65a.js} +1 -1
- package/assets/esri/core/workers/chunks/f693a4d97b2762d0e6ff.js +1 -0
- package/assets/esri/core/workers/chunks/f8caceeaa14d99c35526.js +1 -0
- package/assets/esri/core/workers/chunks/febce0d80f019dc2a427.js +1 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Attribution.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/Magnifier.glsl.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Vec4.js +1 -1
- package/interfaces.d.ts +108 -0
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/package.json +1 -1
- package/rest/knowledgeGraph/DataModel.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.js +5 -0
- package/rest/knowledgeGraph/GraphProperty.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
- package/rest/knowledgeGraphService.d.ts +3 -0
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.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/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/ScaleRangeQueries.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ensureColor4.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
- package/views/SceneView.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/032444974011118127d7.js +0 -1
- package/assets/esri/core/workers/chunks/089221bac1f019692f48.js +0 -1
- package/assets/esri/core/workers/chunks/1bfe0b2bf38d4dee7fd6.js +0 -1
- package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +0 -1
- package/assets/esri/core/workers/chunks/53d95ba86d010231fc4e.js +0 -1
- package/assets/esri/core/workers/chunks/7d3e665613927904ba4f.js +0 -1
- package/assets/esri/core/workers/chunks/a5f2da24497349239648.js +0 -1
- package/assets/esri/core/workers/chunks/a7b1b42bdb9cb9ecac45.js +0 -1
- package/assets/esri/core/workers/chunks/acaaefd4997316d319b8.js +0 -1
- package/assets/esri/core/workers/chunks/ad138b989c2c7a1168ac.js +0 -1
- package/assets/esri/core/workers/chunks/cc7c37f9ed3f831fd25c.js +0 -1
- package/assets/esri/core/workers/chunks/d14bd320f72d8e8a0ad8.js +0 -1
- package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +0 -1
- package/assets/esri/core/workers/chunks/de99c4fd1582a8e610cf.js +0 -1
- package/assets/esri/core/workers/chunks/ded3ef385d5a3a2ec8ca.js +0 -1
- package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +0 -1
- package/assets/esri/core/workers/chunks/eab0938d4ad7d7cc7309.js +0 -1
- package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +0 -1
- package/assets/esri/core/workers/chunks/ef5b13ee3362763c1096.js +0 -1
- package/assets/esri/core/workers/chunks/effbc4d240752e8ba0ab.js +0 -1
- package/assets/esri/core/workers/chunks/f403d8e414766fab2936.js +0 -1
package/views/SceneView.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as T,cast as R,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import U from"../geometry/HeightModelInfo.js";import G from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Te,cleanupViewStateManager as Re}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import Ee from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Le}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as He}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Ie}from"./3d/support/ElevationProvider.js";import{toMap as Pe,hitTest as Fe}from"./3d/support/hitTest.js";import{popupHitTest as De}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Ue,getDefaultQualityProfileName as Ge}from"./3d/support/QualityProfile.js";import We from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as qe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ze}from"./3d/support/ResourceController.js";import ke from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Be}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ne}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Qe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ye from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ze,getTiledLayerInfo as $e,checkIfTileInfoSupportedForView as Je}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ke}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Xe}from"./3d/terrain/TileRenderer.js";import{Stage as et}from"./3d/webgl-engine/Stage.js";import{olidEnabled as tt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as it}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as rt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as st}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as nt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as at}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ot from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as lt}from"./support/drapedUtils.js";import{defaultHighlightName as pt}from"./support/HighlightDefaults.js";import ht from"./support/HighlightOptions.js";import{occludeesSupported as dt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ut,createScreenPointFromSupportedEvent as ct}from"./support/screenUtils.js";import{isSpatialReferenceSupported as gt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as mt,destroyTextureCompressionWorker as yt}from"./support/TextureCompressionHelper.js";import{check as ft}from"./support/WebGLRequirements.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(ae(le(oe(pe)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ze(this),this.deconflictor=new be({view:this}),this.attribution3D=new Ee({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Le({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ot({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Ne,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Te({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=mt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(yt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=O(G,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{basemapTerrain:r}=this;if(r?.spatialReference){const e=r.groundExtent;i(new D({xmin:e[0],ymin:e[1],zmin:0,xmax:e[2],ymax:e[3],zmax:0,spatialReference:r.spatialReference}))}const s=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>s(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const n=this._get("_groundAndLayersExtent");return t.equals(n)?n:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return Mt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Ue(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new We(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ge()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?U.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ze(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):gt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===pt)??new ht}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===pt)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ke(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Pe(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Ie(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),V(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Fe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return De(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!tt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=ft(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!gt(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=$e(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===Je(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&dt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await At[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ye({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Qe({view:this})),this.addHandles([this.updatingHandles.add(()=>He.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&He.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.basemapTerrain?.extent,basemapSpatialReference:this.basemapTerrain?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Vt),this.removeHandles(St),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",qe.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.basemapTerrain?.extent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.basemapTerrain.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},w),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new et({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Be({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(nt);for(const t of this.allLayerViews)te(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(nt);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),L(),j(),at(),Re(),ye(),Ve(),k(),lt(),re(),Xe(),st(),xe(),Ae(),I(),M(),it(),Ke(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Ye.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([T()],jt.prototype,"_userClippingArea",void 0),e([T()],jt.prototype,"_resourceController",void 0),e([T()],jt.prototype,"stage",null),e([T({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([T({readOnly:!0})],jt.prototype,"labeler",void 0),e([T(P(se,"analyses"))],jt.prototype,"analyses",void 0),e([T({type:he,readOnly:!0})],jt.prototype,"animation",null),e([T({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([T({readOnly:!0})],jt.prototype,"overlayManager",null),e([T({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([T()],jt.prototype,"camera",null),e([T({type:t})],jt.prototype,"contentCamera",null),e([T({readOnly:!0})],jt.prototype,"canvas",null),e([T({type:G,useTypeForAutocast:!1})],jt.prototype,"center",null),e([T({type:D})],jt.prototype,"clippingArea",null),e([T({type:fe,nonNullable:!0})],jt.prototype,"constraints",void 0),e([T({type:D,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([T({readOnly:!0})],jt.prototype,"tileInfo",null),e([T({type:D,readOnly:!0})],jt.prototype,"dataExtent",null),e([T({type:D,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([T({type:ve})],jt.prototype,"environment",null),e([R("environment")],jt.prototype,"castEnvironment",null),e([T({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([T({type:D})],jt.prototype,"extent",null),e([T({type:r})],jt.prototype,"floors",void 0),e([T()],jt.prototype,"screenCenter",null),e([T()],jt.prototype,"frustum",null),e([T({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([T({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([T()],jt.prototype,"analysisViewManager",void 0),e([T()],jt.prototype,"groundView",void 0),e([T({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([T({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([T()],jt.prototype,"defaultsFromMapSettings",null),e([T()],jt.prototype,"interacting",null),e([T()],jt.prototype,"stationary",null),e([T()],jt.prototype,"navigating",null),e([T()],jt.prototype,"map",void 0),e([T()],jt.prototype,"padding",null),e([T({type:Qe,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([T()],jt.prototype,"_featureTiles",void 0),e([T()],jt.prototype,"featureTiles",null),e([T()],jt.prototype,"_featureTreeDebugger",void 0),e([T({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([T({constructOnly:!0})],jt.prototype,"state",void 0),e([T()],jt.prototype,"screenSizePerspective",void 0),e([T({readOnly:!0})],jt.prototype,"inputManager",void 0),e([T({readOnly:!0})],jt.prototype,"stateManager",void 0),e([T({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([T({type:We,get(){let e=this._get("qualitySettings");if(!e){const t=Ue(this.qualityProfile);e=new We(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([T()],jt.prototype,"slice",void 0),e([T({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([T({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([T({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([T({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],jt.prototype,"resolution",null),e([T({type:Number})],jt.prototype,"scale",null),e([T({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([T()],jt.prototype,"heightModelInfo",null),e([T()],jt.prototype,"spatialReference",void 0),e([T({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([T({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([T({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([T({readOnly:!0})],jt.prototype,"type",void 0),e([T(),R(e=>e instanceof wt?e:A(vt,e))],jt.prototype,"ui",void 0),e([T({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],jt.prototype,"updating",null),e([T()],jt.prototype,"_updatingObjects",null),e([T()],jt.prototype,"_updatingObjectsWithProgress",null),e([T({type:Number,readOnly:!0,dependsOn:["updating"]})],jt.prototype,"updatingProgress",void 0),e([T({type:["global","local"]})],jt.prototype,"viewingMode",null),e([T({type:i})],jt.prototype,"viewpoint",null),e([T({readOnly:!0})],jt.prototype,"visibleArea",null),e([T({type:Number})],jt.prototype,"zoom",null),e([T({type:ht})],jt.prototype,"highlightOptions",null),e([T({readOnly:!0})],jt.prototype,"quality",null),e([T({readOnly:!0})],jt.prototype,"resolutionScale",null),e([T()],jt.prototype,"focusAreasView",void 0),e([T()],jt.prototype,"_defaultToMapOptions",null),e([T()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([x("esri.views.SceneView")],jt);const Tt=H(),Rt=S(),xt=Y(),Ot=J(0,0,0,z.WebMercator),At={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import i from"../Viewpoint.js";import r from"../core/Collection.js";import{byId as s}from"../core/domUtils.js";import n from"../core/Error.js";import{on as a}from"../core/events.js";import{makeHandle as o}from"../core/handleUtils.js";import has from"../core/has.js";import l from"../core/Logger.js";import{destroyMaybe as p,maybeProperty as h}from"../core/maybe.js";import{throwIfDestroyed as d,throwIfAborted as u,createAbortError as c}from"../core/promiseUtils.js";import g from"../core/ReactiveSet.js";import{on as m,watch as y,initial as f,sync as w,whenOnce as v,syncAndInitial as _}from"../core/reactiveUtils.js";import{setFrameDuration as b,cleanupScheduling as M}from"../core/scheduling.js";import{createScreenPointArray as S,createScreenPoint as V}from"../core/screenUtils.js";import{cleanupWhereClauseCache as j}from"../core/sql.js";import{getMetersPerUnitForSR as C}from"../core/units.js";import{property as T,cast as R,subclass as x}from"../core/accessorSupport/decorators.js";import{ensureType as O,ensureClass as A}from"../core/accessorSupport/ensureType.js";import{overrideDefaultsFrom as E}from"../core/accessorSupport/overrideDefaultsFrom.js";import{drainNotificationQueue as L}from"../core/accessorSupport/trackingUtils.js";import{create as H}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import{cleanupPooledRBush as I}from"../core/libs/rbush/PooledRBush.js";import{owningCollectionProperty as P}from"../core/support/OwningCollection.js";import{initialize as F}from"../core/workers/workers.js";import D from"../geometry/Extent.js";import G from"../geometry/HeightModelInfo.js";import U from"../geometry/Point.js";import{project as W,canProjectWithoutEngine as q}from"../geometry/projectionUtils.js";import z from"../geometry/SpatialReference.js";import{cleanupSpatialReferenceEllipsoidUtils as k}from"../geometry/spatialReferenceEllipsoidUtils.js";import{projectBoundingRect as B}from"../geometry/projection/projectBoundingRect.js";import{projectPointToVector as N}from"../geometry/projection/projectPointToVector.js";import{toExtent as Q,create as Y}from"../geometry/support/aaBoundingRect.js";import{renderSRFromViewSR as Z}from"../geometry/support/coordinateSystem.js";import{getResolutionForScale as $}from"../geometry/support/scaleUtils.js";import{makeDehydratedPoint as J}from"../layers/graphics/dehydratedPoint.js";import{isImageryTileLayer as K,isTiledLayer as X,isVoxelLayer as ee,isIntegratedMeshLayer as te}from"../layers/support/layerUtils.js";import{TilemapCache as ie}from"../layers/support/TilemapCache.js";import{clearDefaultPortalInstance as re}from"../portal/portalDefault.js";import{AnalysesCollection as se}from"../support/AnalysesCollection.js";import{WebSceneTag as ne}from"../support/tagSymbols.js";import{BreakpointsOwner as ae}from"./BreakpointsOwner.js";import{DOMContainer as oe}from"./DOMContainer.js";import{PopupView as le}from"./PopupView.js";import pe from"./View.js";import he from"./ViewAnimation.js";import{stringFromViewingMode as de,viewingModeFromString as ue}from"./ViewingMode.js";import{GroundView3D as ce}from"./3d/GroundView3D.js";import{layerView3DImporter as ge}from"./3d/layerViewModuleImportUtils.js";import{importAnalysisViewModule as me}from"./3d/analysis/analysisViewModuleImportUtils.js";import{cleanupIntersectionUtils as ye}from"./3d/camera/intersectionUtils.js";import{Constraints as fe}from"./3d/constraints/Constraints.js";import{EnvironmentManager as we}from"./3d/environment/EnvironmentManager.js";import ve from"./3d/environment/SceneViewEnvironment.js";import _e from"./3d/input/SceneInputManager.js";import{GraphicsDeconflictor as be}from"./3d/layers/graphics/GraphicsDeconflictor.js";import{Labeler as Me}from"./3d/layers/graphics/Labeler.js";import Se from"./3d/layers/i3s/I3SLodHandling.js";import{cleanupStageLayerElevationProvider as Ve}from"./3d/layers/support/StageLayerElevationProvider.js";import{ScreenSizePerspective as je}from"./3d/state/ScreenSizePerspective.js";import Ce from"./3d/state/ViewState.js";import{ViewStateManager as Te,cleanupViewStateManager as Re}from"./3d/state/ViewStateManager.js";import{cleanupPointToPointAnimationController as xe}from"./3d/state/controllers/PointToPointAnimationController.js";import{SceneIntersectionHelper as Oe}from"./3d/state/helpers/SceneIntersectionHelper.js";import{cleanupNavigationUtils as Ae}from"./3d/state/utils/navigationUtils.js";import Ee from"./3d/support/Attribution3D.js";import{CombinedElevationProvider as Le}from"./3d/support/CombinedElevationProvider.js";import{debugFlags as He}from"./3d/support/debugFlags.js";import{getElevationAtPoint as Ie}from"./3d/support/ElevationProvider.js";import{toMap as Pe,hitTest as Fe}from"./3d/support/hitTest.js";import{popupHitTest as De}from"./3d/support/popupHitTest.js";import{getQualityProfileSettings as Ge,getDefaultQualityProfileName as Ue}from"./3d/support/QualityProfile.js";import We from"./3d/support/QualitySettings.js";import{RenderCoordsHelper as qe}from"./3d/support/RenderCoordsHelper.js";import{newResourceController as ze}from"./3d/support/ResourceController.js";import ke from"./3d/support/SceneViewPerformanceInfo.js";import{SharedSymbolResources as Be}from"./3d/support/SharedSymbolResources.js";import{ViewSlice as Ne}from"./3d/support/ViewSlice.js";import{PointsOfInterest as Qe}from"./3d/support/pointsOfInterest/PointsOfInterest.js";import Ye from"./3d/terrain/TerrainSurface.js";import{isSurfaceLayerView as Ze,getTiledLayerInfo as $e,checkIfTileInfoSupportedForView as Je}from"./3d/terrain/terrainUtils.js";import{clearTilePerLayerInfo as Ke}from"./3d/terrain/TilePerLayerInfo.js";import{cleanupTileRenderer as Xe}from"./3d/terrain/TileRenderer.js";import{Stage as et}from"./3d/webgl-engine/Stage.js";import{olidEnabled as tt}from"./3d/webgl-engine/effects/geometry/olidUtils.js";import{cleanupRenderOccluded as it}from"./3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js";import{defaultTolerance as rt}from"./3d/webgl-engine/lib/Intersector.js";import{cleanupShadowmap as st}from"./3d/webgl-engine/lib/ShadowMap.js";import{terrainId as nt}from"./3d/webgl-engine/lib/verticalOffsetUtils.js";import{cleanupEdgeProcessing as at}from"./3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js";import ot from"./support/AnalysisViewManager.js";import{cleanupDrapedUtils as lt}from"./support/drapedUtils.js";import{defaultHighlightName as pt}from"./support/HighlightDefaults.js";import ht from"./support/HighlightOptions.js";import{occludeesSupported as dt}from"./support/layerViewUtils.js";import{isSupportedScreenPointEvent as ut,createScreenPointFromSupportedEvent as ct}from"./support/screenUtils.js";import{isSpatialReferenceSupported as gt}from"./support/spatialReferenceSupport.js";import{initializeTextureCompressionWorker as mt,destroyTextureCompressionWorker as yt}from"./support/TextureCompressionHelper.js";import{check as ft}from"./support/WebGLRequirements.js";import wt from"./ui/DefaultUI.js";import vt from"./ui/3d/DefaultUI3D.js";import _t from"../webscene/Environment.js";import{clearVNodeCache as bt}from"../widgets/support/vnodeCache.js";var Mt;const St=Symbol(),Vt=Symbol();let jt=class extends(ae(le(oe(pe)))){static{Mt=this}constructor(e){super(e),this._userClippingArea=null,this._clippingArea=null,this._initialDefaultSpatialReference=null,this._overrideDefaultEnvironmentOnly=!0,this._resolveWhenReady=[],this._resourceController=ze(this),this.deconflictor=new be({view:this}),this.attribution3D=new Ee({view:this}),this.labeler=new Me({view:this,deconflictor:this.deconflictor.labels}),this.sharedSymbolResources=null,this.analyses=new se,this.basemapTerrain=null,this.elevationProvider=new Le({view:this}),this._canvas=null,this.constraints=new fe,this._environment=new ve,this.environmentManager=new we,this.floors=new r,this.fullOpacity=1,this.graphicsView=null,this.analysisViewManager=new ot({importAnalysisViewModule:e=>me(e),view:this}),this.groundView=null,this.map=null,this._featureTileTreeClients=new g,this._featureTiles=null,this._featureTreeDebugger=null,this.state=new Ce({view:this}),this.slice=new Ne,this.spatialReference=null,this.preserveDrawingBufferEnabled=!1,this.supersampleScreenshotsEnabled=!0,this.type="3d",this.ui=new vt,this._numUpdating=0,this._lastUpdateTime=0,this.updatingProgress=.5,this._importControllers=new Map,F();const t=(e=null)=>{null!=e&&4===e.type||(this._updatingChanged(),this.map?.allLayers.forEach(async e=>{try{await e.when()}catch(t){}this._updatingChanged()}))};this.addHandles([m(()=>this.map?.allLayers,"after-changes",e=>t(e),{onListenerAdd:()=>t(),onListenerRemove:()=>t(),sync:!0}),this.allLayerViews.on("after-changes",e=>this._updateUpdatingMonitors(e)),y(()=>this.scene,e=>e?.load().catch(()=>{}))]),this.inputManager=new _e({view:this}),this.stateManager=new Te({view:this}),this.screenSizePerspective=new je({view:this})}initialize(){if(has("enable-feature:esri-compress-textures")&&has("wasm-simd")){const e=mt(this,this.resourceController);this.addResolvingPromise(e.promise)}this.groundView=new ce({view:this}),this._updateUpdatingMonitors(),this.updatingHandles.add(()=>this.qualitySettings.memoryLimit,e=>{this.resourceController&&(this.resourceController.memoryController.maxMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.additionalCacheMemory,e=>{this.resourceController&&(this.resourceController.memoryController.additionalCacheMemory=e)},f),this.updatingHandles.add(()=>this.qualitySettings.frameRate??0,e=>b(e>0?1e3/Math.ceil(e):0),f),this.addHandles([y(()=>this.spatialReference,()=>this.notifyChange("clippingArea"),w),y(()=>({plane:this.slice.plane,isDecoration:this.slice.isDecoration}),()=>this._updateSlice(),w)])}destroy(){this.destroyed||(yt(this),this.updatingHandles.removeAll(),this.basemapTerrain?.clearHandles(),this.elevationProvider.destroy(),this.ui.removeAllHandles(),this.layerViewManager.clearHandles(),this.invalidate(),this.activeTool=null,this.layerViewManager.clear(),this._set("analysisViewManager",p(this.analysisViewManager)),this._exitSurface(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this.sharedSymbolResources=p(this.sharedSymbolResources),this._set("labeler",p(this.labeler)),this._set("deconflictor",p(this.deconflictor)),this._resourceController=p(this._resourceController),this._set("stateManager",p(this.stateManager)),this._set("inputManager",p(this.inputManager)),this.state.destroy(),this.highlights.destroy(),this.removeHandles("updatingMonitors"),this._set("environmentManager",p(this.environmentManager)),this._set("environment",p(this.environment)),this.groundView=p(this.groundView),this.slice.destroy(),this._updatingObjectsWithProgress.length=0,this._updatingObjects.length=0,this.ui?.destroy(),this._set("ui",null),this._set("renderCanvas",null),this._set("canvas",null),this._canvas=null,this.screenSizePerspective.destroy(),this.attribution3D.destroy())}get stage(){return this._stage}get renderSpatialReference(){return this.renderCoordsHelper?.spatialReference}get groundSpatialReference(){return this.basemapTerrain?.spatialReference}get animation(){return this.state?.animation}get overlayManager(){return this.basemapTerrain?.overlayManager}get camera(){return this.stateManager?.camera}set camera(e){this.stateManager&&(this.stateManager.camera=e)}get contentCamera(){return this.stateManager?.contentCamera}set contentCamera(e){this.stateManager&&(this.stateManager.contentCamera=e)}installContentCameraReset(e={sticky:!1}){return this.stateManager.installContentCameraReset(e)}get canvas(){return this._canvas}get center(){return this.stateManager?.center}set center(e){this.stateManager&&(this.stateManager.center=O(U,e))}get clippingArea(){if("global"===this.viewingMode)return null;const e=this.map;let t=this._userClippingArea||h(e,"clippingArea");return!this._userClippingArea&&!h(e,"clippingEnabled")||null==t?(this._clippingArea=null,null):t instanceof D?this.spatialReference&&(t=Ct(t,this.spatialReference),null==t)?(l.getLogger(this).error("#clippingArea","setting clippingArea with incompatible SpatialReference"),this._clippingArea):(t=t.clone(),null==t.intersection(this._groundAndLayersExtent)&&(t.xmin=t.xmax,t.ymin=t.ymax),t.zmin=void 0,t.zmax=void 0,t.equals(this._clippingArea)||(this._clippingArea=t),this._clippingArea):(l.getLogger(this).error("#clippingArea","only clippingArea geometries of type Extent are supported"),this._clippingArea)}set clippingArea(e){this.ready&&"global"===this.viewingMode&&null!=e?l.getLogger(this).error("#clippingArea=","Clipping area is only supported in local viewingMode"):this._userClippingArea=e}get renderDataExtent(){if(1===this.state.viewingMode)return null;const e=this.renderSpatialReference,t=this.dataExtent;return null==t||null==e||t.spatialReference.equals(e)?t:Ct(t,e)}get tileInfo(){return this.basemapTerrain?.tilingScheme?.toTileInfo()}get dataExtent(){let e=this._groundAndLayersExtent;const t=this.spatialReference||z.WGS84,i=Ct(this.clippingArea,t);null!=i&&(e=null!=e?e.intersection(i):i);const r=this._get("dataExtent");return null!=e&&e.equals(r)?r:e}get _groundAndLayersExtent(){const e=this.spatialReference||z.WGS84;let t;const i=i=>{const r=Ct(i,e);null!=r&&(null!=t?t.union(r):t=r.clone())},{groundView:r}=this,s=r?.spatialReference,n=r?.fullGroundExtent;s&&n&&i(new D({xmin:n[0],ymin:n[1],zmin:0,xmax:n[2],ymax:n[3],zmax:0,spatialReference:s}));const a=e=>{null==e.fullExtent||"graphics"===e.type&&e.internal||i(e.fullExtent)};if(this.map?.allLayers.forEach(e=>a(e)),null==t)return null;t.hasZ?(t.zmin=Math.min(0,t.zmin??0),t.zmax=Math.max(0,t.zmax??0)):(t.zmin=0,t.zmax=0);const o=this._get("_groundAndLayersExtent");return t.equals(o)?o:t}get environment(){return this._environment}set environment(e){if(this._environment===e)return;const{_environment:t}=this;this._environment=null,t?.destroy(),this._environment=e,this.notifyChange("environment")}castEnvironment(e){return e?e instanceof ve?e:e instanceof _t?this.environment?.cloneWithWebsceneEnvironment(e)??ve.fromWebsceneEnvironment(e):O(ve,e):new ve}get extent(){return this.stateManager?.extent}set extent(e){this.stateManager&&(this.stateManager.extent=e)}get screenCenter(){return this.stateManager?.screenCenter}get frustum(){return this.stateManager?.frustum}get layerviewCollections(){return[this.basemapView?.baseLayerViews,this.basemapView?.groundLayerViews,this.groundView?.layerViews,this.layerViews,this.basemapView?.referenceLayerViews]}get _layerToLayerviewMapping(){return Mt._layerToLayerview}static{this._layerToLayerview=pe._layerToLayerview.concat([["view.map.ground.layers","view.groundView.layerViews"]])}get initialExtentRequired(){return this.stateManager&&!this.stateManager.hasInitialView}get defaultsFromMapSettings(){return{required:{tileInfo:!1,heightModelInfo:!0,extent:!1}}}get interacting(){return this.navigating||(this.toolViewManager?.interacting??!1)}get stationary(){return!this.animation&&!this.resizing&&(this.state?.stationary??!0)}get navigating(){return this.state?.navigating??!1}get scene(){return this.map&&ne in this.map?this.map:null}get padding(){return this.stateManager?.padding}set padding(e){this.stateManager&&(this.stateManager.padding=e)}get featureTiles(){return this._featureTiles}set qualityProfile(e){const t=Ge(e);t&&this._get("qualityProfile")!==e&&(this.qualitySettings=new We(t),this.stage?.renderView.updateQualitySettings(this.qualitySettings),this._set("qualityProfile",e))}get qualityProfile(){return this._get("qualityProfile")||Ue()}_updateSlice(){null!=this.stage&&(this.stage.renderer.slice=this.slice)}get typeSpecificPreconditionsReady(){return!!this.viewingMode&&!!this.stateManager?.preinit(this.spatialReference)}get resolution(){return null!=this.spatialReference?$(this.scale,this.spatialReference):0}get scale(){return this.stateManager?.scale}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get terrainLevel(){const e=this.basemapTerrain?.tilingScheme,t=this.scale;if(!e||!t)return null;const i=e.levelAtScale(t)+this.qualitySettings.tiledSurface.lodBias,r=e.getMaxLod();return i<=0?null:Math.max(0,Math.min(i,r||1/0))}get heightModelInfo(){const e=this.getDefaultHeightModelInfo();return null!=e?G.deriveUnitFromSR(e,this.spatialReference):null}get alphaCompositingEnabled(){return this._get("alphaCompositingEnabled")}set alphaCompositingEnabled(e){this._stage&&l.getLogger(this).warn("alphaCompositingEnabled cannot be changed after the view has become ready"),this._set("alphaCompositingEnabled",e)}get updating(){if(this.destroying||this.destroyed)return!1;let e=0,t=this.layerViewManager.updating,i=t?this.layerViewManager.updatingRemaining:0;this.allLayerViews.forEach(r=>{if(r.isFulfilled()){if(r.updating){if(t=!0,r.suspended||Ze(r))return;++i,e+=r.updatingProgress}}else++i});for(const s of this._updatingObjects)if(null!=s&&s.updating){const t=.1;i+=t,e+=.5*t}for(const s of this._updatingObjectsWithProgress)null!=s&&s.updating&&(++i,e+=s.updatingProgress);const r=!this.stateManager.test.updatingIgnoreRenderState&&this.state.updating;if(t=!!(t||i>0||this.updatingHandles.updating||!this.ready||!this.stationary||r||this._importControllers.size>0||this.inputManager?.updating||this.map?.allLayers?.some(e=>!e.isFulfilled())),t?(this._numUpdating=Math.max(i,this._numUpdating),e+=this._numUpdating-i):this._numUpdating=0,this._numUpdating>0?e/=this._numUpdating:e=t?0:1,this._get("updatingProgress")!==e){const i=performance.now();if(e<1){const t=Math.min((i-this._lastUpdateTime)/2e3,1);e=this.updatingProgress*(1-t)+e*t}this._set("updatingProgress",e),this._lastUpdateTime=t&&e<1?i:0}return t}get _updatingObjects(){return[this.graphicsView,this.basemapView,this._resourceController,this.stage,this.featureTiles,this.pointsOfInterest,this.environmentManager,this.overlay,this._featureTreeDebugger,this.toolViewManager,this.analysisViewManager]}get _updatingObjectsWithProgress(){return[this.deconflictor,this.labeler,this.basemapTerrain]}get viewingMode(){const e=this._predeterminedViewingMode;if(null!=e)return de(e);const t=this.spatialReference;return t?null!=this.defaultsFromMap?.viewingMode&&t.equals(this.defaultsFromMap.spatialReference)?de(this.defaultsFromMap.viewingMode):gt(t,1)?"global":"local":"global"}set viewingMode(e){this.ready?l.getLogger(this).error("#viewingMode","viewingMode cannot be set once view is ready"):this._overrideIfSome("viewingMode",e)}get viewpoint(){return this.stateManager?.viewpoint}set viewpoint(e){this.stateManager&&(this.stateManager.viewpoint=e)}get visibleArea(){return this.stateManager?.visibleArea}get zoom(){return this.stateManager.zoom}set zoom(e){this.stateManager&&(this.stateManager.zoom=e)}get highlightOptions(){return this.highlights.find(({name:e})=>e===pt)??new ht}set highlightOptions(e){for(let t=0;t<this.highlights.length;++t){if(this.highlights.at(t).name===pt)return void this.highlights.items[t].assignFrom(e)}}get resourceController(){return this._resourceController}get quality(){return this._resourceController?.memoryController?.memoryFactor??1}get resolutionScale(){return Math.sqrt(Math.min(1,this.quality/.75))}get performanceInfo(){return new ke(this)}on(e,t,i,r){const s=this.viewEvents.on(e,t,i,r);return s||super.on(e,t)}hasEventListener(e){return super.hasEventListener(e)||this.viewEvents.hasHandler(e)}toMap(e,t){if(!this.ready)return l.getLogger(this).error("#toMap()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Pe(this,i,t,this._defaultToMapOptions)}toScreen(e){if(!this.ready)return l.getLogger(this).error("#toScreen()","Scene view cannot be used before it is ready"),null;let t=e;return null==e.z&&(t=Ot,t.x=e.x,t.y=e.y,t.z=Ie(this.elevationProvider,e)??0,t.spatialReference=e.spatialReference),N(t,Tt,this.renderSpatialReference),this.state.camera.projectToScreen(Tt,Rt),V(Rt[0],Rt[1])}pixelSizeAt(e,t){if(!this.ready)return l.getLogger(this).error("#pixelSizeAt()","Scene view cannot be used before it is ready"),null;if(!e)return 0;const i=this.renderSpatialReference;N(e,Tt,i);const r=this.state.camera.computeScreenPixelSizeAt(Tt);return t&&i!==t?r*C(i)/C(t):r}overlayPixelSizeInMapUnits(e){return this.overlayManager?.overlayPixelSizeInMapUnits(e,()=>this.pixelSizeAt(e))??1}hitTest(e,t){if(!this.ready)return l.getLogger(this).error("#hitTest()","Scene view cannot be used before it is ready"),null;const i=ut(e)?ct(this,e):e;return Fe(this,i,t,this._defaultHitTestOptions)}async popupHitTest(e){return De(this,e)}goTo(e,t){return this.updatingHandles.addPromise(this.stateManager.goTo(e,t))}async whenAnalysisView(e){if(null==e.parent)throw new n("view:no-analysisview-for-analysis","The analysis does not exist in view.analyses",{analysis:e});switch(e.parent.type){case"line-of-sight":case"dimension":case"viewshed":return(await this.whenLayerView(e.parent)).whenAnalysisView();default:return this.analysisViewManager.whenAnalysisView(e)}}whenLayerView(e){return super.whenLayerView(e)}async takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encode(i,t,this._pixelFormat())}async _takeScreenshot(e){const t=await this._completeSettings(e);await this.whenReady();const i=(await this.stage.renderView.takeScreenshot(t))[0];return(await import("./support/screenshotUtils.js")).encodeData(i,this._pixelFormat())}async _takeScreenshotWithObjectAndLayerId(e){const t=await this._completeSettings(e);t.olidColor=!0,await this.whenReady();const i=await this.stage.renderView.takeScreenshot(t),{encodeData:r}=await import("./support/screenshotUtils.js");return[r(i[0],this._pixelFormat()),r(i[1],this._pixelFormat())]}async _completeSettings(e){const{toRenderSettings:t,screenshotSuperSampleSettings:i}=await import("./support/screenshotUtils.js"),r=t(e,this);return r.pixelRatio/=this.state.pixelRatio,i(r,this.supersampleScreenshotsEnabled,this.padding)}_pixelFormat(){return{flipY:!0,premultipliedAlpha:this.stage?.renderView.getAlpha()??!1}}get test(){}async takeScreenshotWithObjectAndLayerId(e){if(!tt())throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true");const{encode:t}=await import("./support/screenshotUtils.js"),i=await this._completeSettings(e);i.olidColor=!0,await this.whenReady();const r=await this.stage.renderView.takeScreenshot(i),s=t(r[0],i,this._pixelFormat()),a=await this._completeSettings(e);a.format="png";return[s,t(r[1],a,this._pixelFormat())]}getColorToObjectAndLayerIdMapping(){const e=this.stage.renderView.olidRenderHelper;if(e)return e.getColorToObjectAndLayerIdMapping();throw new n("360vr:objectAndLayerId-rendering-disabled","has enable-feature:objectAndLayerId-rendering must be true")}addUpdatingPromise(e){return this.updatingHandles.addPromise(e)}getAttributionItems(){return super.getAttributionItems().concat(this.attribution3D.attributionItems)}importLayerView(e){return ge.importLayerView(e)}hasLayerViewModule(e){return ge.hasLayerViewModule(e)}forceDOMReadyCycle(){this.forceReadyCycle()}getDefaultSpatialReference(){return this.scene?.initialViewProperties?.spatialReference||this.defaultsFromMap?.spatialReference||this.defaultsFromMap?.ready&&this._initialDefaultSpatialReference||null}getSurface(){return this.surface}async validate(){let e=ft(this.type);const t=has("safari");if(t&&t<9&&(e=new n("sceneview:browser-not-supported","This browser is not supported by SceneView (Safari < 9)",{type:"safari",requiredVersion:9,detectedVersion:t})),null!=e)throw l.getLogger(this).warn("#validate()",e.message),e}get _predeterminedViewingMode(){const e=this._isOverridden("viewingMode")?this._get("viewingMode"):this.scene?.initialViewProperties?.viewingMode;return null!=e?ue(e):null}getSpatialReferenceSupport(e,t){const i=this._predeterminedViewingMode;if(null!=i)return this._validateSpatialReferenceForViewingMode(e,t,i)?{constraints:this._makeSpatialReferenceConstraints(e,t,i)}:null;const r=this._validateSpatialReferenceForViewingMode(e,t,2),s=this._validateSpatialReferenceForViewingMode(e,t,1);return r||s?r&&s?{constraints:this._makeSpatialReferenceConstraints(e,t,null)}:r?{constraints:this._makeSpatialReferenceConstraints(e,t,2)}:{constraints:this._makeSpatialReferenceConstraints(e,t,1)}:null}_validateSpatialReferenceForViewingMode(e,t,i){return!!gt(e,i)&&(null==t||(!!K(t)||(!X(t)||null!=$e(t,e,i))&&(!ee(t)||1!==i)))}_makeSpatialReferenceConstraints(e,t,i){if(null==t)return[{spatialReference:e,viewingMode:i}];const{isWebMercator:r,isWGS84:s}=e;if(K(t)&&(r||s)){return!s||2===i||null===Je(t.tileInfo,t.fullExtent,e,1)?[{spatialReference:e,viewingMode:i},{spatialReference:z.WebMercator,viewingMode:i}]:[{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}return X(t)||ee(t)||!r&&!s?X(t)&&r&&1!==i?[{spatialReference:e,viewingMode:i},{spatialReference:z.WGS84,viewingMode:2}]:[{spatialReference:e,viewingMode:i}]:[{spatialReference:e,viewingMode:i},{spatialReference:r?z.WGS84:z.WebMercator,viewingMode:i}]}_validateSpatialReference(e){const t=null!=this.getSpatialReferenceSupport(e),i=this._predeterminedViewingMode;return t||(null!=i?l.getLogger(this).warnOnce(`Spatial reference defined on view not supported in ${de(i)} viewing mode.`):e.isGeographic&&l.getLogger(this).warnOnce("Spatial reference is geographic but not supported.")),t}whenReady(){return new Promise(e=>{this.ready?e(this):this._resolveWhenReady.push(e)})}trackGraphicState(e){if(!e.graphic)return l.getLogger(this).error("trackGraphicState","GraphicState.graphic must not be null or undefined to start tracking"),null;const t=this.getViewForGraphic(e.graphic);let i=null,r=!1;const s=t=>{!r&&null!=t&&"processor"in t&&"graphics-3d"===t.processor?.type&&t.processor.graphicsCore&&(i=t.processor.graphicsCore.trackGraphicState(e))};return null!=t?s(t):this.whenViewForGraphic(e.graphic,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}maskOccludee(e){if(!e)return l.getLogger(this).error("maskOccludee","GraphicState.graphic must not be null or undefined to mask an occludee"),null;const t=this.getViewForGraphic(e);let i=null,r=!1;const s=t=>{!r&&null!=t&&dt(t)&&(i=t.maskOccludee(e))};return null!=t?s(t):this.whenViewForGraphic(e,{waitForLayer:!0}).then(e=>s(e),()=>{}).catch(()=>{}),o(()=>{r=!0,null!=i&&(i.remove(),i=null)})}getViewForGraphic(e){return e.layer===this?this.graphicsView:e.layer?this.allLayerViews.filter(e=>"media-3d"!==e.type).find(t=>t.layer===e.layer):null}graphicChanged(e){null!=this.graphicsView&&this.graphicsView.graphicChanged(e)}async whenViewForGraphic(e,t){return e.layer===this?(await v(()=>this.graphicsView),this.graphicsView):e.layer&&this.map?t&&t.waitForLayer&&!this.map.allLayers.includes(e.layer)?new Promise((t,i)=>{const r=this.map.allLayers.on("change",s=>{s.added.includes(e.layer)&&(r.remove(),this.whenLayerView(e.layer).then(t,i))})}):this.whenLayerView(e.layer):null}enableFeatureTiles(){const e=Symbol();return this._featureTileTreeClients.add(e),o(()=>this._featureTileTreeClients.delete(e))}async _importModule(e,t){const i=new AbortController;this._importControllers.set(e,i),this._updatingChanged();try{const r=await At[e]();if(t&&(d(this),u(i.signal),await t(i.signal)),this.destroyed)throw c();return u(i.signal),r}catch{return null}finally{this._importControllers.delete(e),this._updatingChanged()}}_abortImport(e){this._importControllers.get(e)?.abort(),this._importControllers.delete(e),this._updatingChanged()}_initBasemapTerrain(){this._set("basemapTerrain",new Ye({view:this})),this.elevationProvider.register(0,this.basemapTerrain)}_exitBasemapTerrain(){const{basemapTerrain:e,elevationProvider:t}=this;e&&(this._set("basemapTerrain",null),t.unregister(e),e.destroy())}_initGlobe(){this._initCoordinateSystem(),this.state.createInitialCamera(),this._initBasemapTerrain(),this._set("pointsOfInterest",new Qe({view:this})),this.addHandles([this.updatingHandles.add(()=>He.FEATURE_TILE_TREE_SHOW_TILES,e=>{e&&!this._featureTreeDebugger?this.updatingHandles.addPromise(import("./3d/layers/support/FeatureTileTree3DDebugger.js")).then(({FeatureTileTree3DDebugger:e})=>{!this._featureTreeDebugger&&He.FEATURE_TILE_TREE_SHOW_TILES&&(this._featureTreeDebugger=new e({view:this}))}):e||(this._featureTreeDebugger=p(this._featureTreeDebugger))},_),this.updatingHandles.add(()=>({basemapExtent:this.groundView?.groundExtent,basemapSpatialReference:this.groundView?.spatialReference,clippingArea:this.clippingArea,featureTiles:this._featureTiles}),({basemapExtent:e,basemapSpatialReference:t,clippingArea:i,featureTiles:r})=>{if(!r)return;const s=!!e;if(i||s)if(s&&t){const s=e&&t?W(Q(e,t),this.spatialReference):null;r.filterExtent=i?i.intersection(s):s}else r.filterExtent=i;else r.filterExtent=null},_),this.updatingHandles.add(()=>this._featureTileTreeClients.size>0,e=>{e?this.updatingHandles.addPromise(this._ensureFeatureTileTree()):this._featureTiles=p(this._featureTiles)},w)],St),this.stateManager.init()}async _ensureFeatureTileTree(){if(this._featureTiles||this._importControllers.has("FeatureTileTree3D"))return;const e=(await this.updatingHandles.addPromise(this._importModule("FeatureTileTree3D")))?.FeatureTileTree3D;e&&(this._featureTiles=new e({renderCoordsHelper:this.renderCoordsHelper,pointsOfInterest:this.pointsOfInterest,viewState:this.state,scheduler:this._resourceController.scheduler,terrain:this.basemapTerrain}),this._updatingChanged())}_exitTerrain(){this.stateManager.exit(),this.removeHandles(Vt),this.removeHandles(St),this._featureTiles=p(this.featureTiles),this._set("pointsOfInterest",p(this.pointsOfInterest)),this._exitBasemapTerrain(),this.state.reset(),this._exitCoordinateSystem()}_initCoordinateSystem(){if(this.spatialReference){const e=this.spatialReference,t=this.state.isGlobal,i=Z(t,e);i!==this.renderSpatialReference&&(this._set("renderCoordsHelper",qe.create(this.state.viewingMode,i)),t||this.addHandles(y(()=>this.groundView?.groundExtent,e=>{const t=this.renderCoordsHelper.spatialReference;null==e||0===e[0]&&0===e[1]&&0===e[2]&&0===e[3]||!B(e,this.groundView.spatialReference,xt,t)||(this.renderCoordsHelper.extent=xt)},w),Vt),this.sceneIntersectionHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters))}else this._set("renderCoordsHelper",null)}_exitCoordinateSystem(){this.removeHandles(Vt),this._set("renderCoordsHelper",null)}_updatingChanged(){this.notifyChange("updating")}_updateUpdatingMonitors(e=null){null!=e&&4===e.type||(this.removeHandles("updatingMonitors"),this.allLayerViews.forEach(e=>{e.destroyed||(this.addHandles(y(()=>[e.updating,e.updatingProgress],()=>this._updatingChanged(),w),"updatingMonitors"),e.when(()=>this._updatingChanged(),()=>this._updatingChanged()))}),this._updatingChanged())}async _prepareScreenshotOverlay(){this.overlay&&await this.overlay.prepare()}_renderScreenshotOverlay(e,t,i){if(!this.overlay||!this.overlay.hasVisibleItems)return i;const r=e.getContext("2d",{willReadFrequently:!0});return r.putImageData(i,0,0),this.overlay.renderCanvas(e,{disableDecorations:t}),r.getImageData(0,0,i.width,i.height)}_initStage(){const e={deactivatedWebGLExtensions:this.deactivatedWebGLExtensions,debugWebGLExtensions:this.debugWebGLExtensions,alpha:this.alphaCompositingEnabled,preserveDrawingBuffer:this.preserveDrawingBufferEnabled,canvas:this.renderCanvas,screenshot:{prepareOverlay:()=>this._prepareScreenshotOverlay(),renderOverlay:(e,t,i)=>this._renderScreenshotOverlay(e,t,i)}},t=new Oe(this.state.viewingMode,e=>this.stage.layers.forEach(e),this);this._set("sceneIntersectionHelper",t);const i=s(this.surface);this._stage=new et({view:this,options:e,container:i}),this.notifyChange("stage"),this._updateSlice(),this.addHandles([this.on("pointer-move",()=>this.stage?.renderer.resetAnimation()),a(this.stage.renderView.canvas,"webglcontextlost",e=>{this.fatalError=new n("webgl-context-lost",e.statusMessage)})],"stage"),this.renderCoordsHelper&&this.sceneIntersectionHelper.setTolerance(rt/this.renderCoordsHelper.unitInMeters),this._set("canvas",this.stage.renderView.canvas)}_exitStage(){this.sceneIntersectionHelper?.destroy(),this._set("sceneIntersectionHelper",null),this._stage=p(this.stage),this._set("stage",null),this.removeHandles("stage"),this._set("canvas",null)}_initSurface(){this._exitSurface(),this._initStage(),this._initGlobe(),this.sharedSymbolResources=new Be({view:this,resourceController:this._resourceController})}_exitSurface(){this.sharedSymbolResources&&(this.sharedSymbolResources.objectResourceCache.destroy(),this.sharedSymbolResources.destroy(),this.sharedSymbolResources=null,this._exitTerrain(),this._exitStage())}async _ensureGraphicsView(){if(this.graphicsView||this._importControllers.has("GraphicsView3D")||0===this.graphics.length)return;this.removeHandles("GraphicsView3D");const e=(await this.updatingHandles.addPromise(this._importModule("GraphicsView3D",e=>v(()=>this.basemapTerrain?.ready,e))))?.default;e&&this._set("graphicsView",new e({view:this,getGraphics:()=>this.graphics})),this._updatingChanged()}_disposeGraphicsView(){this._abortImport("GraphicsView3D"),this.removeHandles("GraphicsView3D"),this.graphicsView&&(this.removeHandles(this.graphicsView.processor.layer.id),this.graphicsView.destroy(),this._set("graphicsView",null))}_disposeFocusAreasView(){this._abortImport("FocusAreasView"),this.removeHandles("FocusAreasView"),this.focusAreasView=p(this.focusAreasView)}async _ensureFocusAreasView(e){if(this.focusAreasView||this._importControllers.has("FocusAreasView")||0===e)return;this.removeHandles("FocusAreasView");const t=(await this.updatingHandles.addPromise(this._importModule("FocusAreasView")))?.FocusAreasView;t&&(this.focusAreasView=new t({view:this})),this._updatingChanged()}_startup(){1===ue(this.viewingMode)&&(this._clippingArea=null),this._initSurface(),this._set("ready",!0),this.addHandles(m(()=>this.graphics,"after-changes",()=>this._ensureGraphicsView()),"GraphicsView3D"),this._ensureGraphicsView(),this.addHandles(y(()=>this.map?.focusAreas?.areas.length??0,e=>this._ensureFocusAreasView(e),{initial:!0}),"FocusAreasView");const e=this.scene?.initialViewProperties??null,t=e?.environment;t&&(this._overrideDefaultEnvironmentOnly?E(this.environment,t):this.environment=this.environment.cloneWithWebsceneEnvironment(t)),this.timeExtent=e?.timeExtent,e?.analyses.applyTo(this),this.labeler.setup(),this.environmentManager.connectView(this),this.inputManager.connect();const i=this._resolveWhenReady;this._resolveWhenReady=[],i.forEach(e=>e(this))}_teardown(){this._initialDefaultSpatialReference=null,this.inputManager.disconnect(),this.environmentManager.disconnectView(),this._overrideDefaultEnvironmentOnly=!1,this.labeler.dispose(),this._disposeGraphicsView(),this._disposeFocusAreasView(),this._exitSurface(),this._set("ready",!1)}get _defaultToMapOptions(){const e={include:new Set};if(!this.map)return e;this.map.ground&&e.include.add(nt);for(const t of this.allLayerViews)te(t.layer)&&e.include.add(t.uid);return e}get _defaultHitTestOptions(){const e={exclude:new Set};if(!this.map)return e;this.map.ground&&this.map.ground.opacity<1&&e.exclude.add(nt);for(const t of this.allLayerViews)te(t.layer)&&t.layer.opacity<1&&e.exclude.add(t.uid);return e}static{this.type="3d"}static clearStatics(){bt(),L(),j(),at(),Re(),ye(),Ve(),k(),lt(),re(),Xe(),st(),xe(),Ae(),I(),M(),it(),Ke(),Se.cleanupI3SLodHandling(),ie.cleanupTilemapCache(),Ce.cleanupViewstate(),Ye.cleanupTerrainSurface()}};function Ct(e,t){return null!=e&&q(e.spatialReference,t)?W(e,t):null}e([T()],jt.prototype,"_userClippingArea",void 0),e([T()],jt.prototype,"_resourceController",void 0),e([T()],jt.prototype,"stage",null),e([T({readOnly:!0})],jt.prototype,"deconflictor",void 0),e([T({readOnly:!0})],jt.prototype,"labeler",void 0),e([T(P(se,"analyses"))],jt.prototype,"analyses",void 0),e([T({type:he,readOnly:!0})],jt.prototype,"animation",null),e([T({readOnly:!0})],jt.prototype,"basemapTerrain",void 0),e([T({readOnly:!0})],jt.prototype,"overlayManager",null),e([T({readOnly:!0})],jt.prototype,"elevationProvider",void 0),e([T()],jt.prototype,"camera",null),e([T({type:t})],jt.prototype,"contentCamera",null),e([T({readOnly:!0})],jt.prototype,"canvas",null),e([T({type:U,useTypeForAutocast:!1})],jt.prototype,"center",null),e([T({type:D})],jt.prototype,"clippingArea",null),e([T({type:fe,nonNullable:!0})],jt.prototype,"constraints",void 0),e([T({type:D,readOnly:!0})],jt.prototype,"renderDataExtent",null),e([T({readOnly:!0})],jt.prototype,"tileInfo",null),e([T({type:D,readOnly:!0})],jt.prototype,"dataExtent",null),e([T({type:D,readOnly:!0})],jt.prototype,"_groundAndLayersExtent",null),e([T({type:ve})],jt.prototype,"environment",null),e([R("environment")],jt.prototype,"castEnvironment",null),e([T({readOnly:!0})],jt.prototype,"environmentManager",void 0),e([T({type:D})],jt.prototype,"extent",null),e([T({type:r})],jt.prototype,"floors",void 0),e([T()],jt.prototype,"screenCenter",null),e([T()],jt.prototype,"frustum",null),e([T({type:Number,readOnly:!0})],jt.prototype,"fullOpacity",void 0),e([T({readOnly:!0})],jt.prototype,"graphicsView",void 0),e([T()],jt.prototype,"analysisViewManager",void 0),e([T()],jt.prototype,"groundView",void 0),e([T({readOnly:!0})],jt.prototype,"layerviewCollections",null),e([T({type:Boolean})],jt.prototype,"initialExtentRequired",null),e([T()],jt.prototype,"defaultsFromMapSettings",null),e([T()],jt.prototype,"interacting",null),e([T()],jt.prototype,"stationary",null),e([T()],jt.prototype,"navigating",null),e([T()],jt.prototype,"map",void 0),e([T()],jt.prototype,"padding",null),e([T({type:Qe,readOnly:!0})],jt.prototype,"pointsOfInterest",void 0),e([T()],jt.prototype,"_featureTiles",void 0),e([T()],jt.prototype,"featureTiles",null),e([T()],jt.prototype,"_featureTreeDebugger",void 0),e([T({constructOnly:!0})],jt.prototype,"deactivatedWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"debugWebGLExtensions",void 0),e([T({constructOnly:!0})],jt.prototype,"renderCanvas",void 0),e([T({constructOnly:!0})],jt.prototype,"state",void 0),e([T()],jt.prototype,"screenSizePerspective",void 0),e([T({readOnly:!0})],jt.prototype,"inputManager",void 0),e([T({readOnly:!0})],jt.prototype,"stateManager",void 0),e([T({type:["low","medium","high"]})],jt.prototype,"qualityProfile",null),e([T({type:We,get(){let e=this._get("qualitySettings");if(!e){const t=Ge(this.qualityProfile);e=new We(t)}return e}})],jt.prototype,"qualitySettings",void 0),e([T()],jt.prototype,"slice",void 0),e([T({readOnly:!0})],jt.prototype,"typeSpecificPreconditionsReady",null),e([T({readOnly:!0})],jt.prototype,"renderCoordsHelper",void 0),e([T({readOnly:!0})],jt.prototype,"sceneIntersectionHelper",void 0),e([T({type:Number,dependsOn:["scale","spatialReference"],readOnly:!0})],jt.prototype,"resolution",null),e([T({type:Number})],jt.prototype,"scale",null),e([T({readOnly:!0,type:Number})],jt.prototype,"terrainLevel",null),e([T()],jt.prototype,"heightModelInfo",null),e([T()],jt.prototype,"spatialReference",void 0),e([T({type:Boolean,value:!1})],jt.prototype,"alphaCompositingEnabled",null),e([T({constructOnly:!0})],jt.prototype,"preserveDrawingBufferEnabled",void 0),e([T({type:Boolean})],jt.prototype,"supersampleScreenshotsEnabled",void 0),e([T({readOnly:!0})],jt.prototype,"type",void 0),e([T(),R(e=>e instanceof wt?e:A(vt,e))],jt.prototype,"ui",void 0),e([T({type:Boolean,readOnly:!0,dependsOn:["graphicsView.updating","basemapView.updating","basemapTerrain.updating","layerViewManager.updating","layerViewManager.updatingRemaining","_resourceController.updating","stage.updating","featureTiles.updating","pointsOfInterest.updating","environmentManager.updating","overlay.updating","updatingHandles.updating","featureTreeDebugger.updating","labeler.updating","deconflictor.updating","ready","stationary","inputManager.updating","toolViewManager.updating","analysisViewManager.updating","state.updating","textures.updating"]})],jt.prototype,"updating",null),e([T()],jt.prototype,"_updatingObjects",null),e([T()],jt.prototype,"_updatingObjectsWithProgress",null),e([T({type:Number,readOnly:!0,dependsOn:["updating"]})],jt.prototype,"updatingProgress",void 0),e([T({type:["global","local"]})],jt.prototype,"viewingMode",null),e([T({type:i})],jt.prototype,"viewpoint",null),e([T({readOnly:!0})],jt.prototype,"visibleArea",null),e([T({type:Number})],jt.prototype,"zoom",null),e([T({type:ht})],jt.prototype,"highlightOptions",null),e([T({readOnly:!0})],jt.prototype,"quality",null),e([T({readOnly:!0})],jt.prototype,"resolutionScale",null),e([T()],jt.prototype,"focusAreasView",void 0),e([T()],jt.prototype,"_defaultToMapOptions",null),e([T()],jt.prototype,"_defaultHitTestOptions",null),jt=Mt=e([x("esri.views.SceneView")],jt);const Tt=H(),Rt=S(),xt=Y(),Ot=J(0,0,0,z.WebMercator),At={GraphicsView3D:()=>import("./3d/layers/GraphicsView3D.js"),FocusAreasView:()=>import("./3d/FocusAreasView.js"),FeatureTileTree3D:()=>import("./3d/layers/support/FeatureTileTree3D.js")},Et=jt;export{Et as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as s,h as u,l as c,d as l,G as h}from"../../chunks/vec32.js";import{create as p,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,
|
|
5
|
+
import{distance as e,lerp as r,copy as t,equals as a}from"../../core/libs/gl-matrix-2/math/vec2.js";import{create as i,fromValues as o,fromArray as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{D as s,h as u,l as c,d as l,G as h}from"../../chunks/vec32.js";import{create as p,fromValues as v,fromArray as y}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{l as d,f,e as T}from"../../chunks/vec42.js";import{create as m,fromValues as _,fromArray as g}from"../../core/libs/gl-matrix-2/factories/vec4f64.js";import x from"../../geometry/Point.js";class R{constructor(e){this.spatialReference=e}createVector(){return this._tag(i())}pointToVector(e){return this._tag(o(e.x,e.y))}arrayToVector(e){return this._tag(o(e[0],e[1]))}vectorToArray(e){return[e[0],e[1]]}pointToArray(e){return[e.x,e.y]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=void 0,r.m=void 0,r.hasZ=!1,r.hasM=!1,r.spatialReference=this.spatialReference,r}lerp(e,t,a,i){return r(i,e,t,a)}addDelta(e,r,t){e[0]+=r,e[1]+=t}distance(r,t){return e(r,t)}getZ(e,r=void 0){return r}hasZ(){return!1}getM(e,r=void 0){return r}hasM(){return!1}clone(e){return this._tag(n(e))}copy(e,r){return t(r,e)}fromXYZ(e){return this._tag(o(e[0],e[1]))}toXYZ(e,r=p()){return u(r,e[0],e[1],0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],0)}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0)}equals(e,r){return a(e,r)}_tag(e){return e}}class Z{constructor(e,r){this._valueType=e,this.spatialReference=r}createVector(){return this._tag(p())}pointToVector(e){return this._tag(v(e.x,e.y,0===this._valueType?e.z:e.m))}arrayToVector(e){return this._tag(v(e[0],e[1],e[2]||0))}vectorToArray(e){return[e[0],e[1],e[2]]}pointToArray(e){return 0===this._valueType?[e.x,e.y,e.z]:[e.x,e.y,e.m]}vectorToPoint(e,r=new x){if(e)return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=0===this._valueType?e[2]:void 0,r.m=1===this._valueType?e[2]:void 0,r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(!e)return;r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"};const t=0===this._valueType,a=1===this._valueType;return r.x=e[0],r.y=e[1],r.z=t?e[2]:void 0,r.m=a?e[2]:void 0,r.hasZ=t,r.hasM=a,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return c(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,0===this._valueType&&(e[2]+=a)}distance(r,t){return 0===this._valueType?s(r,t):e(X(r),X(t))}getZ(e,r=void 0){return 0===this._valueType?e[2]:r}hasZ(){return 0===this._valueType}getM(e,r=void 0){return 1===this._valueType?e[2]:r}hasM(){return 1===this._valueType}clone(e){return this._tag(y(e))}copy(e,r){return l(r,e)}fromXYZ(e,r=0,t=0){return this._tag(v(e[0],e[1],0===this._valueType?e.length>2?e[2]:r:t))}toXYZ(e,r=p()){return u(r,e[0],e[1],0===this._valueType?e[2]:0)}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],1===this._valueType||e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,0===this._valueType?e.z??0:0)}equals(e,r){return h(e,r)}_tag(e){return e}}class z{constructor(e){this.spatialReference=e}createVector(){return this._tag(m())}pointToVector(e){return this._tag(_(e.x,e.y,e.z,e.m))}arrayToVector(e){return this._tag(_(e[0],e[1],e[2]||0,e[3]||0))}vectorToArray(e){return[e[0],e[1],e[2],e[3]]}pointToArray(e){return[e.x,e.y,e.z,e.m]}vectorToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}arrayToPoint(e,r=new x){return r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.spatialReference=this.spatialReference,r}vectorToDehydratedPoint(e,r){if(e)return r??={x:void 0,y:void 0,z:void 0,m:void 0,hasZ:void 0,hasM:void 0,spatialReference:void 0,type:"point"},r.x=e[0],r.y=e[1],r.z=e[2],r.m=e[3],r.hasZ=!0,r.hasM=!0,r.spatialReference=this.spatialReference,r}lerp(e,r,t,a){return d(a,e,r,t)}addDelta(e,r,t,a){e[0]+=r,e[1]+=t,e[2]+=a}distance(e,r){return s(M(e),M(r))}getZ(e){return e[2]}hasZ(){return!0}getM(e){return e[3]}hasM(){return!0}clone(e){return this._tag(g(e))}copy(e,r){return f(r,e)}fromXYZ(e,r=0,t=0){return this._tag(_(e[0],e[1],e.length>2?e[2]:r,t))}toXYZ(e,r=p()){return u(r,e[0],e[1],e[2])}arrayToXYZ(e,r=p()){return u(r,e[0],e[1],e.length<3?0:e[2])}pointToXYZ(e,r=p()){return u(r,e.x,e.y,e.z??0)}equals(e,r){return T(e,r)}_tag(e){return e}}function M(e){return e}function X(e){return e}function Y(e,r,t){return e&&r?new z(t):r?new Z(1,t):e?new Z(0,t):new R(t)}export{R as CoordinateHelper2D,Z as CoordinateHelper3D,z as CoordinateHelper4D,Y as createCoordinateHelper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as a,d as h,h as f,e as l,G as d,c as p,s as m,a as g,F as _,g as k,f as L,n as x}from"../../../chunks/vec32.js";import{create as y,UNIT_Z as z,fromValues as M,clone as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{s as T,g as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{directGeodeticSolver as j,inverseGeodeticSolver as v,InverseGeodeticSolverResult as D}from"../../../geometry/geodesicUtils.js";import{toRadians as b}from"../../../geometry/support/geodesicConstants.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{Sphere as E}from"../../../geometry/support/sphere.js";import{tangentFrame as O}from"../../3d/support/mathUtils.js";import{clone as F,asVec2 as V,createWritable as B,create as H,fromValues as J,fromVec3 as K}from"./normalizedPoint.js";import{projectPointToVerticalPlane as N,isClose as Q,projectPointToVerticalCylinder as W,projectPointToLineLike as X,intersectLineLikes as Y,intersectVerticalPlaneAndLineLike as $,intersectLineLikeAndVerticalCylinder as tt,intersectLineLikeAndCircle as et,intersectVerticalPlanes as st,intersectVerticalPlaneAndVerticalCylinder as rt,intersectVerticalCylinders as nt,intersectVerticalPlaneAndPoint as it,vectorsHaveCloseZ as ot,isPointInsidePlane as ct,pointsInsidePlane as ut}from"../../support/geometry3dUtils.js";class at{intersect(t){return St(this,t)}closestPoints(t){return[this.closestTo(t)]}}class ht extends at{constructor(t){super(),this.point=t}equals(t){return this===t||le(t)&&a(this.point,t.point)}closestTo(){return F(this.point)}}class ft extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||de(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return X(t,this.lineLike,e),e}}class lt extends ft{constructor(t,e){super(t,e,1)}}class dt extends ft{constructor(t,e){super(t,e,0)}}class pt extends at{constructor(t){super(),this.constraints=t}equals(t){return this===t||fe(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return F(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class mt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ge(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e}}class gt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||_e(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new _t(F(this.center),this.radius,J(0,0,1))}}class _t extends at{constructor(t,e,s,r){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ke(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Lt),t,kt);const r=g(kt,kt,e),n=_(r);if(Q(n,0))return F(t);const i=s/Math.sqrt(n),o=B();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ct(c,o)){const e=Ft(c,this);return e?.closestTo(t)??F(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const kt=y(),Lt=R();class xt extends at{constructor(t){super(),this.z=t}equals(t){return this===t||pe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=R()){return f(yt,0,0,this.z),Z(yt,z,t)}}const yt=y();class zt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:V(t),end:V(e),type:s}}equals(t){return this===t||me(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return N(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(Mt,s,e),n(Pt,V(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(Tt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(Tt,e[0],e[1],0),i=f(qt,s[0],s[1],0),o=l(qt,i,n);return Z(n,o,t),t}}const Mt=u(),Pt=u(),Tt=y(),qt=y();class wt extends zt{constructor(t,e){super(t,e,1)}}class jt extends zt{constructor(t,e){super(t,e,0)}}class vt extends at{constructor(t,e){super(),this.sphere=new E(t,e),this._center=P(t)}equals(t){return this===t||Le(t)&&this.sphere.exactEquals(t.sphere)}closestTo(t){const e=B();return this.sphere.projectPoint(t,e),e}get center(){return this._center}get radius(){return this.sphere.radius}}class Dt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:V(t),end:V(e),type:0}}equals(t){return this===t||xe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return It(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;Q(s[2],e)&&(s[2]=e,t.push(s))}}}class bt extends at{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||ze(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return H(this._x??t,this._y??e,this._z??s)}}class Rt extends at{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||ye(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(At,t,e),o(At,this._origin)||this._applyDirectionAndDistance(At),H(At[0],At[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ut(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=v(Zt,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const At=[0,0],Zt=new D;function Ut(t,e,s,r,n){let{azimuth:i,distance:o}=v(Gt,e,r,n);i??=0;let c=o*Math.cos((i-s)*b);c=Math.max(0,c),j(t,e,s,c,n)}const Gt=new D;function It(t,e){const s=B();return N(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??Me,s}function St(t,e){if(fe(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return he(s)}if(fe(e))return St(e,t);if(xe(t))return oe(t,e);if(xe(e))return oe(e,t);if(le(t)){const{point:s}=t;if(le(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(de(t)){if(le(e))return St(e,t);if(de(e))return ue(Y(t.lineLike,e.lineLike));if(pe(e))return Ct(t,e);if(me(e))return ue($(e.planeLike,t.lineLike));if(ge(e))return ue(tt(t.lineLike,e.center,e.radius));if(ke(e))return ue(et(t.lineLike,e));if(_e(e))return Et(t,e);if(Le(e))return Ot(t,e)}else if(pe(t)){if(le(e)||de(e))return St(e,t);if(pe(e))return Vt(t,e);if(me(e))return Bt(t,e);if(ge(e))return Ht(t,e);if(ke(e))return Kt(t,e);if(_e(e))return Jt(t,e);if(Le(e))return Nt(t,e)}else if(me(t)){if(le(e)||de(e)||pe(e))return St(e,t);if(me(e))return ce(st(t.planeLike,e.planeLike));if(ge(e))return ce(rt(t.planeLike,e.center,e.radius));if(ke(e))return Wt(t,e);if(_e(e))return Qt(t,e);if(Le(e))return Xt(t,e)}else if(ge(t)){if(le(e)||de(e)||pe(e)||me(e))return St(e,t);if(ge(e))return ce(nt(V(t.center),t.radius,V(e.center),e.radius));if(ke(e))return Yt();if(_e(e))return $t(t,e);if(Le(e))return te()}else if(ke(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e))return St(e,t);if(ke(e))return ee();if(_e(e))return ee(e.asCircle());if(Le(e))return se()}else if(_e(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||ke(e))return St(e,t);if(_e(e))return re(e,t);if(Le(e))return ne()}else if(Le(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||_e(e))return St(e,t);if(Le(e))return ie()}}const Ct=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ot(r,n)&&Q(r[2],s.z))return e;const i=B();return U(s.getPlane(t),r,n,i)?new ht(i):void 0}})();function Et({lineLike:t},{center:e,radius:s}){const r=e[2];return ue(tt(t,e,s).filter(t=>Q(t[2],r)))}function Ot({lineLike:t},{sphere:e}){return ue(e.intersectLine(t.start,t.end))}const Ft=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;O(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=Q(m,0);if(Q(C(n,u),0)){if(g)return i;if(Q(a,0))return!o||ct(o,u)?new ht(F(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=P(u);p(s,s,e,a),o&&!ct(o,s)||t.push(s);const r=P(u);return p(r,r,e,-a),o&&!ct(o,r)||t.push(r),ue(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||Q(_,1))return;const z=Math.atan(f/l),M=s(_)-z,w=Math.PI-M,j=new Array,v=y();p(v,u,e,a*Math.cos(M)),p(v,v,r,a*Math.sin(M)),j.push(v);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),j.push(D),ue(o?ut(o,j):j)}})();function Vt(t,e){return Q(t.z,e.z)?t:void 0}function Bt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return 0===e.type?new lt(o,c):new dt(o,c)}function Ht(t,e){const[s,r]=e.center;return new gt(J(s,r,t.z),e.radius)}function Jt(t,e){return Q(e.center[2],t.z)?e:void 0}const Kt=(()=>{const t=R();return(e,s)=>Ft(e.getPlane(t),s,s.slicePlane)})();function Nt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!Q(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return Q(i,0)?void 0:new gt(n,i)}const Qt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=rt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ct(t,e)&&o.push(e)}return ue(o)}})(),Wt=(()=>{const t=R(),e=R();return(s,r)=>Ft(s.getPlane(t),r,s.getSlicePlane(e))})(),Xt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=G(n,s),o=Math.abs(i);if(o>r&&!Q(o,r))return;const c=Math.sqrt(r**2-i**2);if(Q(c,0)){const t=B();return I(n,s,t),new ht(t)}const u=B(),a=P(S(n));return p(u,s,a,i),new _t(u,c,a,e.getSlicePlane())}})();function Yt(t,e){}function $t(t,e){const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return e;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),e.center[2])}function te(t,e){}function ee(t,e){}function se(t,e){}function re(t,e){if(!ot(t.center,e.center))return;const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return t;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),t.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(le(e))t.addIfOnTheGround(n,it(s,e.point));else if(de(e))t.addIfOnTheGround(n,$(s,e.lineLike));else if(ge(e))for(const[i,o]of rt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(me(e)||xe(e))for(const[i,o]of st(s,e.planeLike)){const t=r(i,o)??Me;n.push(M(i,o,t))}return ue(n)}function ce(t){return he(t.map(([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new lt(s,r)}))}function ue(t){return he(t.map(t=>t?new ht(K(t)):void 0))}function ae(t,e){return ue(t.map(([t,s])=>[t,s,e]))}function he(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new pt(e.filter(t))}function fe(t){return t instanceof pt}function le(t){return t instanceof ht}function de(t){return t instanceof ft}function pe(t){return t instanceof xt}function me(t){return t instanceof zt}function ge(t){return t instanceof mt}function _e(t){return t instanceof gt}function ke(t){return t instanceof _t}function Le(t){return t instanceof vt}function xe(t){return t instanceof Dt}function ye(t){return t instanceof Rt}function ze(t){return t instanceof bt}const Me=0;export{_t as CircleConstraint,at as Constraint,bt as CoordinateConstraint,Dt as DrapedLineConstraint,Rt as GeodesicConstraint,gt as HorizontalCircleConstraint,xt as HorizontalPlaneConstraint,lt as LineConstraint,ft as LineLikeConstraint,ht as PointConstraint,dt as RayConstraint,pt as SetConstraint,vt as SphereConstraint,mt as VerticalCylinderConstraint,wt as VerticalHalfPlaneConstraint,jt as VerticalPlaneConstraint,zt as VerticalPlaneLikeConstraint,he as constraintOrSet,le as isPoint};
|
|
5
|
+
import{isSome as t,equals as e}from"../../../core/arrayUtils.js";import{asinClamped as s}from"../../../core/mathUtils.js";import{dot as r,subtract as n,squaredDistance as i,exactEquals as o,set as c}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{create as u}from"../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{m as a,d as h,h as f,e as l,G as d,c as p,s as m,a as g,F as _,g as k,f as L,n as x}from"../../../chunks/vec32.js";import{create as y,UNIT_Z as z,fromValues as M,clone as P}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{c as T,h as q}from"../../../chunks/vec42.js";import{create as w}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{directGeodeticSolver as j,inverseGeodeticSolver as v,InverseGeodeticSolverResult as D}from"../../../geometry/geodesicUtils.js";import{toRadians as b}from"../../../geometry/support/geodesicConstants.js";import{create as R,fromPoints as A,fromPositionAndNormal as Z,intersectLine as U,signedDistance as G,projectPoint as I,getNormal as S,distance as C}from"../../../geometry/support/plane.js";import{Sphere as E}from"../../../geometry/support/sphere.js";import{tangentFrame as O}from"../../3d/support/mathUtils.js";import{clone as F,asVec2 as V,createWritable as B,create as H,fromValues as J,fromVec3 as K}from"./normalizedPoint.js";import{projectPointToVerticalPlane as N,isClose as Q,projectPointToVerticalCylinder as W,projectPointToLineLike as X,intersectLineLikes as Y,intersectVerticalPlaneAndLineLike as $,intersectLineLikeAndVerticalCylinder as tt,intersectLineLikeAndCircle as et,intersectVerticalPlanes as st,intersectVerticalPlaneAndVerticalCylinder as rt,intersectVerticalCylinders as nt,intersectVerticalPlaneAndPoint as it,vectorsHaveCloseZ as ot,isPointInsidePlane as ct,pointsInsidePlane as ut}from"../../support/geometry3dUtils.js";class at{intersect(t){return St(this,t)}closestPoints(t){return[this.closestTo(t)]}}class ht extends at{constructor(t){super(),this.point=t}equals(t){return this===t||le(t)&&a(this.point,t.point)}closestTo(){return F(this.point)}}class ft extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.lineLike={start:t,end:e,type:s}}equals(t){return this===t||de(t)&&this.lineLike.type===t.lineLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return X(t,this.lineLike,e),e}}class lt extends ft{constructor(t,e){super(t,e,1)}}class dt extends ft{constructor(t,e){super(t,e,0)}}class pt extends at{constructor(t){super(),this.constraints=t}equals(t){return this===t||fe(t)&&e(this.constraints,t.constraints,(t,e)=>t.equals(e))}closestTo(t){let e,s=1/0;for(const r of this.constraints){const n=r.closestTo(t),i=m(t,n);i<s&&(s=i,e=n)}return F(e??t)}closestPoints(t){return this.constraints.flatMap(e=>e===this?[]:e.closestPoints(t))}}class mt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||ge(t)&&this.center[0]===t.center[0]&&this.center[1]===t.center[1]&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e}}class gt extends at{constructor(t,e){super(),this.center=t,this.radius=e}equals(t){return this===t||_e(t)&&a(this.center,t.center)&&this.radius===t.radius}closestTo(t){const e=B();return W(t,this.center,this.radius,e),e[2]=this.center[2],e}asCircle(){return new _t(F(this.center),this.radius,J(0,0,1))}}class _t extends at{constructor(t,e,s,r){super(),this.center=t,this.radius=e,this.normal=s,this.slicePlane=r}equals(t){return this===t||ke(t)&&a(this.center,t.center)&&a(this.normal,t.normal)&&this.radius===t.radius}closestTo(t){const{center:e,radius:s}=this;I(this.getPlane(Lt),t,kt);const r=g(kt,kt,e),n=_(r);if(Q(n,0))return F(t);const i=s/Math.sqrt(n),o=B();p(o,e,r,i);const{slicePlane:c}=this;if(c&&!ct(c,o)){const e=Ft(c,this);return e?.closestTo(t)??F(t)}return o}getPlane(t=R()){return Z(this.center,this.normal,t)}}const kt=y(),Lt=R();class xt extends at{constructor(t){super(),this.z=t}equals(t){return this===t||pe(t)&&this.z===t.z}closestTo(t){return J(t[0],t[1],this.z)}getPlane(t=R()){return f(yt,0,0,this.z),Z(yt,z,t)}}const yt=y();class zt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.planeLike={start:V(t),end:V(e),type:s}}equals(t){return this===t||me(t)&&this.planeLike.type===t.planeLike.type&&a(this.start,t.start)&&a(this.end,t.end)}closestTo(t){const e=B();return N(t,this.planeLike,e),e}closestEndTo(t){const{start:e,end:s}=this.planeLike;return Math.sign(r(n(Mt,s,e),n(Pt,V(t),e)))>0?this.end:this.start}getPlane(t=R()){const e=h(Tt,this.end);return e[2]+=1,A(this.start,this.end,e,t)}getSlicePlane(t=R()){const{start:e,end:s,type:r}=this.planeLike;if(0===r)return;const n=f(Tt,e[0],e[1],0),i=f(qt,s[0],s[1],0),o=l(qt,i,n);return Z(n,o,t),t}}const Mt=u(),Pt=u(),Tt=y(),qt=y();class wt extends zt{constructor(t,e){super(t,e,1)}}class jt extends zt{constructor(t,e){super(t,e,0)}}class vt extends at{constructor(t,e){super(),this.sphere=new E(t,e),this._center=P(t)}equals(t){return this===t||Le(t)&&this.sphere.exactEquals(t.sphere)}closestTo(t){const e=B();return this.sphere.projectPoint(t,e),e}get center(){return this._center}get radius(){return this.sphere.radius}}class Dt extends at{constructor(t,e,s){super(),this.start=t,this.end=e,this.getZ=s,this.planeLike={start:V(t),end:V(e),type:0}}equals(t){return this===t||xe(t)&&a(this.start,t.start)&&a(this.end,t.end)&&this.getZ===t.getZ}closestTo(t){return It(this,t)}addIfOnTheGround(t,e){for(const s of e){const e=this.getZ(s[0],s[1])??0;Q(s[2],e)&&(s[2]=e,t.push(s))}}}class bt extends at{constructor(t,e,s){super(),this._x=t,this._y=e,this._z=s}equals(t){return this===t||ze(t)&&this._x===t._x&&this._y===t._y&&this._z===t._z}closestTo([t,e,s]){return H(this._x??t,this._y??e,this._z??s)}}class Rt extends at{constructor(t,e,s,r,n){super(),this._origin=t,this._spatialReference=e,this._distanceMeters=s,this._z=r,this._directionDegrees=n}equals(t){return this===t||ye(t)&&o(this._origin,t._origin)&&this._spatialReference===t._spatialReference&&this._distanceMeters===t._distanceMeters&&this._z===t._z&&this._directionDegrees===t._directionDegrees}closestTo([t,e,s]){return c(At,t,e),o(At,this._origin)||this._applyDirectionAndDistance(At),H(At[0],At[1],this._z??s)}_applyDirectionAndDistance(t){if(null!=this._directionDegrees&&null!=this._distanceMeters)j(t,this._origin,this._directionDegrees,this._distanceMeters,this._spatialReference);else if(null!=this._directionDegrees)Ut(t,this._origin,this._directionDegrees,t,this._spatialReference);else if(null!=this._distanceMeters){const{azimuth:e}=v(Zt,this._origin,t,this._spatialReference);j(t,this._origin,e??0,this._distanceMeters,this._spatialReference)}}}const At=[0,0],Zt=new D;function Ut(t,e,s,r,n){let{azimuth:i,distance:o}=v(Gt,e,r,n);i??=0;let c=o*Math.cos((i-s)*b);c=Math.max(0,c),j(t,e,s,c,n)}const Gt=new D;function It(t,e){const s=B();return N(e,t.planeLike,s),s[2]=t.getZ(s[0],s[1])??Me,s}function St(t,e){if(fe(t)){const s=[];for(const r of t.constraints){const t=r.intersect(e);t&&s.push(t)}return he(s)}if(fe(e))return St(e,t);if(xe(t))return oe(t,e);if(xe(e))return oe(e,t);if(le(t)){const{point:s}=t;if(le(e))return a(s,e.point)?t:void 0;const r=e.closestTo(s);return d(r,s)?t:void 0}if(de(t)){if(le(e))return St(e,t);if(de(e))return ue(Y(t.lineLike,e.lineLike));if(pe(e))return Ct(t,e);if(me(e))return ue($(e.planeLike,t.lineLike));if(ge(e))return ue(tt(t.lineLike,e.center,e.radius));if(ke(e))return ue(et(t.lineLike,e));if(_e(e))return Et(t,e);if(Le(e))return Ot(t,e)}else if(pe(t)){if(le(e)||de(e))return St(e,t);if(pe(e))return Vt(t,e);if(me(e))return Bt(t,e);if(ge(e))return Ht(t,e);if(ke(e))return Kt(t,e);if(_e(e))return Jt(t,e);if(Le(e))return Nt(t,e)}else if(me(t)){if(le(e)||de(e)||pe(e))return St(e,t);if(me(e))return ce(st(t.planeLike,e.planeLike));if(ge(e))return ce(rt(t.planeLike,e.center,e.radius));if(ke(e))return Wt(t,e);if(_e(e))return Qt(t,e);if(Le(e))return Xt(t,e)}else if(ge(t)){if(le(e)||de(e)||pe(e)||me(e))return St(e,t);if(ge(e))return ce(nt(V(t.center),t.radius,V(e.center),e.radius));if(ke(e))return Yt();if(_e(e))return $t(t,e);if(Le(e))return te()}else if(ke(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e))return St(e,t);if(ke(e))return ee();if(_e(e))return ee(e.asCircle());if(Le(e))return se()}else if(_e(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||ke(e))return St(e,t);if(_e(e))return re(e,t);if(Le(e))return ne()}else if(Le(t)){if(le(e)||de(e)||pe(e)||me(e)||ge(e)||_e(e))return St(e,t);if(Le(e))return ie()}}const Ct=(()=>{const t=R();return(e,s)=>{const{start:r,end:n}=e;if(ot(r,n)&&Q(r[2],s.z))return e;const i=B();return U(s.getPlane(t),r,n,i)?new ht(i):void 0}})();function Et({lineLike:t},{center:e,radius:s}){const r=e[2];return ue(tt(t,e,s).filter(t=>Q(t[2],r)))}function Ot({lineLike:t},{sphere:e}){return ue(e.intersectLine(t.start,t.end))}const Ft=(()=>{const t=w(),e=y(),r=y();return(n,i,o)=>{const{normal:c,center:u,radius:a}=i;O(c,e,r);const h=S(n),f=a*k(h,e),l=a*k(h,r);T(t,u[0],u[1],u[2],1);const d=q(n,t),m=Math.hypot(f,l),g=Q(m,0);if(Q(C(n,u),0)){if(g)return i;if(Q(a,0))return!o||ct(o,u)?new ht(F(u)):void 0;L(e,h,c),x(e,e);const t=new Array,s=P(u);p(s,s,e,a),o&&!ct(o,s)||t.push(s);const r=P(u);return p(r,r,e,-a),o&&!ct(o,r)||t.push(r),ue(t)}if(g)return;const _=-d/m;if(Math.abs(_)>1||Q(_,1))return;const z=Math.atan(f/l),M=s(_)-z,w=Math.PI-M,j=new Array,v=y();p(v,u,e,a*Math.cos(M)),p(v,v,r,a*Math.sin(M)),j.push(v);const D=y();return p(D,u,e,a*Math.cos(w)),p(D,D,r,a*Math.sin(w)),j.push(D),ue(o?ut(o,j):j)}})();function Vt(t,e){return Q(t.z,e.z)?t:void 0}function Bt({z:t},{planeLike:e}){const[s,r]=e.start,[n,i]=e.end,o=J(s,r,t),c=J(n,i,t);return 0===e.type?new lt(o,c):new dt(o,c)}function Ht(t,e){const[s,r]=e.center;return new gt(J(s,r,t.z),e.radius)}function Jt(t,e){return Q(e.center[2],t.z)?e:void 0}const Kt=(()=>{const t=R();return(e,s)=>Ft(e.getPlane(t),s,s.slicePlane)})();function Nt(t,{center:e,radius:s}){const r=Math.abs(e[2]-t.z);if(r>s&&!Q(r,s))return;const n=J(e[0],e[1],t.z),i=Math.sqrt(s**2-r**2);return Q(i,0)?void 0:new gt(n,i)}const Qt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=rt(e.planeLike,s,r),i=s[2];e.getSlicePlane(t);const o=new Array;for(const[c,u]of n){const e=[c,u,i];ct(t,e)&&o.push(e)}return ue(o)}})(),Wt=(()=>{const t=R(),e=R();return(s,r)=>Ft(s.getPlane(t),r,s.getSlicePlane(e))})(),Xt=(()=>{const t=R();return(e,{center:s,radius:r})=>{const n=e.getPlane(t),i=G(n,s),o=Math.abs(i);if(o>r&&!Q(o,r))return;const c=Math.sqrt(r**2-i**2);if(Q(c,0)){const t=B();return I(n,s,t),new ht(t)}const u=B(),a=P(S(n));return p(u,s,a,i),new _t(u,c,a,e.getSlicePlane())}})();function Yt(t,e){}function $t(t,e){const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return e;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),e.center[2])}function te(t,e){}function ee(t,e){}function se(t,e){}function re(t,e){if(!ot(t.center,e.center))return;const s=i(V(t.center),V(e.center));if(Q(s,0)&&Q(t.radius,e.radius))return t;return ae(nt(V(t.center),t.radius,V(e.center),e.radius),t.center[2])}function ne(t,e){}function ie(t,e){}function oe(t,e){const{planeLike:s,getZ:r}=t,n=new Array;if(le(e))t.addIfOnTheGround(n,it(s,e.point));else if(de(e))t.addIfOnTheGround(n,$(s,e.lineLike));else if(ge(e))for(const[i,o]of rt(s,e.center,e.radius)){const t=r(i,o);null!=t&&n.push(M(i,o,t))}else if(me(e)||xe(e))for(const[i,o]of st(s,e.planeLike)){const t=r(i,o)??Me;n.push(M(i,o,t))}return ue(n)}function ce(t){return he(t.map(([t,e])=>{const s=J(t,e,0),r=J(t,e,1);return new lt(s,r)}))}function ue(t){return he(t.map(t=>t?new ht(K(t)):void 0))}function ae(t,e){return ue(t.map(([t,s])=>[t,s,e]))}function he(e){if(0!==e.length)return 1===e.length?e[0]??void 0:new pt(e.filter(t))}function fe(t){return t instanceof pt}function le(t){return t instanceof ht}function de(t){return t instanceof ft}function pe(t){return t instanceof xt}function me(t){return t instanceof zt}function ge(t){return t instanceof mt}function _e(t){return t instanceof gt}function ke(t){return t instanceof _t}function Le(t){return t instanceof vt}function xe(t){return t instanceof Dt}function ye(t){return t instanceof Rt}function ze(t){return t instanceof bt}const Me=0;export{_t as CircleConstraint,at as Constraint,bt as CoordinateConstraint,Dt as DrapedLineConstraint,Rt as GeodesicConstraint,gt as HorizontalCircleConstraint,xt as HorizontalPlaneConstraint,lt as LineConstraint,ft as LineLikeConstraint,ht as PointConstraint,dt as RayConstraint,pt as SetConstraint,vt as SphereConstraint,mt as VerticalCylinderConstraint,wt as VerticalHalfPlaneConstraint,jt as VerticalPlaneConstraint,zt as VerticalPlaneLikeConstraint,he as constraintOrSet,le as isPoint};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../../core/Logger.js";import{property as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../core/Logger.js";import{property as n,subclass as i}from"../../core/accessorSupport/decorators.js";import o from"../../geometry/SpatialReference.js";import{toExtent as r}from"../../geometry/support/aaBoundingRect.js";import{extentContainsXYZ as a}from"../../geometry/support/contains.js";import{GroundViewElevationSampler as s}from"./GroundViewElevationSampler.js";let l=class extends s{initialize(){this.view.basemapTerrain.on("elevation-change",()=>this.emit("changed",{}))}get demResolution(){return this.view.basemapTerrain.demResolution}get extent(){const{groundView:e}=this.view;if(null==e?.groundExtent||null==e.spatialReference)return null;const t=r(e.groundExtent,e.spatialReference);return t.zmin=e.visibleElevationRange.minElevation,t.zmax=e.visibleElevationRange.maxElevation,t}get spatialReference(){return this.view.basemapTerrain?.spatialReference??o.WGS84}elevationAt(e,n){if(null==this.extent||!a(this.extent,e,n)){const i=null!=this.extent?`${this.extent.xmin}, ${this.extent.ymin}, ${this.extent.xmax}, ${this.extent.ymax}`:null;return t.getLogger(this).warn("#elevationAt()",`Point used to sample elevation (${e}, ${n}) is outside of the sampler extent (${i})`),this.noDataValue}return this.view.elevationProvider?.getElevation(e,n,0,this.spatialReference,"ground")??this.noDataValue}};e([n({readOnly:!0})],l.prototype,"demResolution",null),e([n({readOnly:!0})],l.prototype,"extent",null),e([n()],l.prototype,"spatialReference",null),l=e([i("esri.views.support.GroundElevationSampler")],l);export{l as GroundElevationSampler};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as g}from"./SelectionList/selectionListUtils.js";import y from"./SelectionList/SelectionListViewModel.js";import I from"./SelectionList/VisibleElements.js";const b="esri-selection-list",f=`${b}__list-item`,w={base:b,container:`${b}__container`,flowItem:`${b}__flow-item`,layerDropdown:`${b}__layer-dropdown`,listItemFeature:`${f}__feature`,listItemFeatureIcon:`${f}__feature-icon`,listItemIcon:`${f}__icon`,itemCount:`${b}__item-count`,notice:`${b}__notice`,panel:`${b}__panel`,totalCount:`${b}__total-count`};let _=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!1,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.viewModel=new y,this.visibleElements=new I,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return h("div",{class:this.classes(w.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:w.flowItem,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:w.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:w.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:w.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:w.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:w.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:w.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=g(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{appearance:"transparent","data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,type:r}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!r||"feature"===r&&o||"layer"===r&&l||"group"===r&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?w.listItemFeatureIcon:w.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:w.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],_.prototype,"_hasFilterText",null),e([n()],_.prototype,"_itemWithOpenMenu",void 0),e([n()],_.prototype,"_list",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"displayMode",void 0),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"filterText",null),e([n()],_.prototype,"highlightOnHoverEnabled",void 0),e([n()],_.prototype,"icon",null),e([n()],_.prototype,"itemActionConfigs",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"label",null),e([n()],_.prototype,"layer",null),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],_.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],_.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],_.prototype,"messagesLegend",void 0),e([n()],_.prototype,"onListItemSelect",void 0),e([n()],_.prototype,"scale",void 0),e([n()],_.prototype,"selectionManager",null),e([n()],_.prototype,"state",null),e([n()],_.prototype,"view",null),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"viewModel",void 0),e([n({type:I,nonNullable:!0})],_.prototype,"visibleElements",void 0),e([n()],_.prototype,"visibleFeatureCount",null),e([n()],_.prototype,"visibleFeatureItems",null),e([n()],_.prototype,"visibleLayerCount",null),_=e([r("esri.widgets.support.SelectionList")],_);const C=_;export{C as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{substitute as t,formatNumber as i}from"../../intl.js";import{isSome as s}from"../../core/arrayUtils.js";import{on as o,watch as l}from"../../core/reactiveUtils.js";import{property as n,subclass as r}from"../../core/accessorSupport/decorators.js";import a from"../Widget.js";import{loadCalciteComponents as c}from"./componentsUtils.js";import{globalCss as m}from"./globalCss.js";import{messageBundle as d,tsx as h}from"./widget.js";import{storeNode as p}from"./widgetUtils.js";import{isGroupLayerItem as u,isLayerItem as v,isFeatureItem as g}from"./SelectionList/selectionListUtils.js";import y from"./SelectionList/SelectionListViewModel.js";import I from"./SelectionList/VisibleElements.js";const b="esri-selection-list",f=`${b}__list-item`,w={base:b,container:`${b}__container`,flowItem:`${b}__flow-item`,layerDropdown:`${b}__layer-dropdown`,listItemFeature:`${f}__feature`,listItemFeatureIcon:`${f}__feature-icon`,listItemIcon:`${f}__icon`,itemCount:`${b}__item-count`,notice:`${b}__notice`,panel:`${b}__panel`,totalCount:`${b}__total-count`};let _=class extends a{constructor(e,i){super(e,i),this._iconIntersectionObserver=new IntersectionObserver((e,i)=>{e.forEach(async e=>{if(e.isIntersecting){const s=e.target;if(this._hasIcon(s))return void i.unobserve(s);const o=this._getListItem(s);if(!o)return;this._setHasIcon(s,!0);const l=o.title?t(this.messagesLegend.previewTemplateAriaLabel,{label:o.title}):this.messagesCommon.preview,n=o.thumbnail??await o.fetchThumbnail({ariaLabel:l}).catch(()=>(this._setHasIcon(s,!1),null));if(null==n)return;s.appendChild(n)}})}),this._itemWithOpenMenu=null,this._list=null,this.displayMode="group",this.highlightOnHoverEnabled=!0,this.itemActionConfigs=null,this.menuScale="m",this.messages=null,this.messagesCommon=null,this.messagesLegend=null,this.onListItemSelect=null,this.scale="s",this.viewModel=new y,this.visibleElements=new I,this._afterItemCreate=e=>{this._iconIntersectionObserver?.observe(e)},this._afterItemRemoved=e=>{this._iconIntersectionObserver?.unobserve(e)},this.clear=this.clear.bind(this),this.collapseItems=this.collapseItems.bind(this),this.removeTemporaryHighlight=this.removeTemporaryHighlight.bind(this)}initialize(){this.addHandles([o(()=>this.effectiveSelectionManager,"selection-change",()=>this._closeItemMenu()),l(()=>this.highlightOnHoverEnabled,e=>{e||this.removeTemporaryHighlight()})])}destroy(){this._iconIntersectionObserver?.disconnect(),this._iconIntersectionObserver=null}loadDependencies(){return c({action:()=>import("@esri/calcite-components/dist/components/calcite-action"),chip:()=>import("@esri/calcite-components/dist/components/calcite-chip"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),flow:()=>import("@esri/calcite-components/dist/components/calcite-flow"),"flow-item":()=>import("@esri/calcite-components/dist/components/calcite-flow-item"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon"),input:()=>import("@esri/calcite-components/dist/components/calcite-input"),list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")})}get _hasFilterText(){const{filterText:e}=this;return null!=e&&""!==e}get activeLayerItem(){return this.viewModel.activeLayerItem}get allLayerItems(){return this.viewModel.allLayerItems}get effectiveCount(){return this.viewModel.effectiveCount}get effectiveSelectionManager(){return this.viewModel.effectiveSelectionManager}get filterText(){return this.viewModel.filterText}set filterText(e){this.viewModel.filterText=e}get icon(){return"selection"}set icon(e){this._overrideIfSome("icon",e)}get isUpdating(){return this.viewModel.isUpdating}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get layerItems(){return this.viewModel.layerItems}get layerViewMap(){return this.viewModel.layerViewMap}get maxVisibleFeatureCountExceeded(){return this.viewModel.maxVisibleFeatureCountExceeded}get maxVisibleFeatureCountPerLayer(){return this.viewModel.maxVisibleFeatureCountPerLayer}set maxVisibleFeatureCountPerLayer(e){this.viewModel.maxVisibleFeatureCountPerLayer=e}get selectionManager(){return this.viewModel.selectionManager}set selectionManager(e){this.viewModel.selectionManager=e}get state(){return this.viewModel.state}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get viewLayersAndTables(){return this.viewModel.viewLayersAndTables}get visibleFeatureCount(){return this.viewModel.visibleFeatureCount}get visibleFeatureItems(){return this.viewModel.visibleFeatureItems}get visibleLayerCount(){return this.viewModel.visibleLayerCount}addTemporaryHighlight(e){this.viewModel.addTemporaryHighlight(e)}clear(){this.viewModel.clear()}deselectFeatureItem(e){this.viewModel.deselectFeatureItem(e)}deselectGroupItem(e){this.viewModel.deselectGroupItem(e)}deselectLayerItem(e){this.viewModel.deselectLayerItem(e)}deselectItem(e){this.viewModel.deselectItem(e)}collapseItems(){this._list?.filteredItems.forEach(e=>e.expanded=!1)}goToItem(e){this.viewModel.goToItem(e)}removeFromSelection(e){this.viewModel.removeFromSelection(e)}removeTemporaryHighlight(){this.viewModel.removeTemporaryHighlight()}selectSingleFeatureItem(e){this.viewModel.selectSingleFeatureItem(e)}selectSingleGroupItem(e){this.viewModel.selectSingleGroupItem(e)}selectSingleItem(e){this.viewModel.selectSingleItem(e)}selectSingleLayerItem(e){this.viewModel.selectSingleLayerItem(e)}setSelection(e){this.viewModel.setSelection(e)}render(){return h("div",{class:this.classes(w.base,m.widget,m.panel)},h("calcite-flow",null,h("calcite-flow-item",{class:w.flowItem,heading:this.visibleElements.header?this.messages.selection:void 0,loading:"loading"===this.state,overlayPositioning:"fixed",scale:this.scale,selected:!0},h("calcite-panel",{class:w.panel,overlayPositioning:"fixed",scale:this.scale},h("div",{class:w.container},this._renderActiveLayerDropdown(),this._renderFilterInput(),this._renderList(),this._renderFilterNotice())),this._renderTotalChip(),this._renderMenuActions())))}_renderTotalChip(){const{visibleElements:e}=this;if(!e.totalCount||!e.header)return;const{effectiveCount:s}=this,o=i(s),l=t(this.messages.selectionCount,{count:o});return h("calcite-chip",{appearance:"outline",class:w.totalCount,closable:s>0,closed:0===s,icon:this.maxVisibleFeatureCountExceeded?"exclamation-mark-triangle":void 0,label:o,scale:this.scale,slot:"header-actions-end",title:l,onCalciteChipClose:this.clear},o)}_renderMenuActions(){const{visibleElements:e}=this;if(!e.header||!e.menu)return;const{menuScale:t}=this,i=0===this.effectiveCount;return[h("calcite-action",{disabled:i,icon:"reset",key:"clear-action",onclick:this.clear,scale:t,slot:"header-menu-actions",text:this.messagesCommon.clear,textEnabled:!0}),h("calcite-action",{disabled:i,icon:"folders",key:"collapse-action",onclick:this.collapseItems,scale:t,slot:"header-menu-actions",text:this.messages.collapseAll,textEnabled:!0})]}_renderActiveLayerDropdown(){const{layerItems:e,messages:i}=this;if(!(0===this.effectiveCount||e.length<2)&&this.visibleElements.layerFilter)return h("calcite-combobox",{class:w.layerDropdown,clearDisabled:!0,label:i.filterByLayer,overlayPositioning:"fixed",placeholder:i.filterByLayer,scale:this.scale,selectionMode:"single-persist",onCalciteComboboxChange:({currentTarget:e})=>{this.filterText=void 0;const t=e.selectedItems[0]?.value??void 0;this.layer="all-layers"===t?void 0:t}},h("calcite-combobox-item",{heading:t(i.allLayersCount,{count:e.length}),icon:"layers",key:"all-layers",selected:null==this.layer,value:"all-layers"}),this.layerItems.map(e=>this._renderActiveLayerDropdownItem(e)))}_renderFilterInput(){if(this.visibleElements.filter&&0!==this.effectiveCount)return h("calcite-input",{clearable:!0,icon:"search",placeholder:this.messages.filter,scale:this.scale,value:this.filterText,onCalciteInputInput:({target:{value:e}})=>{this.filterText=e}})}_renderActiveLayerDropdownItem(e){const t=e.title||this.messages.untitledLayer;return h("calcite-combobox-item",{heading:t,icon:e.iconName,key:e.key,selected:e.layer===this.layer,value:e.layer})}_renderList(){const{messages:e}=this;if(0!==this.visibleFeatureCount)return h("calcite-list",{afterCreate:p,bind:this,"data-node-ref":"_list",displayMode:"nested",interactionMode:"interactive",label:e.widgetLabel,loading:this.isUpdating,scale:this.scale,selectionMode:"none"},this._renderListContent(this.allLayerItems))}_renderListContent(e){return this.activeLayerItem?this._renderLayerItem(this.activeLayerItem):e.map(e=>u(e)?this._renderGroupItem(e):v(e)?this._renderLayerItem(e):null).filter(s)}_renderFilterNotice(){const{visibleElements:e}=this;if(!("disabled"===this.state||this.visibleFeatureCount>0)&&e.filter&&e.filterNotice)return h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale,width:"full"},h("div",{slot:"message"},this.messages.noMatchingFeatures))}_renderItemCount(e){if(!this.visibleElements.itemCount)return;const{messages:s}=this,o=i(e.total),l=i(e.visibleTotal),n=t(s.selectionCount,{count:o});return!this._hasFilterText&&e.maxVisibleFeatureCountExceeded?h("span",{class:w.itemCount,slot:"content-end",title:n},h("calcite-icon",{icon:"exclamation-mark-triangle",scale:"s",title:s.tooManyFeatures}),`${i(this.maxVisibleFeatureCountPerLayer)}+`):h("span",{class:w.itemCount,slot:"content-end",title:n},l)}_renderItemActions(e){if(!this.visibleElements.itemMenus)return;const{messages:t,messagesCommon:i}=this,s=this._itemWithOpenMenu===e,o=g(e),l=v(e),n=u(e),r=o?t.deselectFeature:l?t.deselectLayer:t.deselectGroup;return[h("calcite-dropdown",{"data-testid":"selection-list-dropdown",open:s,overlayPositioning:"fixed",scale:this.menuScale,slot:"actions-end",width:"m",onCalciteDropdownClose:()=>this._closeItemMenu(e),onCalciteDropdownOpen:()=>{this._itemWithOpenMenu=e}},h("calcite-action",{appearance:"transparent","data-testid":"selection-list-dropdown-trigger",icon:"ellipsis",scale:this.scale,slot:"trigger",text:i.menu,textEnabled:!1}),s?h("calcite-dropdown-group",{selectionMode:"none"},this.visibleElements.zoomToButton?h("calcite-dropdown-item",{iconStart:"layer-zoom-to",onCalciteDropdownItemSelect:()=>this.goToItem(e)},t.zoomTo):void 0,h("calcite-dropdown-item",{iconStart:"selection-filter",onCalciteDropdownItemSelect:()=>this.selectSingleItem(e)},o?t.onlySelectFeature:t.onlySelectThis),h("calcite-dropdown-item",{iconStart:"selection-x",onCalciteDropdownItemSelect:()=>this.deselectItem(e)},r),this.itemActionConfigs?.map(t=>{const{disabled:i,hidden:s,type:r}=t;if(!("function"==typeof s?s({item:e}):!!s)&&(!r||"feature"===r&&o||"layer"===r&&l||"group"===r&&n))return h("calcite-dropdown-item",{disabled:"function"==typeof i?i({item:e}):!!i,iconStart:t.icon??void 0,onCalciteDropdownItemSelect:()=>t.callback({item:e})},t.label)})):void 0)]}_renderGroupItem(e){const t=e.title||this.messages.untitledLayer;if(0===e.visibleTotal)return;const{displayMode:i}=this;if("layer"===i||"feature"===i)return this._renderListContent(e.items);const{visibleElements:s}=this;return h("calcite-list-item",{bind:this,closable:!!s.itemCloseActions,"data-type":"group",expanded:!0,iconStart:s.itemIcons?e.iconName:void 0,key:e.key,label:t,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemActions(e),this._renderListContent(e.items))}_renderLayerItem(e){if(0===e.visibleTotal||!e.visible)return;if("feature"===this.displayMode)return this._renderItems(e.featureItems);const{messages:t,visibleElements:i}=this,s=e.title||t.untitledLayer;return h("calcite-list-item",{bind:this,closable:!!i.itemCloseActions,"data-type":"layer",expanded:!0,iconStart:i.itemIcons?e.iconName:void 0,key:e.key,label:s,scale:this.scale,value:e.title,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemCount(e),this._renderItemActions(e),this._renderItems(e.featureItems),e.maxVisibleFeatureCountExceeded?h("calcite-notice",{class:w.notice,icon:"exclamation-mark-triangle",kind:"info",open:!0,scale:this.scale},h("div",{slot:"message"},t.tooManyFeatures)):void 0)}_renderItems(e){return e.map(e=>this._renderItem(e))}_renderItem(e){if(!e.visible)return;const{highlightOnHoverEnabled:t,messages:i,visibleElements:s}=this,o=e.title||i.untitledFeature,l=s.itemIcons&&"feature"!==this.displayMode;return h("calcite-list-item",{bind:this,class:l?w.listItemFeatureIcon:w.listItemFeature,closable:!!s.itemCloseActions,"data-item":e,"data-type":"feature",key:e.key,label:o,name:o,onblur:t?()=>this.removeTemporaryHighlight():void 0,onfocus:t?()=>this.addTemporaryHighlight(e):void 0,onpointerenter:t?()=>this.addTemporaryHighlight(e):void 0,onpointerleave:t?()=>this.removeTemporaryHighlight():void 0,scale:this.scale,value:o,onCalciteListItemClose:t=>{t.stopPropagation(),this.deselectItem(e)},onCalciteListItemSelect:t=>this._onListItemSelect(e,t)},this._renderItemIcon(e),this._renderItemActions(e))}_renderItemIcon(e){if(this.visibleElements.itemIcons)return h("div",{class:w.listItemIcon,key:"content-start",slot:"content-start"},h("span",{afterCreate:this._afterItemCreate,afterRemoved:this._afterItemRemoved,"data-has-icon":!1,"data-item":e,key:e.thumbnailKey}))}_getListItem(e){return e?.["data-item"]}_hasIcon(e){return!!e?.["data-has-icon"]}_setHasIcon(e,t){e&&(e["data-has-icon"]=t)}_onListItemSelect(e,t){t.stopPropagation(),this._closeItemMenu(),this.onListItemSelect?.({item:e})}_closeItemMenu(e){e&&e!==this._itemWithOpenMenu||(this._itemWithOpenMenu=null)}};e([n()],_.prototype,"_hasFilterText",null),e([n()],_.prototype,"_itemWithOpenMenu",void 0),e([n()],_.prototype,"_list",void 0),e([n()],_.prototype,"activeLayerItem",null),e([n()],_.prototype,"allLayerItems",null),e([n()],_.prototype,"displayMode",void 0),e([n()],_.prototype,"effectiveCount",null),e([n()],_.prototype,"effectiveSelectionManager",null),e([n()],_.prototype,"filterText",null),e([n()],_.prototype,"highlightOnHoverEnabled",void 0),e([n()],_.prototype,"icon",null),e([n()],_.prototype,"itemActionConfigs",void 0),e([n()],_.prototype,"isUpdating",null),e([n()],_.prototype,"label",null),e([n()],_.prototype,"layer",null),e([n()],_.prototype,"layerItems",null),e([n()],_.prototype,"layerViewMap",null),e([n()],_.prototype,"maxVisibleFeatureCountExceeded",null),e([n()],_.prototype,"maxVisibleFeatureCountPerLayer",null),e([n()],_.prototype,"menuScale",void 0),e([n(),d("esri/widgets/support/SelectionList/t9n/SelectionList")],_.prototype,"messages",void 0),e([n(),d("esri/t9n/common")],_.prototype,"messagesCommon",void 0),e([n(),d("esri/widgets/Legend/t9n/Legend")],_.prototype,"messagesLegend",void 0),e([n()],_.prototype,"onListItemSelect",void 0),e([n()],_.prototype,"scale",void 0),e([n()],_.prototype,"selectionManager",null),e([n()],_.prototype,"state",null),e([n()],_.prototype,"view",null),e([n()],_.prototype,"viewLayersAndTables",null),e([n()],_.prototype,"viewModel",void 0),e([n({type:I,nonNullable:!0})],_.prototype,"visibleElements",void 0),e([n()],_.prototype,"visibleFeatureCount",null),e([n()],_.prototype,"visibleFeatureItems",null),e([n()],_.prototype,"visibleLayerCount",null),_=e([r("esri.widgets.support.SelectionList")],_);const C=_;export{C as default};
|