@arcgis/core 4.28.0-next.20230719 → 4.28.0-next.20230721
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/Color.js +1 -1
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Top.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/arcade/functions/convertdirection.js +1 -1
- package/arcade/functions/featuresetbase.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/functions/geomsync.js +1 -1
- package/arcade/lib/comment-handler.js +1 -1
- package/arcade/lib/parser.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{75c28da8d0b02d612d69.js → 040b3fc9c9c0736dd893.js} +1 -1
- package/assets/esri/core/workers/chunks/0652f6a8d5221e978033.js +1 -0
- package/assets/esri/core/workers/chunks/{e579ca7d4c1387e17305.js → 092fda62b6f62c2e4869.js} +2 -2
- package/assets/esri/core/workers/chunks/{57e0ad037188bd2997e7.js → 0af18a96cbd4e2d35436.js} +1 -1
- package/assets/esri/core/workers/chunks/0b5eeec0f66c87a46a0c.js +1 -0
- package/assets/esri/core/workers/chunks/{68e568b67b6fb34393db.js → 0cad2b991d0d0fd07846.js} +1 -1
- package/assets/esri/core/workers/chunks/0dccbc6c2559fdc0c2ad.js +1 -0
- package/assets/esri/core/workers/chunks/256a82f6f6e1405fbcc6.js +1 -0
- package/assets/esri/core/workers/chunks/{bb9213899049e1db90da.js → 2c57c9bd71637c5bed8a.js} +1 -1
- package/assets/esri/core/workers/chunks/2cdbabcbfe32286ec78d.js +1 -0
- package/assets/esri/core/workers/chunks/{2b1c83453a862e01954b.js → 2d9d80b2d0042a9c09fb.js} +1 -1
- package/assets/esri/core/workers/chunks/2f9aec2238ff6cb99e09.js +1 -0
- package/assets/esri/core/workers/chunks/{55705b1bbac91d7db0e7.js → 32d940b2c891bf6ff9a2.js} +1 -1
- package/assets/esri/core/workers/chunks/3a0349c79551a03c2d8e.js +1 -0
- package/assets/esri/core/workers/chunks/{7dbd3e6406fb3e3a1a8f.js → 3cf748c025f3936c1cb2.js} +1 -1
- package/assets/esri/core/workers/chunks/4481d1103363434f16da.js +1 -0
- package/assets/esri/core/workers/chunks/58e11ca7c6e27e0ece7e.js +1 -0
- package/assets/esri/core/workers/chunks/5ae325e6a795c72eac6c.js +1 -0
- package/assets/esri/core/workers/chunks/5e4dde2886a1027b4b96.js +1 -0
- package/assets/esri/core/workers/chunks/{357e0381b6d767585576.js → 675e16d99758e67e5f51.js} +1 -1
- package/assets/esri/core/workers/chunks/726bb661b9e6998572e7.js +1 -0
- package/assets/esri/core/workers/chunks/730eb7e5f617fdab4f10.js +1 -0
- package/assets/esri/core/workers/chunks/{5a2e6bed9431cf4f42b1.js → 740dc67038f554431f1b.js} +1 -1
- package/assets/esri/core/workers/chunks/7cab61c9e09580520990.js +1 -0
- package/assets/esri/core/workers/chunks/{09178454bda15bb7929a.js → 7fbdfd1527582c52f9b6.js} +1 -1
- package/assets/esri/core/workers/chunks/{26546aa98a338051df66.js → 807742f38885fa90b4fe.js} +1 -1
- package/assets/esri/core/workers/chunks/82dfbc175b52c7a10475.js +1 -0
- package/assets/esri/core/workers/chunks/870a05451e074b58f19a.js +1 -0
- package/assets/esri/core/workers/chunks/88038ad401e5ec02f4d3.js +1 -0
- package/assets/esri/core/workers/chunks/88d63d1e56732d148f67.js +1 -0
- package/assets/esri/core/workers/chunks/8b72cd9340e8a44358ac.js +1 -0
- package/assets/esri/core/workers/chunks/8c5a8c1dfb086069bb06.js +1 -0
- package/assets/esri/core/workers/chunks/99a5a434e0bad48c7a5c.js +1 -0
- package/assets/esri/core/workers/chunks/9a5916c66dad91d01d5b.js +1 -0
- package/assets/esri/core/workers/chunks/9c133fd8c1fbd0295b86.js +1 -0
- package/assets/esri/core/workers/chunks/9cddb504079d396779ea.js +1 -0
- package/assets/esri/core/workers/chunks/a3a1d4f32e518e97d071.js +1 -0
- package/assets/esri/core/workers/chunks/{9548aa449fe3a300c015.js → a4fa40dc77e116c954ac.js} +1 -1
- package/assets/esri/core/workers/chunks/a54ec9929a7db879d5db.js +1 -0
- package/assets/esri/core/workers/chunks/afc5b84693757fda2bc8.js +1 -0
- package/assets/esri/core/workers/chunks/{591b5c277cfd3a4101a4.js → b08f2a4aa94087c6c367.js} +1 -1
- package/assets/esri/core/workers/chunks/c0e12f6a7bb2360e4c21.js +1 -0
- package/assets/esri/core/workers/chunks/c8e656cd470a17f538e9.js +1 -0
- package/assets/esri/core/workers/chunks/d0e203405f95e14b1399.js +1 -0
- package/assets/esri/core/workers/chunks/d61506497275bafba384.js +1 -0
- package/assets/esri/core/workers/chunks/{ec72f492f24e67e008ae.js → d8e58dc14d3495f0830c.js} +1 -1
- package/assets/esri/core/workers/chunks/db9a303ee0468d018def.js +1 -0
- package/assets/esri/core/workers/chunks/ddc393a012588f799f42.js +1 -0
- package/assets/esri/core/workers/chunks/de3baa85b1639c25458d.js +1 -0
- package/assets/esri/core/workers/chunks/e66cea26064ba8353af0.js +1 -0
- package/assets/esri/core/workers/chunks/ea478f2f4a19463e13fd.js +1 -0
- package/assets/esri/core/workers/chunks/eba197e45507f56f3ed0.js +1 -0
- package/assets/esri/core/workers/chunks/ebd006fcd568a7731115.js +1 -0
- package/assets/esri/core/workers/chunks/ef9a9a7d66d818720e20.js +1 -0
- package/assets/esri/core/workers/chunks/f3b458f55236566c940b.js +1 -0
- package/assets/esri/core/workers/chunks/fd0a91b9e0216cc269c3.js +1 -0
- package/assets/esri/core/workers/chunks/{a4fe220a912b1f428e49.js → fdd6403a8390d629392b.js} +1 -1
- package/assets/esri/themes/base/widgets/_Directions.scss +13 -7
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.scss +108 -4
- 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/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/chunks/ComponentShader.glsl.js +1 -1
- package/chunks/LineSeries.js +1 -1
- package/chunks/Theme.js +1 -1
- package/chunks/array.js +1 -1
- package/chunks/chartUtilsAm5.js +1 -1
- package/core/Collection.js +1 -1
- package/core/accessorSupport/decorators/subclass.js +1 -1
- package/core/accessorSupport/ensureType.js +1 -1
- package/core/accessorSupport/get.js +1 -1
- package/core/accessorSupport/tracking.js +1 -1
- package/core/accessorSupport/utils.js +1 -1
- package/core/libs/rbush/PooledRBush.js +1 -1
- package/core/urlUtils.js +1 -1
- package/geometry/GeometryCursor.js +1 -1
- package/geometry/support/TileClipper.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/interfaces.d.ts +9 -3
- package/layers/BuildingSceneLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/LinkChartLayer.js +1 -1
- package/layers/PointCloudLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/VectorTileLayer.js +1 -1
- package/layers/VoxelLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/effects/EffectView.js +1 -1
- package/layers/graphics/sources/geojson/geojson.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/mixins/ArcGISCachedService.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/bestImageUtils.js +1 -1
- package/layers/orientedImagery/queries.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/ElevationQuery.js +1 -1
- package/layers/support/MultidimensionalSubset.js +1 -1
- package/layers/support/Sublayer.js +1 -1
- package/layers/support/TileInfo.js +1 -1
- package/layers/support/TileInfoTilemapCache.js +1 -1
- package/layers/support/TilemapCache.js +1 -1
- package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
- package/layers/support/rasterDatasets/pamParser.js +1 -1
- package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
- package/layers/support/rasterFormats/Raw.js +1 -1
- package/layers/support/rasterFormats/TiffDecoder.js +1 -1
- package/layers/support/rasterFunctions/ExtractBandFunction.js +1 -1
- package/layers/support/rasterFunctions/colormaps.js +1 -1
- package/layers/support/rasterFunctions/pixelUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelDimension.js +1 -1
- package/layers/voxel/VoxelTransferFunctionStyle.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/colorRampUtils.js +1 -1
- package/renderers/visualVariables/support/visualVariableUtils.js +1 -1
- package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
- package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
- package/rest/support/generateRendererUtils.js +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/renderers/color.js +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/smartMapping/renderers/type.js +1 -1
- package/smartMapping/renderers/univariateColorSize.js +1 -1
- package/smartMapping/support/adapters/support/utils.js +1 -1
- package/statistics/utils.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/GeometryWalker.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/effects/EffectArrow.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/symbols/support/symbolUtils.js +1 -1
- package/views/2d/constraints/ZoomConstraint.js +1 -1
- package/views/2d/engine/flow/dataUtils.js +1 -1
- package/views/2d/engine/flow/utils.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
- package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
- package/views/2d/engine/vectorTiles/tileInfoUtils.js +1 -1
- package/views/2d/engine/webgl/TurboLine.js +1 -1
- package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
- package/views/2d/layers/BaseLayerView2D.js +1 -1
- package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
- package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/WMTSLayerView2D.js +1 -1
- package/views/2d/layers/features/support/rendererUtils.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/vectorTileDebugUtils.js +5 -0
- package/views/2d/tiling/TileInfoView.js +1 -1
- package/views/2d/tiling/TileInfoViewPOT.js +1 -1
- package/views/2d/tiling/TileQueue.js +1 -1
- package/views/2d/tiling.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
- package/views/3d/interactive/editingTools/moveGraphic/GraphicMoveTool.js +1 -1
- package/views/3d/interactive/visualElements/LaserlineVisualElement.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/TiledLayerView3D.js +1 -1
- package/views/3d/layers/VectorTileLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Labeler.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/layers/support/featureReference.js +1 -1
- package/views/3d/support/LaserLineRenderer.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderTarget.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/terrain/TileRenderer.js +1 -1
- package/views/3d/terrain/TilingScheme.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderModules/interfaces.js +1 -1
- package/views/3d/webgl-engine/effects/RenderPlugin.js +5 -0
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +5 -0
- package/views/3d/webgl-engine/effects/ScreenSpaceGeometry.js +5 -0
- package/views/3d/webgl-engine/effects/SmaaRenderPass.js +5 -0
- package/views/3d/webgl-engine/lib/CompositingHelper.js +1 -1
- package/views/3d/webgl-engine/lib/GLMaterials.js +1 -1
- package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
- package/views/3d/webgl-engine/lib/OffscreenRendering.js +1 -1
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/SSAOHelper.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodComponentData.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
- package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
- package/views/LayerViewManager.js +1 -1
- package/views/MapView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/animation/pointToPoint/Path.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/createUtils.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/interactive/editGeometry/EditGeometry.js +1 -1
- package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
- package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
- package/views/layers/GroupLayerView.js +1 -1
- package/views/layers/ImageryTileLayerView.js +1 -1
- package/views/webgl/ProgramCache.js +1 -1
- package/webscene/spec-certification/api.js +1 -1
- package/webscene/spec-certification/spec.js +1 -1
- package/webscene/spec-certification/utils.js +1 -1
- package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
- package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
- package/widgets/BuildingExplorer/support/validation.js +1 -1
- package/widgets/Directions/support/resources.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/Workflow.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureForm/FormExpressionsManager.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Features.js +1 -1
- package/widgets/Histogram/HistogramViewModel.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/Legend/styles/Card.js +1 -1
- package/widgets/Legend/styles/support/univariateUtils.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend/support/colorRampUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/Legend/support/utils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/arcUtils.js +5 -0
- package/widgets/OrientedImageryViewer/constants.js +5 -0
- package/widgets/OrientedImageryViewer/utils.js +5 -0
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Popup/PopupViewModel.js +1 -1
- package/widgets/Popup.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
- package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
- package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
- package/widgets/smartMapping/ColorSizeSlider.js +1 -1
- package/widgets/smartMapping/HeatmapSlider/HeatmapSliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider.js +1 -1
- package/widgets/smartMapping/SmartMappingPrimaryHandleSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/assets/esri/core/workers/chunks/07bb40162d97d098bc19.js +0 -1
- package/assets/esri/core/workers/chunks/0a18317566c1fcb68422.js +0 -1
- package/assets/esri/core/workers/chunks/0de65e03db8c611af9fb.js +0 -1
- package/assets/esri/core/workers/chunks/1a60d23a92bcf91dbb22.js +0 -1
- package/assets/esri/core/workers/chunks/205a0b34b698d5329854.js +0 -1
- package/assets/esri/core/workers/chunks/2158a6ec165503ec4711.js +0 -1
- package/assets/esri/core/workers/chunks/25211d5904ee9d5f4a9d.js +0 -1
- package/assets/esri/core/workers/chunks/26b12d1ea713c1e07701.js +0 -1
- package/assets/esri/core/workers/chunks/2bfa7ee324c32a56b0d3.js +0 -1
- package/assets/esri/core/workers/chunks/370a992bd308bd806f48.js +0 -1
- package/assets/esri/core/workers/chunks/3892650ecc61322f6f7f.js +0 -1
- package/assets/esri/core/workers/chunks/38d168e9a29c40de179d.js +0 -1
- package/assets/esri/core/workers/chunks/4bf1c6c7e0a3051dc797.js +0 -1
- package/assets/esri/core/workers/chunks/524156c3f5383c2dd0e3.js +0 -1
- package/assets/esri/core/workers/chunks/59666ecb7c2c1f5a13b2.js +0 -1
- package/assets/esri/core/workers/chunks/5ae98195bdfd7dc0c44e.js +0 -1
- package/assets/esri/core/workers/chunks/5c005c9514354c77ec27.js +0 -1
- package/assets/esri/core/workers/chunks/5d46fd68878c973bcfab.js +0 -1
- package/assets/esri/core/workers/chunks/5dd23092c8a8a5ccd5d0.js +0 -1
- package/assets/esri/core/workers/chunks/620ec5c75561183d3d73.js +0 -1
- package/assets/esri/core/workers/chunks/68512670816f59c0e6a5.js +0 -1
- package/assets/esri/core/workers/chunks/6c7374ebc18b46b3480a.js +0 -1
- package/assets/esri/core/workers/chunks/75ba2af92da232067adb.js +0 -1
- package/assets/esri/core/workers/chunks/7c1f0598a016516dcec3.js +0 -1
- package/assets/esri/core/workers/chunks/8dcec8d1b670d2b7ea2b.js +0 -1
- package/assets/esri/core/workers/chunks/8e07dfb6fc2673b640cb.js +0 -1
- package/assets/esri/core/workers/chunks/9008dde941cb3973de20.js +0 -1
- package/assets/esri/core/workers/chunks/9050b167355588b7003d.js +0 -1
- package/assets/esri/core/workers/chunks/9230d68799f0b0b9ef36.js +0 -1
- package/assets/esri/core/workers/chunks/94d124453e90a5ab1706.js +0 -1
- package/assets/esri/core/workers/chunks/9ca312af9c056b1efe40.js +0 -1
- package/assets/esri/core/workers/chunks/b0a57718a0765d1c8df0.js +0 -1
- package/assets/esri/core/workers/chunks/b431b81a7bf45dd527da.js +0 -1
- package/assets/esri/core/workers/chunks/bda311ad48efdb265939.js +0 -1
- package/assets/esri/core/workers/chunks/da547c3cabe4a89c3ce6.js +0 -1
- package/assets/esri/core/workers/chunks/dd295fa57b45b7ec4ec5.js +0 -1
- package/assets/esri/core/workers/chunks/eb92aa372e706ce5a5eb.js +0 -1
- package/assets/esri/core/workers/chunks/f553b464e969d45bf451.js +0 -1
- package/assets/esri/core/workers/chunks/f5865294983eb160de8c.js +0 -1
- package/assets/esri/core/workers/chunks/fdb7b1fbdb6fe091ad83.js +0 -1
- package/assets/esri/core/workers/chunks/fe8544bf3bbbacd74b8b.js +0 -1
- package/views/2d/tiling/PagedTileQueue.js +0 -5
- package/views/3d/webgl-engine/lib/RenderPluginManager.js +0 -5
- package/views/3d/webgl-engine/lib/SmaaRenderPass.js +0 -5
- /package/views/3d/webgl-engine/{lib → effects}/SmaaRenderPassData.js +0 -0
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../geometry.js";import{equals as t,isSome as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{h as r}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import l from"../../../geometry/Circle.js";import{simplify as s,distance as i}from"../../../geometry/geometryEngine.js";import{unnormalizeGeometryOnDatelineCrossing as c,isClockwise as y,unnormalizeVerticesOnDatelineCrossing as p}from"../../../geometry/support/coordsUtils.js";import{isValid as u}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as m}from"./surfaceCoordinateSystems.js";import f from"../../../geometry/Point.js";import x from"../../../geometry/Multipoint.js";import h from"../../../geometry/Polyline.js";import M from"../../../geometry/Polygon.js";function g(t,e){const o=new f({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function d(t,e){return new x({points:t,spatialReference:e})}function R(t,e,o){const n=new h({paths:t,spatialReference:e});return o&&c(n),n}function j(e,n,r,a=!0){const l=o(e);l.forEach((e=>{const o=e[0],n=e.
|
|
5
|
+
import"../../../geometry.js";import{equals as t,isSome as e}from"../../../core/arrayUtils.js";import{clone as o}from"../../../core/lang.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import{h as r}from"../../../chunks/vec3.js";import{c as a}from"../../../chunks/vec3f64.js";import l from"../../../geometry/Circle.js";import{simplify as s,distance as i}from"../../../geometry/geometryEngine.js";import{unnormalizeGeometryOnDatelineCrossing as c,isClockwise as y,unnormalizeVerticesOnDatelineCrossing as p}from"../../../geometry/support/coordsUtils.js";import{isValid as u}from"../../../geometry/support/spatialReferenceUtils.js";import{makeSurfacePoint as m}from"./surfaceCoordinateSystems.js";import f from"../../../geometry/Point.js";import x from"../../../geometry/Multipoint.js";import h from"../../../geometry/Polyline.js";import M from"../../../geometry/Polygon.js";function g(t,e){const o=new f({x:t[0],y:t[1],spatialReference:e});return t.length>2&&(o.z=t[2]),o}function d(t,e){return new x({points:t,spatialReference:e})}function R(t,e,o){const n=new h({paths:t,spatialReference:e});return o&&c(n),n}function j(e,n,r,a=!0){const l=o(e);l.forEach((e=>{const o=e[0],n=e[e.length-1];t(o,n)&&1!==e.length||e.push(e[0])}));let i=new M({rings:l,spatialReference:n});return i.rings.forEach((t=>{y(t)||t.reverse()})),r&&c(i),a&&i.isSelfIntersecting&&u(n)&&(i=s(i)),i}function T(t,o,n){const r=o.mapToLocalMultiple(t),a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y},i=Math.round(s.x-l.x),c=Math.round(s.y-l.y),y=Math.max(Math.abs(i),Math.abs(c));if(n){const t={x:l.x+y,y:l.y+y},e={x:l.x-y,y:l.y-y};a.push(m(t.x,e.y),m(e.x,e.y),m(e.x,t.y),m(t.x,t.y))}else{const t={x:i>0?l.x+y:l.x-y,y:c>0?l.y+y:l.y-y};a.push(m(l.x,l.y),m(t.x,l.y),m(t.x,t.y),m(l.x,t.y))}return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function b(t,o,n){let r=o.mapToLocalMultiple(t);if(1===r.length){const t=48,e=r[0];r=[m(e.x-t,e.y+t),m(e.x+t,e.y-t),m(e.x+t,e.y-t),m(e.x-t,e.y+t)]}const a=[],l={x:r[0].x,y:r[0].y},s={x:r[1].x,y:r[1].y};if(n){const t=Math.round(s.x-l.x),e=Math.round(s.y-l.y);a.push(m(l.x-t,l.y-e),m(s.x,l.y-e),m(s.x,s.y),m(l.x-t,s.y))}else a.push(m(l.x,l.y),m(s.x,l.y),m(s.x,s.y),m(l.x,s.y));return U(j([a.map((t=>o.localToMap(t))).filter(e)],o.spatialReference,o.doUnnormalization,!0),a,o)}function U(t,e,o){const n=P(e[3],e[2],o),r=P(e[1],e[2],o),a=P(e[0],e[1],o),l=P(e[0],e[3],o);return{geometry:t,midpoints:null!=n&&null!=r&&null!=a&&null!=l?{top:n,right:r,bottom:a,left:l}:null}}function P(t,e,o){w[0]=t.x,w[1]=t.y,w[2]=0,I[0]=e.x,I[1]=e.y,I[2]=0,r(w,w,I,.5),z.x=w[0],z.y=I[1],z.z=I[2];const n=o.localToMap(z);return null!=n?g(n,o.spatialReference):null}const z=m(0,0,0),w=a(),I=a();function L(t,e,o,r){const a=e.mapToLocalMultiple(t);let s=null,c=null;if(o)s=a[0],c=a[1];else{const t=a[0],e=a[1],o=Math.round(e.x-t.x),n=Math.round(e.y-t.y),r=Math.max(Math.abs(o),Math.abs(n));s=m(o>0?t.x+r/2:t.x-r/2,n>0?t.y+r/2:t.y-r/2),c=m(Math.abs(o)>Math.abs(n)?s.x-r/2:s.x,Math.abs(o)>Math.abs(n)?s.y:s.y-r/2)}const y=e.localToMap(s),f=e.localToMap(c);if(null==y||null==f)return null;e.doUnnormalization&&p([[y,f]],e.spatialReference);const x=g(y,e.spatialReference),h=g(f,e.spatialReference),M=n(e.spatialReference);let d=0;if(u(e.spatialReference))d=M*i(x,h,null);else{const t=s.x-c.x,e=s.y-c.y;d=M*Math.sqrt(t*t+e*e)*(r||1)}const R=new l({center:x,radius:d,radiusUnit:"meters",spatialReference:e.spatialReference});return{geometry:j(R.rings,R.spatialReference,!1),center:x,edge:h}}function v(t,o,n){const r=o.mapToLocalMultiple(t),a=r[0],l=r[1],s=Math.round(l.x-a.x),i=Math.round(l.y-a.y),c=m(n?a.x:a.x+s/2,n?a.y:a.y+i/2),y=n?s:s/2,p=n?i:i/2,u=60,f=[],x=2*Math.PI/u;function h(t){const e=Math.cos(t),o=Math.sin(t);return m(y*e+c.x,p*o+c.y)}for(let e=0;e<u;e++)f.push(h(e*x));f.push(f[0]);const{spatialReference:M,doUnnormalization:d}=o,R=j([f.map((t=>o.localToMap(t))).filter(e)],M,d,!1),T=o.localToMap(h(Math.PI/2)),b=o.localToMap(h(0)),U=o.localToMap(h(-Math.PI/2)),P=o.localToMap(h(Math.PI));return{geometry:R,midpoints:null!=T&&null!=b&&null!=U&&null!=P?{top:g(T,M),right:g(b,M),bottom:g(U,M),left:g(P,M)}:null}}export{L as createCircle,v as createEllipse,d as createMultipoint,g as createPoint,j as createPolygon,R as createPolyline,b as createRectangle,T as createSquare};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as o,getContrast as r}from"../../core/colorUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as l,on as c}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{k as m,s as u,e as f,a as b,l as g,i as x}from"../../chunks/vec2.js";import{a as _}from"../../chunks/vec2f64.js";import{G as y}from"../../chunks/vec3.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as j}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as I}from"../../support/getDefaultUnitForView.js";import L from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as D}from"../support/automaticLengthMeasurementUtils.js";const w=3025,O={default:15,far:25};let S=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await j("esri/core/t9n/Units");n(e),this._messagesUnits=t}));this.addHandles([l((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>c((()=>this.context?.editGeometryOperations),e,(()=>this._update())))),i((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(null==e)return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=t.length;for(let i=0;i<r;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const a=n[0],l=n.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{createTask as s}from"../../core/asyncUtils.js";import{multiplyOpacity as o,getContrast as r}from"../../core/colorUtils.js";import{makeHandle as i}from"../../core/handleUtils.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import{formatLength as a}from"../../core/quantityFormatUtils.js";import{watch as l,on as c}from"../../core/reactiveUtils.js";import{createScreenPointArray as p}from"../../core/screenUtils.js";import{property as h}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{k as m,s as u,e as f,a as b,l as g,i as x}from"../../chunks/vec2.js";import{a as _}from"../../chunks/vec2f64.js";import{G as y}from"../../chunks/vec3.js";import{isClockwise as v}from"../../geometry/support/coordsUtils.js";import{fetchMessageBundle as j}from"../../intl/messages.js";import{getGeometryEffectiveElevationMode as U}from"../../support/elevationInfoUtils.js";import{getDefaultUnitForView as I}from"../../support/getDefaultUnitForView.js";import L from"../overlay/TextOverlayItem.js";import{autoDirectDistanceByElevationMode as D}from"../support/automaticLengthMeasurementUtils.js";const w=3025,O={default:15,far:25};let S=class extends t{constructor(e){super(e),this.context=null,this.stagedVertex=null,this.visible=!0,this.edgeDistance="default",this._messagesUnits=null,this._labelInfos=[],this._nextLabelIndex=0}initialize(){const e=s((async e=>{const t=await j("esri/core/t9n/Units");n(e),this._messagesUnits=t}));this.addHandles([l((()=>[null!=this.context&&this.getCameraOrExtent(this.context),this.visible,this._edgeDistancePixels,this.stagedVertex,this._messagesUnits]),(()=>this._update())),...["vertex-add","vertex-update","vertex-remove"].map((e=>c((()=>this.context?.editGeometryOperations),e,(()=>this._update())))),i((()=>e.abort()))])}destroy(){for(this._nextLabelIndex=0;this._labelInfos.length;)this._destroyLabel(this._labelInfos.pop())}get updating(){return null==this._messagesUnits}get test(){return{labelContents:this._labelInfos.slice(0,this._nextLabelIndex).map((e=>e.label.text))}}get _edgeDistancePixels(){return O[this.edgeDistance]}_update(){this._nextLabelIndex=0;const e=this.context;if(null==e)return void this._destroyUnusedLabels();const{components:t,geometry:s,coordinateHelper:o}=e.editGeometryOperations.data;if(!s)return void this._destroyUnusedLabels();const r=t.length;for(let i=0;i<r;++i){const n=[];if(t[i].iterateVertices((e=>{n.push(o.toXYZ(e.pos))})),0===i&&null!=this.stagedVertex&&n.push(o.toXYZ(this.stagedVertex)),n.length<2)continue;const a=n[0],l=n[n.length-1];"polygon"===s.type&&n.length>2&&!y(a,l)&&n.push(a);const c=1===r&&!v(n);let p=k,h=P;this.toScreenPointArray(e,a,p);for(let t=1;t<n.length;++t){const s=n[t-1],o=n[t];this.toScreenPointArray(e,o,h),this._addLabel(e,s,p,o,h,c),[p,h]=[h,p]}}this._destroyUnusedLabels()}_addLabel(e,t,s,o,r,i){const{label:n}=this._getOrCreateLabel(e);if(!this.visible||m(s,r)<w)return void(n.visible=!1);const l=null!=e.graphicState?e.graphicState.isDraped?"on-the-ground":"absolute-height":U(e.editGeometryOperations.data.geometry,e.elevationInfo),{spatialReference:c}=e.editGeometryOperations.data,p=D(t,o,c,l),h=this._messagesUnits,d=I(e.view);n.text=null!=h&&null!=p?a(h,p,d):"",n.visible=!0;const _=r[0]-s[0],y=r[1]-s[1];i?u(C,-y,_):u(C,y,-_),f(C,C),b(C,C,this._edgeDistancePixels),g(V,s,r,.5),x(V,V,C),n.position=[V[0],V[1]],Math.abs(C[0])>Math.abs(C[1])?n.anchor=C[0]>0?"left":"right":n.anchor=-C[1]<0?"top":"bottom"}_getOrCreateLabel(e){if(this._labelInfos.length>this._nextLabelIndex)return this._labelInfos[this._nextLabelIndex++];const{textColor:t}=e.view.effectiveTheme,s=o(r(t),.6),i=new L({anchor:"center",fontSize:10,textColor:t,backgroundColor:s});e.view.overlay?.items.add(i);const n={label:i};return this._labelInfos.push(n),this._nextLabelIndex=this._labelInfos.length,n}_destroyUnusedLabels(){for(;this._labelInfos.length>this._nextLabelIndex;)this._destroyLabel(this._labelInfos.pop())}_destroyLabel({label:e}){this.context?.view.overlay?.items.remove(e),e.destroy()}};e([h()],S.prototype,"context",void 0),e([h()],S.prototype,"stagedVertex",void 0),e([h()],S.prototype,"visible",void 0),e([h()],S.prototype,"edgeDistance",void 0),e([h()],S.prototype,"updating",null),e([h()],S.prototype,"_messagesUnits",void 0),e([h()],S.prototype,"_edgeDistancePixels",null),S=e([d("esri.views.interactive")],S);const C=_(),V=_(),k=p(),P=p();export{S as SegmentLabels};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{equals as e}from"../../../core/arrayUtils.js";import t from"../../../core/Evented.js";import s from"../../../geometry/Polygon.js";import i from"../../../geometry/Polyline.js";import{createCoordinateHelper as r}from"../coordinateHelper.js";import{unnormalize as
|
|
5
|
+
import{equals as e}from"../../../core/arrayUtils.js";import t from"../../../core/Evented.js";import s from"../../../geometry/Polygon.js";import i from"../../../geometry/Polyline.js";import{createCoordinateHelper as r}from"../coordinateHelper.js";import{unnormalize as n,getUnnormalizationInfo as o}from"./unnormalizationHelper.js";import{epsilon as h}from"../../support/geometry3dUtils.js";class c{constructor(e){this.component=e,this.leftEdge=null,this.rightEdge=null,this.type="vertex",this.index=null}get pos(){return this._pos}set pos(e){this._pos=e,this.component.unnormalizeVertexPositions()}}class l{constructor(e,t,s){this.component=e,this.leftVertex=t,this.rightVertex=s,this.type="edge",t.rightEdge=this,s.leftEdge=this}}class p{constructor(e,t){this._spatialReference=e,this._viewingMode=t,this.vertices=[],this.edges=[],this.index=null}unnormalizeVertexPositions(){this.vertices.length<=1||n(this.vertices,o(this._spatialReference,this._viewingMode))}updateVertexIndex(e,t){if(0===this.vertices.length)return;const s=this.vertices[0];let i=null,r=e,n=t;do{i=r,i.index=n++,r=i.rightEdge?i.rightEdge.rightVertex:null}while(null!=r&&r!==s);i.leftEdge&&i!==this.vertices[this.vertices.length-1]&&this.swapVertices(this.vertices.indexOf(i),this.vertices.length-1)}getFirstVertex(){return 0===this.vertices.length?null:this.vertices[0]}getLastVertex(){return 0===this.vertices.length?null:this.vertices[this.vertices.length-1]}isClosed(){return this.vertices.length>2&&null!==this.vertices[0].leftEdge}swapVertices(e,t){const s=this.vertices[e];this.vertices[e]=this.vertices[t],this.vertices[t]=s}iterateVertices(e){if(0===this.vertices.length)return;const t=this.vertices[0];let s=t;do{e(s,s.index),s=null!=s.rightEdge?s.rightEdge.rightVertex:null}while(s!==t&&null!=s)}}class g extends t{constructor(e,t){super(),this.type=e,this.coordinateHelper=t,this._geometry=null,this._dirty=!0,this.components=[]}get geometry(){if(this._dirty){switch(this.type){case"point":this._geometry=this._toPoint();break;case"polyline":this._geometry=this._toPolyline();break;case"polygon":this._geometry=this._toPolygon()}this._dirty=!1}return this._geometry}get spatialReference(){return this.coordinateHelper.spatialReference}notifyChanges(e){this._dirty=!0,this.emit("change",e)}firstNonVerticalEdge(){for(const e of this.components)for(const t of e.edges){const e=t.leftVertex.pos,s=t.rightVertex.pos,i=e[0]-s[0],r=e[1]-s[1];if(i*i+r*r>h)return t}return null}_toPoint(){return 0===this.components.length||0===this.components[0].vertices.length?null:this.coordinateHelper.vectorToPoint(this.components[0].vertices[0].pos)}_toPolyline(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[];let r=s.vertices.find((e=>null==e.leftEdge));const n=r;do{i.push(t(r.pos)),r=r.rightEdge?r.rightEdge.rightVertex:null}while(r&&r!==n);e.push(i)}return new i({paths:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}_toPolygon(){const e=[],t=this.coordinateHelper.vectorToArray;for(const s of this.components){if(s.vertices.length<1)continue;const i=[],r=s.vertices[0];let n=r;const o=n;do{i.push(t(n.pos)),n=null!=n.rightEdge?n.rightEdge.rightVertex:null}while(n&&n!==o);s.isClosed()&&i.push(t(r.pos)),e.push(i)}return new s({rings:e,spatialReference:this.spatialReference,hasZ:this.coordinateHelper.hasZ(),hasM:this.coordinateHelper.hasM()})}static fromGeometry(t,s){const i=t.spatialReference,n=r(t.hasZ,t.hasM,i),o=new g(t.type,n);switch(t.type){case"polygon":{const r=t.rings;for(let t=0;t<r.length;++t){const h=r[t],g=new p(i,s);g.index=t;const a=h.length>2&&e(h[0],h[h.length-1]),d=a?h.length-1:h.length;for(let e=0;e<d;++e){const t=n.arrayToVector(h[e]),s=new c(g);g.vertices.push(s),s.pos=t,s.index=e}const u=g.vertices.length-1;for(let e=0;e<u;++e){const t=g.vertices[e],s=g.vertices[e+1],i=new l(g,t,s);g.edges.push(i)}if(a){const e=new l(g,g.vertices[g.vertices.length-1],g.vertices[0]);g.edges.push(e)}o.components.push(g)}break}case"polyline":{const e=t.paths;for(let t=0;t<e.length;++t){const r=e[t],h=new p(i,s);h.index=t;const g=r.length;for(let e=0;e<g;++e){const t=n.arrayToVector(r[e]),s=new c(h);h.vertices.push(s),s.pos=t,s.index=e}const a=h.vertices.length-1;for(let e=0;e<a;++e){const t=h.vertices[e],s=h.vertices[e+1],i=new l(h,t,s);h.edges.push(i)}o.components.push(h)}break}case"point":{const e=new p(i,s);e.index=0;const r=new c(e);r.index=0,r.pos=n.pointToVector(t),e.vertices.push(r),o.components.push(e);break}}return o}}export{p as Component,l as Edge,g as EditGeometry,c as Vertex};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{EditGeometry as r}from"./EditGeometry.js";import{AccumulationBehaviour as o}from"./interfaces.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as i,AccumulationType as n}from"./operations/UpdateVertices.js";import{RemoveVertices as a}from"./operations/RemoveVertices.js";import{SplitEdge as p}from"./operations/SplitEdge.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{CloseComponent as c}from"./operations/CloseComponent.js";import{MoveVertex as
|
|
5
|
+
import e from"../../../core/Evented.js";import{makeHandle as t}from"../../../core/handleUtils.js";import{EditGeometry as r}from"./EditGeometry.js";import{AccumulationBehaviour as o}from"./interfaces.js";import{AppendVertex as s}from"./operations/AppendVertex.js";import{UpdateVertices as i,AccumulationType as n}from"./operations/UpdateVertices.js";import{RemoveVertices as a}from"./operations/RemoveVertices.js";import{SplitEdge as p}from"./operations/SplitEdge.js";import{SetVertexPosition as d}from"./operations/SetVertexPosition.js";import{CloseComponent as c}from"./operations/CloseComponent.js";import{MoveVertex as h}from"./operations/MoveVertex.js";import{OffsetEdgeVertex as u}from"./operations/OffsetEdgeVertex.js";import{RotateVertex as m}from"./operations/RotateVertex.js";import{ScaleVertex as l}from"./operations/ScaleVertex.js";import{UndoGroup as _}from"./operations/UndoGroup.js";class V extends e{constructor(e){super(),this.data=e,this._undoStack=[],this._redoStack=[],this._listener=this.data.on("change",(e=>{e.addedVertices&&this.emit("vertex-add",{type:"vertex-add",vertices:e.addedVertices,operation:e.operation}),e.removedVertices&&this.emit("vertex-remove",{type:"vertex-remove",vertices:e.removedVertices,operation:e.operation}),e.updatedVertices&&this.emit("vertex-update",{type:"vertex-update",vertices:e.updatedVertices,operation:e.operation})}))}destroy(){this._listener.remove()}splitEdge(e,t){return this._apply(new p(this.data,e,t))}updateVertices(e,t,r=o.ACCUMULATE_STEPS){return this._apply(new i(this.data,e,t),r)}moveVertices(e,t,r,s,i=o.ACCUMULATE_STEPS){return this.updateVertices(e,new h(this.data.coordinateHelper,t,r,s),i)}scaleVertices(e,t,r,s,i,a=o.ACCUMULATE_STEPS,p=n.CUMULATIVE){return this.updateVertices(e,new l(t,r,s,i,p),a)}rotateVertices(e,t,r,s=o.ACCUMULATE_STEPS,i=n.CUMULATIVE){return this.updateVertices(e,new m(t,r,i),s)}removeVertices(e){return this._apply(new a(this.data,e,this._minNumVerticesPerType))}appendVertex(e){return 0===this.data.components.length?null:this._apply(new s(this.data,this.data.components[0],e))}setVertexPosition(e,t){return this._apply(new d(this.data,e,t))}offsetEdge(e,t,r,s=o.ACCUMULATE_STEPS){return this.updateVertices([t.leftVertex,t.rightVertex],new u(this.data.coordinateHelper,e,t,r),s)}closeComponent(e){return this.data.components.includes(e)?this._apply(new c(this.data,e)):null}canRemoveVertex(){return this.data.components[0].vertices.length>this._minNumVerticesPerType}createUndoGroup(){const e=new _;return this._apply(e),t((()=>e.close()))}undo(){if(this._undoStack.length>0){const e=this._undoStack.pop();return e.undo(),this._redoStack.push(e),e}return null}redo(){if(this._redoStack.length>0){const e=this._redoStack.pop();return e.apply(),this._undoStack.push(e),e}return null}get canUndo(){return this._undoStack.length>0}get canRedo(){return this._redoStack.length>0}get lastOperation(){return this._undoStack.length>0?this._undoStack[this._undoStack.length-1]:null}get _minNumVerticesPerType(){switch(this.data.type){case"point":return 1;case"polyline":return 2;case"polygon":return 3;default:return 0}}_apply(e,t=o.ACCUMULATE_STEPS){return t!==o.NEW_STEP&&null!=this.lastOperation&&this.lastOperation.accumulate(e)||(e.apply(),this._undoStack.push(e),this._redoStack=[]),e}static fromGeometry(e,t){return new V(r.fromGeometry(e,t))}}export{V as EditGeometryOperations};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const o=this._operations.length?this._operations.
|
|
5
|
+
class t{constructor(){this._operations=[],this._closed=!1}close(){this._closed=!0}apply(){for(const t of this._operations)t.apply()}undo(){for(let t=this._operations.length-1;t>=0;t--)this._operations[t].undo()}accumulate(t){if(this._closed)return!1;const o=this._operations.length?this._operations[this._operations.length-1]:null;return o&&o.accumulate(t)||(this._operations.push(t),t.apply()),!0}}export{t as UndoGroup};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.addHandles([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added.
|
|
5
|
+
import{_ as i}from"../../chunks/tslib.es6.js";import e from"../../core/Collection.js";import{referenceSetter as s,castForReferenceSetter as r}from"../../core/collectionUtils.js";import{watch as t,sync as l}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import o from"./LayerView.js";let h=class extends o{constructor(i){super(i),this.type="group",this.layerViews=new e}destroy(){this.layerViews.length=0}_allLayerViewVisibility(i){this.layerViews.forEach((e=>{e.visible=i}))}initialize(){this.addHandles([this.layerViews.on("change",(i=>this._layerViewsChangeHandler(i))),t((()=>this.layer?.visibilityMode),(()=>{this.layer&&this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(null)))}),l),t((()=>this.visible),(i=>{this._applyVisibility((()=>this._allLayerViewVisibility(i)),(()=>{}))}),l)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",s(i,this._get("layerViews")))}get updatingProgress(){return 0===this.layerViews.length?1:this.layerViews.reduce(((i,e)=>i+e.updatingProgress),0)/this.layerViews.length}isUpdating(){return this.layerViews.some((i=>i.updating))}_hasLayerViewVisibleOverrides(){return this.layerViews.some((i=>i._isOverridden("visible")))}_findLayerViewForLayer(i){return i&&this.layerViews.find((e=>e.layer===i))}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find((i=>{const e=this._findLayerViewForLayer(i);return!!e?.visible}));return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){null==i&&null==(i=this._firstVisibleOnLayerOrder())&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.at(0))),this.layerViews.forEach((e=>{e.visible=e===i}))}_layerViewsChangeHandler(i){this.removeHandles("grouplayerview:visible"),this.addHandles(this.layerViews.map((i=>t((()=>i.visible),(e=>this._applyVisibility((()=>{e!==this.visible&&(i.visible=this.visible)}),(()=>this._applyExclusiveVisibility(e?i:null)))),l))).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility((()=>this._allLayerViewVisibility(this.visible)),(()=>this._applyExclusiveVisibility(e?.visible?e:null)))}_applyVisibility(i,e){this._hasLayerViewVisibleOverrides()&&("inherited"===this.layer?.visibilityMode?i():"exclusive"===this.layer?.visibilityMode&&e())}};i([a({cast:r})],h.prototype,"layerViews",null),i([a({readOnly:!0})],h.prototype,"updatingProgress",null),i([a()],h.prototype,"view",void 0),h=i([y("esri.views.layers.GroupLayerView")],h);const n=h;export{n 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/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as i}from"../../layers/support/commonProperties.js";import{
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import r from"../../core/Error.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{combinedViewLayerTimeExtentProperty as i}from"../../layers/support/commonProperties.js";import{projectDatasetExtent as a,getDefaultDatumTransformationForDataset as n}from"../../layers/support/rasterFunctions/rasterProjectionHelper.js";import{getFetchPopupTemplate as l}from"./support/popupUtils.js";const p=p=>{let u=class extends p{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return a(this.layer.rasterInfo,this.view.spatialReference)}get hasTilingEffects(){return!!(this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment)}get datumTransformation(){return n(this.layer.fullExtent,this.view.spatialReference,!0)}supportsSpatialReference(e){return!!a(this.layer.rasterInfo,e)}async fetchPopupFeatures(e,o){const{layer:s}=this;if(!e)throw new r("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:i}=s,a=l(s,o);if(!i||null==a)throw new r("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:i,popupTemplate:a});const n=[],{value:p,magdirValue:u,processedValue:c}=await s.identify(e,{timeExtent:this.timeExtent});let f="";if(p&&p.length){f="imagery-tile"===s.type&&s.hasStandardTime()&&null!=p[0]?p.map((e=>s.getStandardTimeValue(e))).join(", "):p.join(", ");const e={ObjectId:0},r="Raster.ServicePixelValue";e[r]=c?.join(", ")??f,e[r+".Raw"]=f;const o=s.rasterInfo.attributeTable;if(null!=o){const{fields:t,features:r}=o,s=t.find((({name:e})=>"value"===e.toLowerCase())),i=s?r.find((e=>String(e.attributes[s.name])===f)):null;if(i)for(const o in i.attributes)if(i.attributes.hasOwnProperty(o)){e[this._rasterFieldPrefix+o]=i.attributes[o]}}const i=s.rasterInfo.dataType;"vector-magdir"!==i&&"vector-uv"!==i||(e["Raster.Magnitude"]=u?.[0],e["Raster.Direction"]=u?.[1]);const a=new t(this.fullExtent.clone(),null,e);a.layer=s,a.sourceLayer=a.layer,n.push(a)}return n}};return e([o()],u.prototype,"layer",void 0),e([o(i)],u.prototype,"timeExtent",void 0),e([o()],u.prototype,"view",void 0),e([o()],u.prototype,"fullExtent",null),e([o()],u.prototype,"tileInfo",void 0),e([o({readOnly:!0})],u.prototype,"hasTilingEffects",null),e([o()],u.prototype,"datumTransformation",null),u=e([s("esri.views.layers.ImageryTileLayerView")],u),u};export{p 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/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{NestedMap as
|
|
5
|
+
import{NestedMap as r}from"../../core/NestedMap.js";import{Program as t}from"./Program.js";class e{constructor(t){this._rctx=t,this._store=new r}dispose(){this._store.forEach((r=>r.forEach((r=>r.dispose())))),this._store.clear()}acquire(r,e,s,o){const c=this._store.get(r,e);if(null!=c)return c.ref(),c;const h=new t(this._rctx,r,e,s,o);return h.ref(),this._store.set(r,e,h),h}get test(){let r=0;return this._store.forEach((t=>t.forEach((t=>r+=t.hasGLName?2:1)))),{cachedWebGLProgramObjects:r}}}export{e as ProgramCache};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../Basemap.js";import t from"../../Ground.js";import n from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as r,Integer as a}from"../../core/accessorSupport/ensureType.js";import{isCollection as y}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import o from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as s}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as u}from"../../layers/mixins/operationalLayers.js";import l from"../../layers/support/Sublayer.js";import{JoinTableDataSource as i,DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as m}from"../../layers/support/source/MapLayerSource.js";import{ScanContext as f}from"./utils.js";async function d(e){return S(null,{typeName:"json",type:e},new f)}async function b(e,t,n){switch(t.typeName){case"array":await v(e,t,n);break;case"union":await k(e,t,n);break;case"json":await S(e,t,n);break;case"native":await w(e,t,n);break;case"enum":await j(e,t,n)}}async function w(e,t,n){n.addProperty({name:e,type:_(t),default:t.default})}function N(e){const t=e.slice();return t.sort(),t}async function j(e,t,n){const r=t.values.slice();t.nullable&&r.push(null),n.currentClass&&n.currentClass.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`}):n.addProperty({name:e,type:_(t),enum:N(r).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|"),default:t.default})}async function v(e,t,n){await b(`${e}[]`,t.elementType,n)}function g(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;if(y&&Array.isArray(y)&&1===y.length&&"string"==typeof y[0])return a?y[0]:I(n,y[0])}return t}async function k(e,t,n){const r=[];for(const a of t.types)if("native"!==a.type.typeName&&t.key){const t=`${e}<${g(a.type,a.value)}>`;await b(t,a.type,n)}else r.push(a.type);if(r.length){const a=r.map(_);t.nullable&&a.push("null"),a.sort(),n.addProperty({type:a.join("|"),name:e,default:t.default})}}async function
|
|
5
|
+
import e from"../../Basemap.js";import t from"../../Ground.js";import n from"../../WebScene.js";import"../../core/has.js";import{isLongFormType as r,Integer as a}from"../../core/accessorSupport/ensureType.js";import{isCollection as y}from"../../core/accessorSupport/extensions/serializableProperty/type.js";import o from"../../layers/GroupLayer.js";import p from"../../layers/KMLLayer.js";import{typeModuleMap as s}from"../../layers/mixins/operationalLayerModuleMap.js";import{supportedTypes as u}from"../../layers/mixins/operationalLayers.js";import l from"../../layers/support/Sublayer.js";import{JoinTableDataSource as i,DataLayerSource as c}from"../../layers/support/source/DataLayerSource.js";import{MapLayerSource as m}from"../../layers/support/source/MapLayerSource.js";import{ScanContext as f}from"./utils.js";async function d(e){return S(null,{typeName:"json",type:e},new f)}async function b(e,t,n){switch(t.typeName){case"array":await v(e,t,n);break;case"union":await k(e,t,n);break;case"json":await S(e,t,n);break;case"native":await w(e,t,n);break;case"enum":await j(e,t,n)}}async function w(e,t,n){n.addProperty({name:e,type:_(t),default:t.default})}function N(e){const t=e.slice();return t.sort(),t}async function j(e,t,n){const r=t.values.slice();t.nullable&&r.push(null),n.currentClass&&n.currentClass.typeValue&&"type"===e?n.addProperty({name:e,type:"string",enum:`"${n.currentClass.typeValue}"`}):n.addProperty({name:e,type:_(t),enum:N(r).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|"),default:t.default})}async function v(e,t,n){await b(`${e}[]`,t.elementType,n)}function g(e,t){if("json"===e.typeName){const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;if(y&&Array.isArray(y)&&1===y.length&&"string"==typeof y[0])return a?y[0]:I(n,y[0])}return t}async function k(e,t,n){const r=[];for(const a of t.types)if("native"!==a.type.typeName&&t.key){const t=`${e}<${g(a.type,a.value)}>`;await b(t,a.type,n)}else r.push(a.type);if(r.length){const a=r.map(_);t.nullable&&a.push("null"),a.sort(),n.addProperty({type:a.join("|"),name:e,default:t.default})}}async function h(r,a){return r.type===n&&"layers"===a?P("web-scene/operational-layers"):r.type!==e||"baseLayers"!==a&&"baseMapLayers"!==a?r.type===e&&"elevationLayers"===a||r.type===t&&"layers"===a?P("web-scene/ground"):r.type===o&&"layers"===a?P("web-scene/operational-layers",(e=>e!==o)):r.type!==i||"leftTableSource"!==a&&"rightTableSource"!==a?null:B({key:"type",base:null,typeMap:{"data-layer":c,"map-layer":m}}):P("web-scene/basemap")}async function T(e,t,n){const r=await h(e,t);return r||C(n)}function M(e){return e.prototype.declaredClass.replaceAll(".","/")}async function S(e,t,n){const r=t.type.__accessorMetadata__,a=M(t.type);if(!r)return e&&n.addProperty({name:e,type:"unknown"}),null;let y=a,o=null;const p=e&&e.match(/<([^>]+)>$/);p&&(y+=`--${p[1]}`,o=p[1]),t.type===l&&(y+=`--${n.currentClass?.name}`,o=n.currentClass?.name);const s=n.seen.get(y);if(s&&e)return n.addProperty({name:e,type:s}),s;const u={type:t.type,name:a,id:y,properties:[]};e&&(n.addProperty({name:e,type:u}),u.typeValue=o),n.push(e,u);for(const i in r){const e=r[i],a=K(e);if(!a||!a.enabled)continue;if(t.type===l){const e="esri/layers/TileLayer"===n.stack[n.stack.length-2].klass.name;if(e&&l.test.isMapImageLayerOverridePolicy(a.overridePolicy)||!e&&l.test.isTileImageLayerOverridePolicy(a.overridePolicy))continue}const y=a.target;if("string"==typeof y||null==y){const r=await T(t,i,e);if(!r)continue;await b("string"==typeof y?y:i,r,n)}else await L(t,y,n)}return n.pop()}async function L(e,t,n){for(const r in t){let a=await h(e,r);if(!a){const e=t[r];a=e.types?B(e.types):V(e.type),a.default=e.default,a=O(a)}await b(r,a,n)}}async function P(e,t){const n={typeName:"union",key:"layerType",types:[]};for(const r in u[e]){if("web-scene/operational-layers"===e&&"ArcGISTiledElevationServiceLayer"===r)continue;const a=await s[r]();a&&(t&&!t(a)||a!==p&&n.types.push({type:{typeName:"json",type:a},value:r}))}if(0===n.types.length)return null;return{typeName:"array",elementType:1===n.types.length?n.types[0].type:n}}function _(e){switch(e.typeName){case"array":return`${_(e.elementType)}[]`;case"union":{const t=e.types.map((e=>_(e.type)));return e.nullable&&t.push("null"),t.sort(),`${t.join(" | ")}`}case"native":switch(e.type){case Number:return"number";case a:return"integer";case String:return"string";case Boolean:return"boolean";case Object:return"object";default:return"unknown"}case"json":return e.type.prototype.declaredClass;case"enum":return"string"}}function $(e){const t=e.prototype.itemType&&e.prototype.itemType.Type;if(!t)return{typeName:"array",elementType:{typeName:"native",type:null}};if("function"==typeof t)return{typeName:"array",elementType:V(t)};if(t.typeMap){const e=[];for(const n in t.typeMap){const r=t.typeMap[n];e.push({type:V(r),value:D(r)?null:n})}return{typeName:"array",elementType:{typeName:"union",key:"string"==typeof t.key?t.key:"type",types:e}}}}function A(e){if("json"!==e.typeName)return null;const t=e.type.__accessorMetadata__,n=t?.type,r=n&&E(n),a=r&&r.type,y=a||n&&n.type;return y&&Array.isArray(y)&&"string"==typeof y[0]?a||n.type.map((e=>I(n,e))):null}function O(e){if("array"===e.typeName)return e.elementType=O(e.elementType),e;const t=A(e);return t?{typeName:"union",key:"type",nullable:e.nullable,types:t.map((t=>({value:t,type:e})))}:e}function C(e){const t=E(e);return t?.types?B(t.types):!t?.type&&e.types?B(e.types):x(O(J(e)))}function x(e){return e.nullable&&"native"===e.typeName?{typeName:"union",key:null,types:[{value:null,type:e}],nullable:!0}:e}function B(e){if(Array.isArray(e))return{typeName:"array",elementType:B(e[0])};const t=[];for(const n in e.typeMap){const r=e.typeMap[n];t.push({type:V(r),value:D(r)?null:n})}return{typeName:"union",key:"string"==typeof e.key?e.key:"type",types:t}}function G(e){return null!=e&&e.isJSONMapWriter}function I(e,t){const n=K(e);if(n&&G(n.writer)){const e={value:""};return n.writer?.(t,e,"value"),e.value}return t}function J(e){const t=E(e),n=K(e),r=V(t&&t.type||e.type);return t&&void 0!==t.default&&"function"!=typeof t.default&&(r.default=I(e,t.default)),n?.allowNull&&(r.nullable=!0),r}function V(e){return e?r(e)?W(e):Array.isArray(e)?"string"==typeof e[0]||"number"==typeof e[0]?{typeName:"enum",values:e}:e.length>1?{typeName:"union",key:null,types:e.map((e=>({type:V(e),value:null})))}:{typeName:"array",elementType:V(e[0])}:y(e)?$(e):D(e)?{typeName:"native",type:e}:z(e)?{typeName:"json",type:e}:{typeName:"native",type:null}:{typeName:"native",type:null}}function W(e){switch(e.type){case"native":return{typeName:"native",type:e.value};case"array":return{typeName:"array",elementType:V(e.value)};case"one-of":return{typeName:"union",key:null,types:e.values.map((e=>({type:W(e),value:null})))}}}function z(e){let t=e;for(;t;){if(t.prototype&&("esri.core.JSONSupport"===t.prototype.declaredClass||"esri.core.MultiOriginJSONSupport"===t.prototype.declaredClass))return!0;t=Object.getPrototypeOf(t)}return!1}function D(e){return e===String||e===Boolean||e===Number||e===a||e===Object}function E(e){if(!e.json)return null;const t=e.json.origins,n=e.json,r=t&&t["web-scene"],a=t&&t["web-document"];return r||a||n||null}function K(e){if(!e.json)return null;const t=e.json.origins,n=e.json.write,r=t&&t["web-scene"]&&t["web-scene"].write,a=t&&t["web-document"]&&t["web-document"].write;return r||a||n||null}export{d as scan};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),l=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(o(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await L(r,l,i),i.schemaStack.pop(),n}const p=c(e,t,i),u="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(u&&l)return i.addProperty({name:l,type:u}),i.schemaStack.pop(),u;const f={type:e,name:e,id:p,typeValue:t,properties:[]};return l&&i.addProperty({name:l,type:f}),i.push(l,f),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack.
|
|
5
|
+
import e from"../../core/Error.js";import{json as t}from"../../portal/schemas/webScene.js";import{ScanContext as r,sorted as n}from"./utils.js";function s(e,t){if(t.properties){if("layerType"in t.properties)return t.properties.layerType.enum[0];if("type"in t.properties&&t.properties.type.enum)return t.properties.type.enum[0]}switch(e){case"multipoint_geometry_schema.json":return"multipoint";case"point_geometry_schema.json":return"point";case"polyline_geometry_schema.json":return"polyline";case"polygon_geometry_schema.json":return"polygon";case"extent_schema.json":return"extent"}}function i(e){return"array"===e.type?`${i(e.items)}[]`:e.type}function a(e){const t={count:e.length,refsCount:0,typesCount:0,distinctTypes:[],type:null},r=new Set;for(const n in e){const s=e[n];s.$ref?t.refsCount++:s.type&&(t.typesCount++,r.add(i(s)))}return r.forEach((e=>t.distinctTypes.push(e))),t.distinctTypes.sort(),t.refsCount===t.count?t.type="refs":2===t.count&&t.refsCount>0&&1===t.distinctTypes.length&&"null"===t.distinctTypes[0]?t.type="refsAndNull":t.typesCount===t.count?(t.type="types",t.distinctTypes=t.distinctTypes):t.type="mix",t}function o(e){return"array"===e.type||!("properties"in e)}function c(e,t,r){if(!r.hasFilteredProperties)return`${e}--${t}`;return`${e}--${t}--${r.filteredPropertiesArray.join("/")}`}async function l(e,t,r,n,i){i.schemaStack.push(e);const a=s(e,r),l=n?n.replace("<?TYPE?>",a?`<${a}>`:""):"";if(o(r)){const n=i.currentClass?null:{type:e,name:e,id:`${e}--${t}`,typeValue:t,properties:[]};return n&&i.push(null,n),await L(r,l,i),i.schemaStack.pop(),n}const p=c(e,t,i),u="drawingInfo_schema.json"!==e&&"layer_schema.json"!==e&&i.seen.get(p);if(u&&l)return i.addProperty({name:l,type:u}),i.schemaStack.pop(),u;const f={type:e,name:e,id:p,typeValue:t,properties:[]};return l&&i.addProperty({name:l,type:f}),i.push(l,f),await L(r,"",i),i.schemaStack.pop(),i.pop()}async function p(e,t,r){const n=await r.requestSchema(e.$ref),s=R(n.schema);if(s){for(const e of s){const s={...n.schema};s.properties={...s.properties,type:{type:"string",enum:[e]}};const i=t&&!t.includes("<?TYPE?>")?`${t}<?TYPE?>`:t;await l(n.schemaId,e,s,i,r)}return}const i="layer_schema.json"===n.schemaId&&r.schemaStack.length?r.schemaStack[r.schemaStack.length-1].replace(/_schema\.json/,""):null;await l(n.schemaId,i,n.schema,t,r)}function u(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*pointCloudLayer_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function f(e,t){if(!h(e))return!1;const r=e.stack.map((e=>e.klass.type)).join("/");return/.*(imageServiceLayer|tiledImageServiceLayer)_schema\.json\/layerDefinition_schema\.json\/drawingInfo_schema\.json$/.test(r)&&"renderer"===t}function h(e){return!!e.currentClass&&"drawingInfo_schema.json"===e.currentClass.name}function m(e){switch(e.schemaStack[e.schemaStack.length-1]){case"operationalLayers_schema.json":case"elevationLayers_schema.json":case"baseMapLayer_schema.json":return!0}return!1}const y=/raster.*Renderer|vectorFieldRenderer/,d=/(uniqueValueRenderer|classBreaksRenderer|raster.*Renderer|vectorFieldRenderer)/,_=/(rasterUniqueValueRenderer|rasterClassBreaksRenderer)/;function w(e,t,r){if(h(r)){const n=u(r,t),s=f(r,t);return e.filter((e=>{if(/uniqueValueFromStyleRenderer_schema\.json$/.test(e.$ref))return!1;if(s)return d.test(e.$ref)&&!_.test(e.$ref);if(y.test(e.$ref))return!1;const t=/pointCloud.*Renderer/.test(e.$ref);return n===t}))}if(m(r)){const t=["kmlLayer","rasterDataElevationLayer","rasterDataLayer"];return e.filter((e=>!t.some((t=>e.$ref.replace(/.*\//,"")===`${t}_schema.json`))))}return e}async function j(e,t,r){await L(e.items,`${t}[]`,r)}async function $(e,t,r){for(const n in e.properties)if(("webscene_schema.json"!==r.currentClass?.name||"tables"!==n&&"mapRangeInfo"!==n&&"widgets"!==n)&&("baseMap_schema.json"!==r.currentClass?.name||"elevationLayers"!==n)){if(h(r)){const e=r.stack.map((e=>e.klass.type)).join("/");if(/imageServiceLayer|tiledImageServiceLayer/.test(e)&&"transparency"===n)continue}await r.withFilter(n,(async()=>{const s=t?`${t}.${n}`:n;await L(e.properties[n],s,r)}))}}function g(e,t="",r=new Set){for(const n of e)if("properties"in n)for(const e in n.properties){const s=n.properties[e],i=t?`${t}.${e}`:e,a=Object.keys(s);if(0===a.length||1===a.length&&"$ref"===a[0])r.add(i);else{if(1!==a.length||"allOf"!==a[0])throw new Error(`unexpected allOf filter construct: ${JSON.stringify(s)}`);r.add(i),g(s.allOf,i,r)}}return r}async function P(e,t,r){let n=null;for(const i of e.allOf)if("$ref"in i){if(n)throw new Error("Cannot process more than 1 ref in an allOf construct");n=i}else if(!("properties"in i))throw new Error("allOf construct only allows simple top-level property filters");const s=g(e.allOf);await r.addFilter(s,(()=>p(n,t,r)))}async function S(e,t,r){const s=a(e.oneOf);if("refs"!==s.type&&"refsAndNull"!==s.type)if("types"!==s.type)for(const n in e.oneOf){const s=`.oneOf[${n}]`;await L(e.oneOf[n],`${t}${s}`,r)}else r.addProperty({name:t,type:n(s.distinctTypes).join("|")});else{const n=w(e.oneOf,t,r);for(const e of n)if("null"===e.type);else{const s=`${t||""}`+(1!==n.length?"<?TYPE?>":"");await L(e,s,r)}}}function R(e){if("layerDefinition"===e.title)return null;const t=e.properties&&e.properties.type;return t&&t.enum?t.enum:null}async function k(e,t,r){await p(e,t,r)}async function O(e,t,r){let s="unknown";e.type&&(s=Array.isArray(e.type)?n(e.type).join("|"):e.type.replaceAll(" ","").split(",").join("|"));const i={name:t,type:s,default:e.default};e.enum&&(i.enum=n(e.enum).map((e=>"string"==typeof e?`"${e}"`:`${e}`)).join("|")),r.addProperty(i)}async function L(e,t,r){return"array"===e.type?j(e,t,r):"properties"in e?$(e,t,r):"allOf"in e?P(e,t,r):"oneOf"in e?S(e,t,r):"$ref"in e?k(e,t,r):O(e,t,r)}const C="#/definitions/";function T(e){return 0===e.indexOf(C)?e.slice(C.length):e}async function b(e,t){const r=await E.create(e,t);return l(`${e||"webscene"}_schema.json`,null,r.schemaRoot,null,r)}class E extends r{constructor(e,t,r){super(),this.definitions=e,this.schemaRoot=t,this.requestSchema=r,this._filteredProperties=null,this.schemaStack=[],this.requestSchema.bind(this)}get hasFilteredProperties(){return!!this._filteredProperties&&this._filteredProperties.size>0}get filteredPropertiesArray(){const e=[];return this._filteredProperties?.forEach((t=>e.push(t))),e}async withFilter(e,t){if(!this.hasFilteredProperties)return t();if(!this._filteredProperties?.has(e))return;const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r.forEach((t=>{const r=t.split(".",2);r.length>1&&r[0]===e&&n(r[1])})),await t(),this._filteredProperties=r}async addFilter(e,t){const r=this._filteredProperties;this._filteredProperties=null;const n=e=>{this._filteredProperties||(this._filteredProperties=new Set),this._filteredProperties.add(e)};r&&r.forEach(n),e&&e.forEach(n);const s=await t();return this._filteredProperties=r,s}static async create(e,t){return t&&t.useRemoteSchema?E.createRemote(e,t?.baseUrl):E.createLocal(e)}static createLocal(e){const r=e&&"webscene"!==e?t.definitions[`${e}_schema.json`]:t;return new E(t.definitions,r,E._getLocalSchemaRequest())}static async createRemote(e,t){const r=await E._getRemoteSchemaRequest(t),n=new E({},null,r),s=(await n.requestSchema(`${e||"webscene"}_schema.json`)).schema;return new E(n.definitions,s,r)}static _getLocalSchemaRequest(){return function(t){const r=T(t),n=this.definitions[r];return n?Promise.resolve({schemaId:r,schema:n}):Promise.reject(new e("spec-certification:spec-invalid-local-schema","Schema reference is not a local reference"))}}static async _getRemoteSchemaRequest(t){if(!t)return Promise.reject(new e("spec-certification:spec-missing-base-url","The base url of the remote schema directory must be specified when using a remote schema"));const r=E._getLocalSchemaRequest(),n=(await import("../../request.js")).default;return function(e){return r.call(this,e).catch((()=>n(`${t}/${e}`,{responseType:"json"}).then((t=>(this.definitions[T(e)]=t.data,{schemaId:e,schema:t.data})))))}}}const q=Object.keys(t.definitions).map((e=>e.replace(/_schema\.json$/,"")));export{b as scan,q as schemaDefinitions};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function t(t){return e(t,"",new Set,{})}function e(t,n,s,r){if(s.has(t))return r;s.add(t),n&&t.id&&(r[n]=t);for(const p of t.properties)if("string"!=typeof p.type){const t=n?`${n}.${p.name}`:p.name;e(p.type,t,s,r)}return s.delete(t),r}function n(t){const e=s(t,"",[]);return e.sort(((t,e)=>(t.name??"").localeCompare(e.name??""))),e}function s(t,e,n){for(const r of t.properties){const t=e?`${e}.${r.name}`:r.name;"string"==typeof r.type?n.push({name:t,type:r.type,default:r.default,enum:r.enum}):0===r.type.properties.length?n.push({name:t,type:"unknown",default:r.default,enum:r.enum}):s(r.type,t,n)}return n}class r{constructor(){this.stack=[],this.seen=new Map}addProperty(t){this.currentClass?.properties.push(t)}push(t,e){this.seen.set(e.id,e),this.stack.push({klass:e,propertyName:t})}pop(){return this.stack.pop()?.klass??null}get currentClass(){return this.stack.length?this.stack.
|
|
5
|
+
function t(t){return e(t,"",new Set,{})}function e(t,n,s,r){if(s.has(t))return r;s.add(t),n&&t.id&&(r[n]=t);for(const p of t.properties)if("string"!=typeof p.type){const t=n?`${n}.${p.name}`:p.name;e(p.type,t,s,r)}return s.delete(t),r}function n(t){const e=s(t,"",[]);return e.sort(((t,e)=>(t.name??"").localeCompare(e.name??""))),e}function s(t,e,n){for(const r of t.properties){const t=e?`${e}.${r.name}`:r.name;"string"==typeof r.type?n.push({name:t,type:r.type,default:r.default,enum:r.enum}):0===r.type.properties.length?n.push({name:t,type:"unknown",default:r.default,enum:r.enum}):s(r.type,t,n)}return n}class r{constructor(){this.stack=[],this.seen=new Map}addProperty(t){this.currentClass?.properties.push(t)}push(t,e){this.seen.set(e.id,e),this.stack.push({klass:e,propertyName:t})}pop(){return this.stack.pop()?.klass??null}get currentClass(){return this.stack.length?this.stack[this.stack.length-1].klass:null}get pathString(){return this.stack.map((t=>t.propertyName)).filter((t=>!!t)).join(".")}}function p(t){const e=t.slice();return e.sort(),e}export{r as ScanContext,t as collectClassPaths,n as flatten,p as sorted};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{binaryIndexOf as l}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as a}from"../../core/collectionUtils.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{createLoadLayersFunction as n}from"./support/layerUtils.js";import{getDomainInfo as u,getValidNumber as d,getMin as h,getMax as p}from"./support/validation.js";let y=class extends t{constructor(e){super(e),this.state="disabled",this._valueBeforeReady=null,this._domainInfo=u([]),this._loadLayers=n(),this.layers=new s}initialize(){this.addHandles(this.layers.on("change",(()=>this._onLayersChange()))),this._onLayersChange()}destroy(){this._set("state","disabled")}get enabled(){return this.allowedValues.length>0&&this._get("enabled")}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set("enabled",e)}get value(){return("ready"===this.state?this._get("value"):this._valueBeforeReady)??0}set value(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);if(e===this.value)return;const t=d(e,this);null!=t&&this._set("value",t)}get min(){return h(this.allowedValues)}get max(){return p(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}get hasNext(){if(!this.enabled)return!0;const e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){const t=this._get("layers");this._set("layers",a(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return l(this.allowedValues,this.value)}select(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);null!=d(e,this)&&(this.enabled=!0,this.value=e)}clear(){"ready"===this.state?this.enabled=!1:this._valueBeforeReady=null}next(){const{state:e,allowedValues:t,enabled:l,hasNext:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a+1])):(this.enabled=!0,void(this.value=t[0]))}else this._valueBeforeReady++}previous(){const{state:e,allowedValues:t,enabled:l,hasPrevious:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a-1])):(this.enabled=!0,void(this.value=t.
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import{binaryIndexOf as l}from"../../core/arrayUtils.js";import s from"../../core/Collection.js";import{referenceSetter as a}from"../../core/collectionUtils.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{createLoadLayersFunction as n}from"./support/layerUtils.js";import{getDomainInfo as u,getValidNumber as d,getMin as h,getMax as p}from"./support/validation.js";let y=class extends t{constructor(e){super(e),this.state="disabled",this._valueBeforeReady=null,this._domainInfo=u([]),this._loadLayers=n(),this.layers=new s}initialize(){this.addHandles(this.layers.on("change",(()=>this._onLayersChange()))),this._onLayersChange()}destroy(){this._set("state","disabled")}get enabled(){return this.allowedValues.length>0&&this._get("enabled")}set enabled(e){e!==this.enabled&&this.allowedValues.length>0&&this._set("enabled",e)}get value(){return("ready"===this.state?this._get("value"):this._valueBeforeReady)??0}set value(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);if(e===this.value)return;const t=d(e,this);null!=t&&this._set("value",t)}get min(){return h(this.allowedValues)}get max(){return p(this.allowedValues)}get allowedValues(){return this._domainInfo.allowedValues}get hasNext(){if(!this.enabled)return!0;const e=this._valueIndex;return e>=0&&e<this.allowedValues.length-1}get hasPrevious(){return!this.enabled||this._valueIndex>0}set layers(e){const t=this._get("layers");this._set("layers",a(e,t))}get filterExpressions(){return{solid:null,xRay:null}}get _valueIndex(){return l(this.allowedValues,this.value)}select(e){if("ready"!==this.state)return void(this._valueBeforeReady=e);null!=d(e,this)&&(this.enabled=!0,this.value=e)}clear(){"ready"===this.state?this.enabled=!1:this._valueBeforeReady=null}next(){const{state:e,allowedValues:t,enabled:l,hasNext:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a+1])):(this.enabled=!0,void(this.value=t[0]))}else this._valueBeforeReady++}previous(){const{state:e,allowedValues:t,enabled:l,hasPrevious:s,_valueIndex:a}=this;if("ready"===e||null==this._valueBeforeReady){if(0!==t.length)return l?void(s&&(this.value=t[a-1])):(this.enabled=!0,void(this.value=t[t.length-1]))}else this._valueBeforeReady++}getValueLabel(e){return 0===this.layers.length?null:this._domainInfo.fieldValueMap.get(e)??null}async _onLayersChange(){if(this._set("state","loading"),this._domainInfo=u([]),0!==this.layers.length)try{await this._loadLayers(this.layers),this._setup()}catch(e){r(e)||this._set("state","failed")}}};e([o({value:!1,nonNullable:!0})],y.prototype,"enabled",null),e([o({nonNullable:!0})],y.prototype,"value",null),e([o({readOnly:!0})],y.prototype,"min",null),e([o({readOnly:!0})],y.prototype,"max",null),e([o({readOnly:!0})],y.prototype,"allowedValues",null),e([o({readOnly:!0})],y.prototype,"hasNext",null),e([o({readOnly:!0})],y.prototype,"hasPrevious",null),e([o({type:s,nonNullable:!0})],y.prototype,"layers",null),e([o({nonNullable:!0})],y.prototype,"state",void 0),e([o()],y.prototype,"_valueBeforeReady",void 0),e([o({readOnly:!0})],y.prototype,"_valueIndex",null),e([o()],y.prototype,"_domainInfo",void 0),y=e([i("esri.widgets.BuildingExplorer.BuildingNumericFilterViewModel")],y);const v=y;export{v 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/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import"../../core/has.js";import{subclass as t}from"../../core/accessorSupport/decorators/subclass.js";import l from"./BuildingNumericFilterViewModel.js";import{findFieldInfoByModelName as r}from"./support/buildingLayerUtils.js";import{getValueFromFilters as i}from"./support/filterUtils.js";import{getDomainInfo as o}from"./support/validation.js";const a="demolishedphase",d="createdphase";let n=class extends l{constructor(){super(...arguments),this._createdPhaseFieldName=null,this._demolishedPhaseFieldName=null,this._parseValueFromFilter=e=>{const s=this._createdPhaseFieldName,t=new RegExp(`${s}\\s*<=\\s*(\\d+)\\s*OR\\s*${s}\\s*IS\\s*NULL`,"gi"),l=this._demolishedPhaseFieldName,r=new RegExp(`${l}\\s*>\\s*(\\d+)\\s*OR\\s*${l}\\s*IS\\s*NULL`,"gi");for(const{filterExpression:i}of e.filterBlocks?.items??[]){const e=i?t.exec(i)??r.exec(i):null;if(e)return parseInt(e[1],10)}return null}}get filterExpressions(){if(!this.enabled)return{solid:null,xRay:null};const e=[],s=this._createdPhaseFieldName;s&&e.push(`(${s} <= ${this.value} OR ${s} IS NULL)`);const t=this._demolishedPhaseFieldName;t&&e.push(`(${t} > ${this.value} OR ${t} IS NULL)`);const l=e.join(" AND ");return{solid:l,xRay:l}}get _lastValue(){const e=this.allowedValues;return e.length>0?e[e.length-1]:0}_setup(){const e=[];this.layers.forEach((s=>{const t=r(s,d);null!=t&&(this._createdPhaseFieldName=t.fieldName,e.push(t));const l=r(s,a);null!=l&&(this._demolishedPhaseFieldName=l.fieldName,e.push(l))})),this._domainInfo=o(e);const s=this._valueBeforeReady;if(this._set("state","ready"),this._valueBeforeReady=null,this.allowedValues.length>0){const e=s??i(this.layers,this._parseValueFromFilter);this.select(e??this._lastValue)}else this.clear()}};e([s({readOnly:!0})],n.prototype,"filterExpressions",null),e([s()],n.prototype,"_createdPhaseFieldName",void 0),e([s()],n.prototype,"_demolishedPhaseFieldName",void 0),e([s({readOnly:!0})],n.prototype,"_lastValue",null),n=e([t("esri.widgets.BuildingExplorer.BuildingPhase")],n);const h=n;export{h 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/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function l(l){const n={fieldValueMap:new Map,allowedValues:[]};for(const
|
|
5
|
+
function l(l){const n={fieldValueMap:new Map,allowedValues:[]};for(const e of l){const l=e.fieldValueMap,t=n.fieldValueMap;l.forEach(((l,e)=>{t.has(e)||(t.set(e,l),n.allowedValues.push(e))}))}return n.allowedValues.sort(((l,n)=>l-n)),n}function n(l){let n=null;for(const e of l)n=null!=n?Math.min(n,e):e;return n}function e(l){let n=null;for(const e of l)n=null!=n?Math.max(n,e):e;return n}function t(l,n){return n.allowedValues.length>0?o(l,n.allowedValues):null}function o(l,n){if(0===n.length)return l;if(l===1/0)return n[n.length-1];if(l===-1/0)return n[0];let e=n[0],t=Math.abs(e-l);for(const o of n){const n=Math.abs(o-l);n<t&&(e=o,t=n)}return e}export{o as findClosest,l as getDomainInfo,e as getMax,n as getMin,t as getValidNumber};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
const e="esri-directions",t={base:`${e} esri-widget esri-widget--panel`,addStopButton:`${e}__add-stop-button`,arrivalTime:`${e}__arrival-time`,arrivalTimeContainer:`${e}__arrival-time-container`,clearRouteButton:`${e}__clear-route-button`,collapsibleSection:`${e}__maneuver-section--collapsible`,contentTitle:`${e}__content-title`,costsDetails:`${e}__costs-details`,departureTime:`${e}__departure-time`,departureTimeControls:`${e}__departure-time-controls`,departureTimeSelect:`${e}__departure-time-select`,directionCosts:`${e}__costs`,directionsButton:`${e}__button`,directionsSection:`${e}__directions-section`,disclaimer:`${e}__disclaimer`,horizontalSplitter:`${e}__horizontal-splitter`,interactiveStopIcon:`${e}__stop-icon--interactive`,intermediateCost:`${e}__cost--intermediate`,lastStopIconContainer:`${e}__stop-icon-container--last`,layerDetailsLink:`${e}__layer-details-link`,loader:`${e}__loader`,maneuver:`${e}__maneuver`,maneuverActive:`${e}__maneuver--active`,maneuverCosts:`${e}__maneuver-costs`,maneuverCostsContainer:`${e}__maneuver-costs-container`,maneuverIcon:`${e}__maneuver-icon`,maneuverList:`${e}__maneuver-list`,maneuverSection:`${e}__maneuver-section`,maneuverSectionHeader:`${e}__maneuver-section-header`,maneuverSectionHeaderButton:`${e}__maneuver-section-header-toggle-button`,maneuverSectionTitle:`${e}__maneuver-section-title`,maneuverSectionToggle:`${e}__maneuver-section-toggle`,maneuvers:`${e}__maneuvers`,message:`${e}__message`,messageHeading:`${e}__message_heading`,panelContent:`${e}__panel-content`,panelContentError:`${e}__panel-content--error`,panelContentLoading:`${e}__panel-content--loading`,panelContentSignIn:`${e}__panel-content--sign-in`,primaryCosts:`${e}__costs-value`,printButton:`${e}__print-button`,removeStop:`${e}__remove-stop-icon`,removeStopButton:`${e}__remove-stop`,reverseStops:`${e}__reverse-stops`,routeActions:`${e}__route-actions`,saveAsButton:`${e}__save-as-button`,saveAsButtonPopover:`${e}__save-as-button-with-popover`,saveButton:`${e}__save-button`,saveButtons:`${e}__save-buttons`,saveSection:`${e}__save-section`,scroller:`${e}__scroller`,secondaryCosts:`${e}__other-costs-total`,section:`${e}__section`,sectionSplitter:`${e}__section-splitter`,signInButton:`${e}__sign-in-button`,signInContent:`${e}__sign-in-content`,stopHandle:`${e}__stop-handle`,stopHandleIcon:`${e}__stop-handle-icon`,stopIcon:`${e}__stop-icon`,stopIconContainer:`${e}__stop-icon-container`,stopInput:`${e}__stop-input`,stopOptions:`${e}__stop-options`,stopRow:`${e}__stop-row`,stopRowGhost:`${e}__stop-row-ghost`,stops:`${e}__stops`,summary:`${e}__summary`,toolbarButtons:`${e}__toolbar-buttons`,toolbarSection:`${e}__toolbar-section`,travelMode:`${e}__travel-modes`,travelModeSelect:`${e}__travel-modes-select`,validStopRow:`${e}__stop-row--valid`,verticalSplitter:`${e}__vertical-splitter`,warningCard:`${e}__warning-card`,warningHeader:`${e}__warning-header`,warningHeading:`${e}__warning-heading`,warningMessage:`${e}__warning-message`,closeIcon:"esri-icon-up",handleIcon:"esri-icon-handle-vertical",lastStopIcon:"esri-icon-radio-checked",openIcon:"esri-icon-down",removeStopIcon:"esri-icon-trash",reverseStopIcon:"esri-icon-up-down-arrows",stopsIcon:"esri-icon-radio-unchecked",warningIcon:"esri-icon-notice-triangle",widgetIcon:"esri-icon-directions",button:"esri-button",buttonDisabled:"esri-button--disabled",buttonSecondary:"esri-button--secondary",buttonTertiary:"esri-button--tertiary",emptyContent:"esri-widget__content--empty",emptyIllustration:"esri-widget__content-illustration--empty",screenReaderText:"esri-icon-font-fallback-text",select:"esri-select"},n=new Map([["arrive","route-to"],["bear-left","bear-left"],["bear-right","bear-right"],["boundary-crossing","blank"],["central-fork","fork-middle"],["clockwise-roundabout","round-about-right"],["counter-clockwise-roundabout","round-about"],["depart","route-from"],["door","walk-through-door"],["down-elevator","elevator-down"],["down-escalator","escalator-down"],["down-stairs","stairs-down"],["elevator","elevator"],["escalator","escalator"],["general-event","information"],["landmark","map-pin"],["left-fork","fork-left"],["left-handed-u-turn","u-turn"],["left-ramp","ramp-left"],["left-turn","left"],["left-turn-and-immediate-left-turn","left-left"],["left-turn-and-immediate-right-turn","left-right"],["off-ferry","disembark"],["on-ferry","embark"],["pedestrian-ramp","take-pedestrian-ramp"],["restriction-violation","exclamation-mark-triangle"],["right-fork","fork-right"],["right-handed-u-turn","u-turn-right"],["right-ramp","exit-highway-right"],["right-ramp","ramp-right"],["right-turn","right"],["right-turn-and-immediate-left-turn","right-left"],["right-turn-and-immediate-right-turn","right-right"],["roundabout","round-about"],["scaled-cost-barrier-event","blank"],["sharp-left","sharp-left"],["sharp-right","sharp-right"],["stairs","stairs"],["straight","straight"],["time-zone-change","clock"],["traffic-event","exclamation-mark-triangle"],["u-turn","u-turn"],["up-elevator","elevator-up"],["up-escalator","escalator-up"],["up-stairs","stairs-up"]]);var r;function o(e){if(null==e||!n.has(e))return null;return n.get(e)}!function(e){e.NOW="now",e.DEPART_AT="depart-at",e.UNSPECIFIED="unspecified"}(r||(r={}));export{t as CSS,r as DepartureTimeOption,o as getIconName};
|
package/widgets/Directions.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/4.28/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{on as t,pausable as s}from"../core/events.js";import{makeHandle as i}from"../core/handleUtils.js";import{assertIsSome as o}from"../core/maybe.js";import{watch as r,initial as n,when as a,on as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as h}from"../properties/defaultUnit.js";import p from"../rest/support/Stop.js";import v from"../symbols/SimpleMarkerSymbol.js";import m from"./Search.js";import _ from"./Widget.js";import g from"./Directions/DirectionsViewModel.js";import{SaveLayer as S}from"./Directions/components/SaveLayer.js";import{formatDistance as y,formatDuration as w}from"./Directions/support/directionsUtils.js";import{DepartureTimeOption as M,CSS as f,getIconPath as b}from"./Directions/support/resources.js";import{isArcGISWorldGeocoder as T,meteredArcGISLocatorUrl as C}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import D from"./support/DatePicker.js";import{Heading as I,incrementHeadingLevel as P}from"./support/Heading.js";import R from"./support/TimePicker.js";import{accessibleHandler as L}from"./support/decorators/accessibleHandler.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{tsx as H}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import A from"sortablejs";import{formatNumber as j}from"../intl/number.js";import{formatDate as E,convertDateFormatToIntlOptions as x}from"../intl/date.js";const O={departureTime:!0,layerDetails:!0,printButton:!1,saveAsButton:!0,saveButton:!0,stops:!0,traveMode:!0};function U(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,o=Math.abs(Math.floor(t/i)),r=Math.abs(Math.floor(t)%i),n={minimumIntegerDigits:2};return`GMT${s}${j(o,n)}${j(r,n)}`}function z(e){return!!e.composedPath?.().find((e=>e.classList?.contains("esri-search__suggestions-list")))}const $="search-term",F="date-time-picker",N=100,K=500;let V=class extends _{constructor(e,t){super(e,t),this._activeStop=null,this._activeManeuver=null,this._autoStopRemovalDelay=N,this._autoStopRemovalTimeoutId=void 0,this._departureTimeOption=M.NOW,this._datePicker=new D,this._focusedManeuver=null,this._newPlaceholderStop=null,this._pointerDownUpHandle=null,this._pointerPressedSearchSuggestionStop=null,this._renderSavePopoverFunction=null,this._saveAsButtonNode=null,this._saveLayer=new S,this._sections=null,this._sortable=null,this._stopsToSearches=new Map,this._timePicker=new R,this._viewClickHandle=null,this.headingLevel=2,this.iconClass=f.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new g,this.visibleElements={...O},this._setUpDragAndDropStops=e=>{this._sortable=A.create(e,{draggable:`.${f.validStopRow}`,ghostClass:f.stopRowGhost,handle:`.${f.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this.viewModel.layer?.stops.forEach((e=>this.acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t||null==t||null==e)return;const{children:i}=s,o=i[t],r=i[e],n=t-e<0;s.insertBefore(o,n?r.nextElementSibling:r);const{stops:a}=this.viewModel.layer;a.reorder(a.at(e),t);for(const l of a)l.sequence=null;this._getDirections()}}initialize(){this.addHandles([r((()=>this.viewModel.layer?.routeInfo),(()=>{this._activeManeuver=null,this._focusedManeuver=null,this._sections=this._getSections(),this.scheduleRender()}),n),a((()=>this.view),((e,s)=>{if(s&&(this._viewClickHandle=null,null!=s&&this.removeHandles(s)),e){const s=this._prepPointerDownUpClick(),i=this._prepViewClick();s.pause(),i.pause();const o=e.surface;this.addHandles([t(o,"mousedown",(()=>this._autoStopRemovalDelay=K)),t(o,"mouseup",(()=>this._autoStopRemovalDelay=N)),s,i],e),this._pointerDownUpHandle=s,this._viewClickHandle=i}}),n),a((()=>null==this.viewModel.serviceDescription),(()=>{try{this.viewModel.load()}catch{}}),n),r((()=>this._saveLayer.state),(()=>{this.scheduleRender()}))]),this.when((()=>{this.destroyed||this.visibleElements.saveAsButton&&(this._renderSavePopoverFunction=this._renderSavePopover.bind(this),this._projector.append(document.body,this._renderSavePopoverFunction))}))}loadDependencies(){return k({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),link:()=>import("@esri/calcite-components/dist/components/calcite-link.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js")})}destroy(){this._datePicker.destroy(),this._timePicker.destroy();for(const e of this._stopsToSearches.values())e.destroy();this._sortable?.destroy(),null!=this._renderSavePopoverFunction&&this._projector.detach(this._renderSavePopoverFunction)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...O,...e}}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new m({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this.addHandles([l((()=>s.allSources),"change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.geometry=s.selectedResult?.feature.geometry,e.name=s.selectedResult?.name,this._getDirections()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e))),s.on("search-clear",(()=>{e.geometry=null,e.name=null,this._activeStop=e,this.viewModel.layer?.removeResult()})),r((()=>s.searchTerm),(t=>{e.name=t}))],s),this._stopsToSearches.set(e,s),s}getDirections(){return this.viewModel.getDirections()}render(){return H("div",{class:this.classes(f.base,f.scroller)},this._renderPanelContent())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_renderPanelContent(){const{layer:e,serviceDescription:t,state:s}=this.viewModel,i="initializing"===s,o="error"===s&&!t,r="unauthenticated"===s,n={[f.panelContentLoading]:i,[f.panelContentError]:o||!e,[f.panelContentSignIn]:r},a=i?"presentation":"group",l=e?r?this._renderSignIn():o?this._renderMessage(this._getErrorMessage()):i?this._renderLoader():this._renderReadyContent():this._renderMessage(this.messages.missingLayer);return H("div",{class:this.classes(f.panelContent,n),role:a},l)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSaveContainer(),this._renderSectionSplitter(),this._renderDirectionsContainer()]}_renderSignIn(){return H("div",{key:"sign-in",class:f.signInContent},H(I,{class:f.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),H(I,{level:P(this.headingLevel)},this.messages.signInRequired),H("button",{class:this.classes(f.button,f.buttonSecondary,f.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){if(!this.visibleElements.traveMode)return null;const{selectedTravelMode:e,travelModes:t}=this.viewModel;if(0===t.length)return null;const s=null!=e?e.name:this.messages.travelMode;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.travelMode,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__travel-mode-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(f.travelModeSelect,f.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},t.map(((t,s)=>H("option",{key:`esri-directions__travel-mode-${s}`,"data-mode":t,selected:e===t,value:`${s}`},t.name)))))}_handleTravelModeChange(e){const t=e.currentTarget;this.viewModel.selectedTravelMode=q(t.item(t.selectedIndex)),this._getDirections()}_renderStopsContainer(){return this.visibleElements.stops?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.section,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__stops-container",role:"group"},this._renderStops()):null}_renderDepartureTimeControls(){if(!this.visibleElements.departureTime)return null;const{messages:{departAt:e,departureTime:t,leaveNow:s,timeUnspecified:i}}=this;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.departureTime,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__departure-time-controls",role:"group"},H("select",{"aria-label":t,bind:this,class:this.classes(f.departureTimeSelect,f.select),onchange:this._handleDepartureOptionChange,title:t},H("option",{value:M.NOW,selected:this._departureTimeOption===M.NOW},s),H("option",{value:M.DEPART_AT,selected:this._departureTimeOption===M.DEPART_AT},e),H("option",{value:M.UNSPECIFIED,selected:this._departureTimeOption===M.UNSPECIFIED},i)),this._departureTimeOption===M.DEPART_AT?this._renderTimeControls():null)}_renderStops(){const{stops:e}=this.viewModel.layer;let t=0;for(const o of this._stopsToSearches.keys())e.includes(o)||this._disposeSearch(o);for(const o of e){const e=this.acquireSearch(o);"none"!==e.activeMenu&&(t+=1),null!=o.name&&(e.searchTerm=o.name)}const s=e.toArray().map(((s,i)=>{const o=e.length,r=i>1&&null==s.geometry,n={[f.stopsIcon]:i>=0&&i<o-1,[f.lastStopIcon]:i===o-1},a={[f.lastStopIconContainer]:i===o-1},l={[f.validStopRow]:!r},c=e.at(i+1),d=c&&null!=c.geometry,u=i===o-1,h=i===o-2,p=2===o&&0===i||o>2&&!u&&!h||o>2&&h&&d||o>2&&u&&null==s.geometry,v=o<3,m=this.acquireSearch(s),{messages:_}=this,{removeStop:g,reverseStops:S,unlocated:y}=_,w=null!=s.geometry&&null!=s.name?s.name:y,M=j(i+1),b=`${_.stopLabel} ${M} (${w})`,T=`${this.id}__stop--${i}`,C=!!m.searchTerm&&!!m.selectedResult&&null!=s.geometry&&m.selectedResult.name===s.name,k={zIndex:"none"!==m.activeMenu?""+t--:""};return H("li",{"aria-label":b,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(f.stopRow,l),id:T,key:i,"data-stop-index":i,styles:k},H("div",{class:f.stopHandle},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.handleIcon,f.stopHandleIcon,f.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),H("div",{bind:this,"aria-labelledby":T,class:this.classes(f.stopIconContainer,a),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},H("span",{class:this.classes(f.stopIcon,n),tabindex:C?"0":null}))),H("div",{class:f.stopInput},m.render()),H("div",{class:f.stopOptions,role:"group"},H("div",{"aria-label":g,class:f.removeStopButton,bind:this,"data-stop-index":i,hidden:v,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:g},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.removeStop,f.removeStopIcon,f.interactiveStopIcon)}),H("span",{class:f.screenReaderText},"removeStopTitle")),H("div",{"aria-label":S,class:f.reverseStops,bind:this,hidden:p,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:S},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.reverseStopIcon,f.interactiveStopIcon)}),H("span",{class:f.screenReaderText},"removeStopTitle"))))})),i=this._renderAddStop();return H("div",null,H("ol",{class:f.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),i)}_renderAddStop(){const e=this.viewModel.layer?.stops;if(!e)return null;const t=e.filter((({geometry:e})=>null!=e)),s=e.at(-1);return t.length>1&&t.length<this.maxStops&&null!=s&&null!=s.geometry?H("div",{class:f.toolbarSection},H("div",{class:f.toolbarButtons},H("calcite-button",{appearance:"outline",class:f.addStopButton,kind:"neutral",scale:"s",round:!0,iconStart:"plus",key:f.addStopButton,onclick:()=>{this._addNewPlaceholder()},label:this.messages.addStop,width:"full"},this.messages.addStop))):null}_handleStopIconClick(e){const t=G(e.currentTarget),s=null!=t?this.viewModel.layer?.stops.at(t):void 0;s?.geometry&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=G(e),i=null!=s?this.viewModel.layer?.stops.at(s):void 0;if(t===i){const e=this.acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){if(this._saveLayer.opened)return;this.removeHandles($);if(!!e.selectedResult&&null!=t.geometry&&null!=e.selectedResult?.feature.geometry&&t.geometry===e.selectedResult?.feature.geometry)return void this._pointerDownUpHandle?.pause();const s=null==t.geometry&&null==e.selectedResult?.feature.geometry,i=null!=t.geometry&&null!=e.selectedResult?.feature.geometry&&t.geometry!==e.selectedResult?.feature.geometry;if((s||i)&&"none"===e.activeMenu&&e.searchTerm)return e.search(),void this._pointerDownUpHandle?.pause();e.searchTerm||(this._viewClickHandle?.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{this.destroyed||(this._viewClickHandle?.pause(),"searching"!==e.viewModel.state?this._pointerPressedSearchSuggestionStop||(null!=t.geometry&&(t.geometry=null,this._getDirections()),this.scheduleRender()):this._pointerDownUpHandle?.pause())}),this._autoStopRemovalDelay))}_handleStopInputFocus(e,t){this._pointerDownUpHandle?.resume();const{view:s}=this;if(this.hasHandles($)||!s)return;const o=s.cursor;this.addHandles([i((()=>{s.cursor=o})),r((()=>e.searchTerm),(t=>{e.destroyed||(s.cursor=t.length?o:"copy")}),n)],$),this._activeStop=t}_prepViewClick(){const{view:e}=this.viewModel;o(e),o(e.surface);const t=s(e,"click",this._handleViewClick.bind(this)),i=s(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),i.pause()}));return{remove(){i.remove(),t.remove()},pause(){i.pause(),t.pause()},resume(){i.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=s(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=z(e)?this._activeStop:null})),t=s(document,"pointerup",(e=>{this._pointerDownUpHandle?.pause();const t=z(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?s:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){e.stopPropagation();const t=this._activeStop,s=t?this._stopsToSearches.get(t):null;t&&s&&!s.searchTerm&&(s.search(e.mapPoint).then((e=>{const i=e?.results[0].results;if(!i)return;const{feature:o,name:r}=i[0];t.geometry=o.geometry,t.name=r,s.searchTerm=r})),this.scheduleRender()),this._viewClickHandle?.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_addNewPlaceholder(){if(this._pointerDownUpHandle?.pause(),this._newPlaceholderStop)return;const e=new p({symbol:new v});this.viewModel.layer?.stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){const e=this.viewModel.layer?.stops??[];e.reverse();for(const t of e)t.sequence=null;this._getDirections()}_handleRemoveStop(e){const{layer:t}=this.viewModel;if(!t)return;const s=G(e.currentTarget);if(null==s)return;const{stops:i,routeInfo:o}=t,r=i.at(s);this._removeStop(r),null==r.geometry&&null!=o||this._getDirections()}_removeStop(e){const{stops:t}=this.viewModel.layer;!e||t.length<=2||(this._disposeSearch(e),t.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===M.NOW?(this._departureTimeOption=M.NOW,this.viewModel.departureTime=M.NOW,this.removeHandles(F),this._getDirections()):s.value===M.DEPART_AT?(this._departureTimeOption=M.DEPART_AT,this.addHandles(r((()=>[this._datePicker.value,this._timePicker.value]),(()=>{this._updateDepartureTime(),this._getDirections()}),n),F)):(this._departureTimeOption=M.UNSPECIFIED,this.viewModel.departureTime=null,this._getDirections())}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;e&&t&&(this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()))}_renderTimeControls(){return H("div",{class:f.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return H("div",{class:f.sectionSplitter})}_renderSaveContainer(){const{saveButton:e,saveAsButton:t,printButton:s,layerDetails:i}=this.visibleElements;return e||t||s||i?H("div",{class:f.saveSection,key:f.saveSection},this._renderSaveButtons(),this._renderRouteLayerDetailsLink()):null}_renderSaveButtons(){const{saveButton:e,saveAsButton:t,printButton:s}=this.visibleElements;return e||t||s?H("div",{class:f.saveButtons,key:f.saveButtons},this._renderSaveButton(),this._renderSaveAsButton(),this._renderPrintButton()):null}_renderSaveButton(){if(!this.visibleElements.saveButton)return null;const{portalItem:e,routeInfo:t}=this.viewModel.layer,s=e?.itemControl,i=null!=t&&("admin"===s||"update"===s);return H("calcite-button",{appearance:"outline",class:f.saveButton,disabled:!i,iconStart:"save",key:f.saveButton,onclick:()=>{this._handleSaveButtonClick()},label:this.messagesCommon.save,width:"full"},this.messagesCommon.save)}_renderSaveAsButton(){if(!this.visibleElements.saveAsButton)return null;const e=null==this.viewModel.layer.routeInfo;return H("div",{class:f.saveAsButtonPopover,key:f.saveAsButtonPopover},H("calcite-button",{afterCreate:e=>{this._saveAsButtonNode=e},appearance:"outline",class:f.saveAsButton,disabled:e,iconStart:"duplicate",key:f.saveAsButton,onclick:()=>this._handleSaveAsButtonClick(),label:this.messagesCommon.saveAs,width:"full"},this.messagesCommon.saveAs))}_renderSavePopover(){return H("calcite-popover",{label:this._saveLayer.label,open:this._saveLayer.opened,overlayPositioning:"fixed",referenceElement:this._saveAsButtonNode},this._saveLayer.render())}_handleSaveAsButtonClick(){this._saveLayer.opened?this._saveLayer.close():this._saveLayer.open(this.viewModel.layer)}_renderPrintButton(){return this.visibleElements.printButton?H("calcite-button",{appearance:"outline",class:f.printButton,iconStart:"print",key:f.printButton,label:this.messagesCommon.print}):null}_renderRouteLayerDetailsLink(){if(!this.visibleElements.layerDetails)return null;const{portalItem:e}=this.viewModel.layer;if(!e)return null;const{id:t,portal:{url:s}}=e,i=`${s}/home/item.html?id=${t}`;return H("calcite-link",{class:f.layerDetailsLink,href:i,key:f.layerDetailsLink,target:"_blank"},this.messages.viewLayerDetails)}_handleSaveButtonClick(){this.viewModel.layer.save()}_renderDirectionsContainer(){return H("div",{class:this.classes(f.directionsSection,f.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return H("div",{class:f.loader,key:"loader"})}_renderWarningCard(){return H("div",{class:f.warningCard,role:"alert"},H("div",{class:f.warningHeader},H("span",{class:f.warningIcon,"aria-hidden":"true"}),H(I,{class:f.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),H("div",{class:f.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{layer:e,state:t}=this.viewModel,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():null!=e.directionLines?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.summary,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):H("div",{key:"esri-directions__placeholder",class:f.emptyContent},this._renderPlaceholder(),H(I,{class:f.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return H("svg",{class:f.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},H("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return H(I,{class:f.messageHeading,level:this.headingLevel},e)}_renderRouteActions(){return H("div",{class:f.routeActions},H("button",{"aria-label":this.messages.clearRoute,class:this.classes(f.clearRouteButton,f.button,f.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_getSections(){const{layer:e}=this.viewModel;if(!e)return null;const{directionPoints:t,directionLines:s,stops:i}=e;if(null==t||null==s)return null;const o=[];let r=null;for(const n of t){const{objectId:e,stopId:t}=n;if(null!=t){const e=i.find((({objectId:e})=>e===t)),s=0===o.length;null!=r&&r.stop===e||(r={stop:e,directions:[],open:s},o.push(r));continue}if(null==r)continue;const a=s.find((({directionPointId:t})=>t===e));null!=a&&r.directions.push({directionPoint:n,directionLine:a})}return o}_renderManeuverSections(){return null==this._sections?null:H("div",{class:f.maneuvers,role:"group"},this._sections.map(((e,t)=>{const{open:s}=e;let i;e.directions.length>0&&s&&(i=H("ol",{class:f.maneuverList},e.directions.map((e=>this._renderManeuver(e)))));const o=this._sections.length>2,r=t===this._sections.length-1,n={[f.collapsibleSection]:o},a={[f.openIcon]:!s,[f.closeIcon]:s};let l;if(o&&!r){const t=s?this.messagesCommon.close:this.messagesCommon.open;l=H("header",{class:this.classes(f.maneuverSectionHeader,f.maneuverSectionToggle),key:f.maneuverSectionHeader},H("div",{"aria-expanded":s.toString(),"aria-label":t,bind:this,class:f.maneuverSectionHeaderButton,"data-maneuver-section":e,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:t},H(I,{class:f.maneuverSectionTitle,level:this.headingLevel},e.stop.name),H("span",{"aria-hidden":"true",class:this.classes(a)})))}else l=H("header",{class:f.maneuverSectionHeader,key:f.maneuverSectionHeader},H(I,{class:f.maneuverSectionTitle,level:this.headingLevel},e.stop.name));return H("section",{class:this.classes(f.maneuverSection,n),key:t},l,i)})))}_handleSectionToggle(e){const t=Y(e.currentTarget);t&&(t.open=!t.open)}_renderCosts(){const e=this._getCostSummary(),{directionPoints:t}=this.viewModel.layer;if(null==t||null==e)return null;const s=t.at(-1).arrivalTime,{distance:i,duration:o}=e,{eta:r,primaryCosts:n,secondaryCosts:a,zoomToRoute:l}=this.messages,c=x("short-time"),d=null!=s?`<strong>${E(s,c)}</strong> ${U(s)}`:"";return H("div",{"aria-label":l,bind:this,class:f.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:l},H("div",{class:f.costsDetails,role:"group"},H("div",{class:f.primaryCosts,title:n},o),H("div",{class:f.verticalSplitter}),H("div",{class:f.secondaryCosts,title:a},i)),H("div",{innerHTML:d,title:r}))}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.locationType??="street",T(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=C))}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_renderManeuver(e){const{directionPoint:t,directionLine:s}=e,{distance:i,duration:o}=s,{messages:r,messagesUnits:n,unit:a}=this,l=y(n,i??0,a),c=w(o??0),d=l&&c?`${l} · ${c}`:`${l}${c}`,u=this._getFormattedManeuverText(t),{objectId:h,directionPointType:p}=t,v=b(p),m=`esri-directions__maneuver-${h}`,_=`esri-directions__intermediate-costs-${h}`,g={[f.maneuverActive]:this._activeManeuver===s};return H("li",{"aria-labelledby":`${m} ${_}`,bind:this,class:this.classes(f.maneuver,g),"data-maneuver":s,key:s,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},null!=v&&H("img",{alt:"",class:f.maneuverIcon,src:v}),H("div",{class:f.maneuverCostsContainer},H("span",{id:m,innerHTML:u??""}),H("div",{class:f.maneuverCosts},H("div",{class:f.horizontalSplitter}),H("div",{"aria-hidden":"true",id:_,class:f.intermediateCost,innerHTML:d,title:r.intermediateCosts}))))}_handleManeuverClick(e){const t=J(e.currentTarget);if(!t)return;if(this._activeManeuver===t)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=t;const{geometry:s}=t;this.viewModel.centerAt(s),this.viewModel.highlight(t)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const t=J(e.currentTarget);t&&this.viewModel.highlight(t)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const t=J(e.currentTarget);t&&(this._focusedManeuver=t,this.viewModel.highlight(t))}_getFormattedManeuverText(e){const{displayText:t,name:s,intersectingName:i}=e;if(null==t)return"";let o=t;return null!=s&&o.includes(s)&&(o=o.replace(s,`<strong>${s}</strong>`)),null!=i&&o.includes(i)&&(o=o.replace(i,`<strong>${i}</strong>`)),o}_getCostSummary(){const{messagesUnits:e,unit:t,viewModel:s}=this,{routeInfo:i}=s.layer;if(null==i)return null;const o=i.totalDistance??0,r=i.totalDuration??0;return{distance:y(e,o,t),duration:w(r)}}async _getDirections(){const e=this.viewModel.layer?.stops.filter((({geometry:e})=>null!=e));if(e&&!(e.length<2))try{await this.viewModel.getDirections()}catch{}}};e([c()],V.prototype,"apiKey",null),e([c(h)],V.prototype,"defaultUnit",void 0),e([c()],V.prototype,"goToOverride",null),e([c()],V.prototype,"headingLevel",void 0),e([c()],V.prototype,"iconClass",void 0),e([c()],V.prototype,"icon",void 0),e([c()],V.prototype,"label",null),e([c({readOnly:!0})],V.prototype,"lastRoute",null),e([c()],V.prototype,"layer",null),e([c()],V.prototype,"maxStops",null),e([c(),B("esri/widgets/Directions/t9n/Directions")],V.prototype,"messages",void 0),e([c(),B("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([c(),B("esri/core/t9n/Units")],V.prototype,"messagesUnits",void 0),e([c()],V.prototype,"searchProperties",void 0),e([c()],V.prototype,"unit",null),e([c()],V.prototype,"view",null),e([c({type:g})],V.prototype,"viewModel",void 0),e([c()],V.prototype,"visibleElements",void 0),e([d("visibleElements")],V.prototype,"castVisibleElements",null),e([L()],V.prototype,"_handleStopIconClick",null),e([L()],V.prototype,"_handleClearRouteClick",null),e([L()],V.prototype,"_handleReverseStops",null),e([L()],V.prototype,"_handleRemoveStop",null),e([L()],V.prototype,"_handleSectionToggle",null),e([L()],V.prototype,"_handleSummaryInteraction",null),e([L()],V.prototype,"_handleManeuverClick",null),V=e([u("esri.widgets.Directions")],V);const W=V;function q(e){return e?.["data-mode"]}function G(e){return e?.["data-stop-index"]}function Y(e){return e?.["data-maneuver-section"]}function J(e){return e?.["data-maneuver"]}export{W as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import{on as t,pausable as s}from"../core/events.js";import{makeHandle as i}from"../core/handleUtils.js";import{assertIsSome as o}from"../core/maybe.js";import{watch as r,initial as n,when as a,on as l}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import{cast as d}from"../core/accessorSupport/decorators/cast.js";import"../core/arrayUtils.js";import"../core/has.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{defaultUnitPropertyMetadata as h}from"../properties/defaultUnit.js";import p from"../rest/support/Stop.js";import v from"../symbols/SimpleMarkerSymbol.js";import m from"./Search.js";import _ from"./Widget.js";import g from"./Directions/DirectionsViewModel.js";import{SaveLayer as S}from"./Directions/components/SaveLayer.js";import{formatDistance as y,formatDuration as w}from"./Directions/support/directionsUtils.js";import{DepartureTimeOption as M,CSS as f,getIconName as b}from"./Directions/support/resources.js";import{isArcGISWorldGeocoder as T,meteredArcGISLocatorUrl as C}from"./Search/support/locatorUtils.js";import{loadCalciteComponents as k}from"./support/componentsUtils.js";import D from"./support/DatePicker.js";import{Heading as I,incrementHeadingLevel as P}from"./support/Heading.js";import R from"./support/TimePicker.js";import{accessibleHandler as L}from"./support/decorators/accessibleHandler.js";import{messageBundle as B}from"./support/decorators/messageBundle.js";import{tsx as H}from"./support/jsxFactory.js";import"./support/widgetUtils.js";import E from"sortablejs";import{formatNumber as A}from"../intl/number.js";import{formatDate as j,convertDateFormatToIntlOptions as x}from"../intl/date.js";const O={departureTime:!0,layerDetails:!0,printButton:!1,saveAsButton:!0,saveButton:!0,stops:!0,traveMode:!0};function U(e){const t=e.getTimezoneOffset(),s=t>0?"-":"+",i=60,o=Math.abs(Math.floor(t/i)),r=Math.abs(Math.floor(t)%i),n={minimumIntegerDigits:2};return`GMT${s}${A(o,n)}${A(r,n)}`}function z(e){return!!e.composedPath?.().find((e=>e.classList?.contains("esri-search__suggestions-list")))}const $="search-term",F="date-time-picker",N=100,K=500;let V=class extends _{constructor(e,t){super(e,t),this._activeStop=null,this._activeManeuver=null,this._autoStopRemovalDelay=N,this._autoStopRemovalTimeoutId=void 0,this._departureTimeOption=M.NOW,this._datePicker=new D,this._focusedManeuver=null,this._newPlaceholderStop=null,this._pointerDownUpHandle=null,this._pointerPressedSearchSuggestionStop=null,this._renderSavePopoverFunction=null,this._saveAsButtonNode=null,this._saveLayer=new S,this._sections=null,this._sortable=null,this._stopsToSearches=new Map,this._timePicker=new R,this._viewClickHandle=null,this.headingLevel=2,this.iconClass=f.widgetIcon,this.icon=null,this.messages=null,this.messagesCommon=null,this.messagesUnits=null,this.searchProperties=null,this.viewModel=new g,this.visibleElements={...O},this._setUpDragAndDropStops=e=>{this._sortable=E.create(e,{draggable:`.${f.validStopRow}`,ghostClass:f.stopRowGhost,handle:`.${f.stopHandle}`,onEnd:this._handleStopInputDragEnd})},this._handleDragHandlePointerDown=()=>this.viewModel.layer?.stops.forEach((e=>this.acquireSearch(e).activeMenu="none")),this._handleStopInputDragEnd=({oldIndex:e,newIndex:t,target:s})=>{if(e===t||null==t||null==e)return;const{children:i}=s,o=i[t],r=i[e],n=t-e<0;s.insertBefore(o,n?r.nextElementSibling:r);const{stops:a}=this.viewModel.layer;a.reorder(a.at(e),t);for(const l of a)l.sequence=null;this._getDirections()}}initialize(){this.addHandles([r((()=>this.viewModel.layer?.routeInfo),(()=>{this._activeManeuver=null,this._focusedManeuver=null,this._sections=this._getSections(),this.scheduleRender()}),n),a((()=>this.view),((e,s)=>{if(s&&(this._viewClickHandle=null,null!=s&&this.removeHandles(s)),e){const s=this._prepPointerDownUpClick(),i=this._prepViewClick();s.pause(),i.pause();const o=e.surface;this.addHandles([t(o,"mousedown",(()=>this._autoStopRemovalDelay=K)),t(o,"mouseup",(()=>this._autoStopRemovalDelay=N)),s,i],e),this._pointerDownUpHandle=s,this._viewClickHandle=i}}),n),a((()=>null==this.viewModel.serviceDescription),(()=>{try{this.viewModel.load()}catch{}}),n),r((()=>this._saveLayer.state),(()=>{this.scheduleRender()}))]),this.when((()=>{this.destroyed||this.visibleElements.saveAsButton&&(this._renderSavePopoverFunction=this._renderSavePopover.bind(this),this._projector.append(document.body,this._renderSavePopoverFunction))}))}loadDependencies(){return k({button:()=>import("@esri/calcite-components/dist/components/calcite-button.js"),icon:()=>import("@esri/calcite-components/dist/components/calcite-icon.js"),link:()=>import("@esri/calcite-components/dist/components/calcite-link.js"),popover:()=>import("@esri/calcite-components/dist/components/calcite-popover.js")})}destroy(){this._datePicker.destroy(),this._timePicker.destroy();for(const e of this._stopsToSearches.values())e.destroy();this._sortable?.destroy(),null!=this._renderSavePopoverFunction&&this._projector.detach(this._renderSavePopoverFunction)}get apiKey(){return this.viewModel.apiKey}set apiKey(e){this.viewModel.apiKey=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get lastRoute(){return this.viewModel.lastRoute}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get maxStops(){return this.viewModel.maxStops}set maxStops(e){this.viewModel.maxStops=e}get unit(){return this.defaultUnit}set unit(e){this._overrideIfSome("unit",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...O,...e}}acquireSearch(e){const{view:t}=this.viewModel;if(this._stopsToSearches.has(e)){const s=this._stopsToSearches.get(e);return s.view=t,this._overrideDefaultSources(s),s}const s=new m({view:t,resultGraphicEnabled:!1,popupEnabled:!1,...this.searchProperties});return this._normalizeSearchSources(s),this.addHandles([l((()=>s.allSources),"change",(()=>this._normalizeSearchSources(s))),s.on("select-result",(()=>{e.geometry=s.selectedResult?.feature.geometry,e.name=s.selectedResult?.name,this._getDirections()})),s.on("search-focus",(()=>this._handleStopInputFocus(s,e))),s.on("search-blur",(()=>this._handleStopInputBlur(s,e))),s.on("search-clear",(()=>{e.geometry=null,e.name=null,this._activeStop=e,this.viewModel.layer?.removeResult()})),r((()=>s.searchTerm),(t=>{e.name=t}))],s),this._stopsToSearches.set(e,s),s}getDirections(){return this.viewModel.getDirections()}render(){return H("div",{class:this.classes(f.base,f.scroller)},this._renderPanelContent())}save(){return this.viewModel.save()}saveAs(e,t={}){return this.viewModel.saveAs(e,t)}zoomToRoute(){return this.viewModel.zoomToRoute()}_renderPanelContent(){const{layer:e,serviceDescription:t,state:s}=this.viewModel,i="initializing"===s,o="error"===s&&!t,r="unauthenticated"===s,n={[f.panelContentLoading]:i,[f.panelContentError]:o||!e,[f.panelContentSignIn]:r},a=i?"presentation":"group",l=e?r?this._renderSignIn():o?this._renderMessage(this._getErrorMessage()):i?this._renderLoader():this._renderReadyContent():this._renderMessage(this.messages.missingLayer);return H("div",{class:this.classes(f.panelContent,n),role:a},l)}_renderReadyContent(){return[this._renderStopsContainer(),this._renderTravelModeOptions(),this._renderDepartureTimeControls(),this._renderSaveContainer(),this._renderSectionSplitter(),this._renderDirectionsContainer()]}_renderSignIn(){return H("div",{key:"sign-in",class:f.signInContent},H(I,{class:f.contentTitle,level:this.headingLevel},this.messages.widgetLabel),this._renderPlaceholder(),H(I,{level:P(this.headingLevel)},this.messages.signInRequired),H("button",{class:this.classes(f.button,f.buttonSecondary,f.signInButton),tabIndex:0,onclick:this._handleSignInClick,bind:this,type:"button"},this.messagesCommon.auth.signIn))}_handleSignInClick(){this.viewModel.load().catch((()=>{}))}_renderTravelModeOptions(){if(!this.visibleElements.traveMode)return null;const{selectedTravelMode:e,travelModes:t}=this.viewModel;if(0===t.length)return null;const s=null!=e?e.name:this.messages.travelMode;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.travelMode,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__travel-mode-controls",role:"group"},H("select",{"aria-label":s,bind:this,class:this.classes(f.travelModeSelect,f.select),key:"esri-directions__travel-mode-options",onchange:this._handleTravelModeChange,title:s},t.map(((t,s)=>H("option",{key:`esri-directions__travel-mode-${s}`,"data-mode":t,selected:e===t,value:`${s}`},t.name)))))}_handleTravelModeChange(e){const t=e.currentTarget;this.viewModel.selectedTravelMode=q(t.item(t.selectedIndex)),this._getDirections()}_renderStopsContainer(){return this.visibleElements.stops?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.section,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__stops-container",role:"group"},this._renderStops()):null}_renderDepartureTimeControls(){if(!this.visibleElements.departureTime)return null;const{messages:{departAt:e,departureTime:t,leaveNow:s,timeUnspecified:i}}=this;return H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.departureTime,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__departure-time-controls",role:"group"},H("select",{"aria-label":t,bind:this,class:this.classes(f.departureTimeSelect,f.select),onchange:this._handleDepartureOptionChange,title:t},H("option",{value:M.NOW,selected:this._departureTimeOption===M.NOW},s),H("option",{value:M.DEPART_AT,selected:this._departureTimeOption===M.DEPART_AT},e),H("option",{value:M.UNSPECIFIED,selected:this._departureTimeOption===M.UNSPECIFIED},i)),this._departureTimeOption===M.DEPART_AT?this._renderTimeControls():null)}_renderStops(){const{stops:e}=this.viewModel.layer;let t=0;for(const o of this._stopsToSearches.keys())e.includes(o)||this._disposeSearch(o);for(const o of e){const e=this.acquireSearch(o);"none"!==e.activeMenu&&(t+=1),null!=o.name&&(e.searchTerm=o.name)}const s=e.toArray().map(((s,i)=>{const o=e.length,r=i>1&&null==s.geometry,n={[f.stopsIcon]:i>=0&&i<o-1,[f.lastStopIcon]:i===o-1},a={[f.lastStopIconContainer]:i===o-1},l={[f.validStopRow]:!r},c=e.at(i+1),d=c&&null!=c.geometry,u=i===o-1,h=i===o-2,p=2===o&&0===i||o>2&&!u&&!h||o>2&&h&&d||o>2&&u&&null==s.geometry,v=o<3,m=this.acquireSearch(s),{messages:_}=this,{removeStop:g,reverseStops:S,unlocated:y}=_,w=null!=s.geometry&&null!=s.name?s.name:y,M=A(i+1),b=`${_.stopLabel} ${M} (${w})`,T=`${this.id}__stop--${i}`,C=!!m.searchTerm&&!!m.selectedResult&&null!=s.geometry&&m.selectedResult.name===s.name,k={zIndex:"none"!==m.activeMenu?""+t--:""};return H("li",{"aria-label":b,afterCreate:this._handleStopFieldCreation,bind:this,class:this.classes(f.stopRow,l),id:T,key:i,"data-stop-index":i,styles:k},H("div",{class:f.stopHandle},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.handleIcon,f.stopHandleIcon,f.interactiveStopIcon),onpointerdown:this._handleDragHandlePointerDown}),H("div",{bind:this,"aria-labelledby":T,class:this.classes(f.stopIconContainer,a),"data-stop-index":i,onclick:this._handleStopIconClick,onkeydown:this._handleStopIconClick,role:"button"},H("span",{class:this.classes(f.stopIcon,n),tabindex:C?"0":null}))),H("div",{class:f.stopInput},m.render()),H("div",{class:f.stopOptions,role:"group"},H("div",{"aria-label":g,class:f.removeStopButton,bind:this,"data-stop-index":i,hidden:v,onkeydown:this._handleRemoveStop,onclick:this._handleRemoveStop,role:"button",tabIndex:0,title:g},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.removeStop,f.removeStopIcon,f.interactiveStopIcon)}),H("span",{class:f.screenReaderText},"removeStopTitle")),H("div",{"aria-label":S,class:f.reverseStops,bind:this,hidden:p,onkeydown:this._handleReverseStops,onclick:this._handleReverseStops,role:"button",tabIndex:0,title:S},H("span",{"aria-hidden":"true",class:this.classes(f.stopIcon,f.reverseStopIcon,f.interactiveStopIcon)}),H("span",{class:f.screenReaderText},"removeStopTitle"))))})),i=this._renderAddStop();return H("div",null,H("ol",{class:f.stops,role:"group",afterCreate:this._setUpDragAndDropStops},s),i)}_renderAddStop(){const e=this.viewModel.layer?.stops;if(!e)return null;const t=e.filter((({geometry:e})=>null!=e)),s=e.at(-1);return t.length>1&&t.length<this.maxStops&&null!=s&&null!=s.geometry?H("div",{class:f.toolbarSection},H("div",{class:f.toolbarButtons},H("calcite-button",{appearance:"outline",class:f.addStopButton,kind:"neutral",scale:"s",round:!0,iconStart:"plus",key:f.addStopButton,onclick:()=>{this._addNewPlaceholder()},label:this.messages.addStop,width:"full"},this.messages.addStop))):null}_handleStopIconClick(e){const t=G(e.currentTarget),s=null!=t?this.viewModel.layer?.stops.at(t):void 0;s?.geometry&&this._centerAtStop(s)}_handleClearRouteClick(){this.viewModel.reset()}_centerAtStop(e){this.viewModel.centerAt(e)}_handleStopFieldCreation(e){const t=this._newPlaceholderStop;if(!t)return;const s=G(e),i=null!=s?this.viewModel.layer?.stops.at(s):void 0;if(t===i){const e=this.acquireSearch(i);e.when((()=>{this.renderNow(),e.focus()}))}this._newPlaceholderStop=null}_handleStopInputBlur(e,t){if(this._saveLayer.opened)return;this.removeHandles($);if(!!e.selectedResult&&null!=t.geometry&&null!=e.selectedResult?.feature.geometry&&t.geometry===e.selectedResult?.feature.geometry)return void this._pointerDownUpHandle?.pause();const s=null==t.geometry&&null==e.selectedResult?.feature.geometry,i=null!=t.geometry&&null!=e.selectedResult?.feature.geometry&&t.geometry!==e.selectedResult?.feature.geometry;if((s||i)&&"none"===e.activeMenu&&e.searchTerm)return e.search(),void this._pointerDownUpHandle?.pause();e.searchTerm||(this._viewClickHandle?.resume(),clearTimeout(this._autoStopRemovalTimeoutId),this._autoStopRemovalTimeoutId=setTimeout((()=>{this.destroyed||(this._viewClickHandle?.pause(),"searching"!==e.viewModel.state?this._pointerPressedSearchSuggestionStop||(null!=t.geometry&&(t.geometry=null,this._getDirections()),this.scheduleRender()):this._pointerDownUpHandle?.pause())}),this._autoStopRemovalDelay))}_handleStopInputFocus(e,t){this._pointerDownUpHandle?.resume();const{view:s}=this;if(this.hasHandles($)||!s)return;const o=s.cursor;this.addHandles([i((()=>{s.cursor=o})),r((()=>e.searchTerm),(t=>{e.destroyed||(s.cursor=t.length?o:"copy")}),n)],$),this._activeStop=t}_prepViewClick(){const{view:e}=this.viewModel;o(e),o(e.surface);const t=s(e,"click",this._handleViewClick.bind(this)),i=s(e.surface,"click",(()=>{clearTimeout(this._autoStopRemovalTimeoutId),i.pause()}));return{remove(){i.remove(),t.remove()},pause(){i.pause(),t.pause()},resume(){i.resume(),t.resume()}}}_prepPointerDownUpClick(){const e=s(document,"pointerdown",(e=>{this._pointerPressedSearchSuggestionStop=z(e)?this._activeStop:null})),t=s(document,"pointerup",(e=>{this._pointerDownUpHandle?.pause();const t=z(e),s=this._activeStop;t||s!==this._pointerPressedSearchSuggestionStop||this._removeStop(s),this.scheduleRender(),this._pointerPressedSearchSuggestionStop=t?s:null}));return{remove(){t.remove(),e.remove()},pause(){t.pause(),e.pause()},resume(){e.resume()}}}_handleViewClick(e){e.stopPropagation();const t=this._activeStop,s=t?this._stopsToSearches.get(t):null;t&&s&&!s.searchTerm&&(s.search(e.mapPoint).then((e=>{const i=e?.results[0].results;if(!i)return;const{feature:o,name:r}=i[0];t.geometry=o.geometry,t.name=r,s.searchTerm=r})),this.scheduleRender()),this._viewClickHandle?.pause(),clearTimeout(this._autoStopRemovalTimeoutId)}_addNewPlaceholder(){if(this._pointerDownUpHandle?.pause(),this._newPlaceholderStop)return;const e=new p({symbol:new v});this.viewModel.layer?.stops.add(e),this._newPlaceholderStop=e}_handleReverseStops(){this._reverseStops()}_reverseStops(){const e=this.viewModel.layer?.stops??[];e.reverse();for(const t of e)t.sequence=null;this._getDirections()}_handleRemoveStop(e){const{layer:t}=this.viewModel;if(!t)return;const s=G(e.currentTarget);if(null==s)return;const{stops:i,routeInfo:o}=t,r=i.at(s);this._removeStop(r),null==r.geometry&&null!=o||this._getDirections()}_removeStop(e){const{stops:t}=this.viewModel.layer;!e||t.length<=2||(this._disposeSearch(e),t.remove(e))}_handleDepartureOptionChange(e){const t=e.currentTarget,s=t.item(t.selectedIndex);s.value===M.NOW?(this._departureTimeOption=M.NOW,this.viewModel.departureTime=M.NOW,this.removeHandles(F),this._getDirections()):s.value===M.DEPART_AT?(this._departureTimeOption=M.DEPART_AT,this.addHandles(r((()=>[this._datePicker.value,this._timePicker.value]),(()=>{this._updateDepartureTime(),this._getDirections()}),n),F)):(this._departureTimeOption=M.UNSPECIFIED,this.viewModel.departureTime=null,this._getDirections())}_updateDepartureTime(){const e=this._datePicker.value,t=this._timePicker.value;e&&t&&(this.viewModel.departureTime=new Date(e.getFullYear(),e.getMonth(),e.getDate(),t.getHours(),t.getMinutes()))}_renderTimeControls(){return H("div",{class:f.departureTimeControls,key:"esri-directions__time-controls",role:"group"},this._datePicker.render(),this._timePicker.render())}_renderSectionSplitter(){return H("div",{class:f.sectionSplitter})}_renderSaveContainer(){const{saveButton:e,saveAsButton:t,printButton:s,layerDetails:i}=this.visibleElements;return e||t||s||i?H("div",{class:f.saveSection,key:f.saveSection},this._renderSaveButtons(),this._renderRouteLayerDetailsLink()):null}_renderSaveButtons(){const{saveButton:e,saveAsButton:t,printButton:s}=this.visibleElements;return e||t||s?H("div",{class:f.saveButtons,key:f.saveButtons},this._renderSaveButton(),this._renderSaveAsButton(),this._renderPrintButton()):null}_renderSaveButton(){if(!this.visibleElements.saveButton)return null;const{portalItem:e,routeInfo:t}=this.viewModel.layer,s=e?.itemControl,i=null!=t&&("admin"===s||"update"===s);return H("calcite-button",{appearance:"outline",class:f.saveButton,disabled:!i,iconStart:"save",key:f.saveButton,onclick:()=>{this._handleSaveButtonClick()},label:this.messagesCommon.save,width:"full"},this.messagesCommon.save)}_renderSaveAsButton(){if(!this.visibleElements.saveAsButton)return null;const e=null==this.viewModel.layer.routeInfo;return H("div",{class:f.saveAsButtonPopover,key:f.saveAsButtonPopover},H("calcite-button",{afterCreate:e=>{this._saveAsButtonNode=e},appearance:"outline",class:f.saveAsButton,disabled:e,iconStart:"duplicate",key:f.saveAsButton,onclick:()=>this._handleSaveAsButtonClick(),label:this.messagesCommon.saveAs,width:"full"},this.messagesCommon.saveAs))}_renderSavePopover(){return H("calcite-popover",{label:this._saveLayer.label,open:this._saveLayer.opened,overlayPositioning:"fixed",referenceElement:this._saveAsButtonNode},this._saveLayer.render())}_handleSaveAsButtonClick(){this._saveLayer.opened?this._saveLayer.close():this._saveLayer.open(this.viewModel.layer)}_renderPrintButton(){return this.visibleElements.printButton?H("calcite-button",{appearance:"outline",class:f.printButton,iconStart:"print",key:f.printButton,label:this.messagesCommon.print}):null}_renderRouteLayerDetailsLink(){if(!this.visibleElements.layerDetails)return null;const{portalItem:e}=this.viewModel.layer;if(!e)return null;const{id:t,portal:{url:s}}=e,i=`${s}/home/item.html?id=${t}`;return H("calcite-link",{class:f.layerDetailsLink,href:i,key:f.layerDetailsLink,target:"_blank"},this.messages.viewLayerDetails)}_handleSaveButtonClick(){this.viewModel.layer.save()}_renderDirectionsContainer(){return H("div",{class:this.classes(f.directionsSection,f.section),key:"esri-directions__container"},this._renderDirectionsContainerContent())}_renderLoader(){return H("div",{class:f.loader,key:"loader"})}_renderWarningCard(){return H("div",{class:f.warningCard,role:"alert"},H("div",{class:f.warningHeader},H("span",{class:f.warningIcon,"aria-hidden":"true"}),H(I,{class:f.warningHeading,level:this.headingLevel},this.messagesCommon.warning)),H("div",{class:f.warningMessage},this._getErrorMessage()))}_renderDirectionsContainerContent(){const{layer:e,state:t}=this.viewModel,s="routing"===t;return"error"===t?this._renderWarningCard():s?this._renderLoader():null!=e.directionLines?H("div",{"aria-disabled":this._saveLayer.opened.toString(),class:this.classes(f.summary,this._saveLayer.opened&&f.buttonDisabled),key:"esri-directions__summary",role:"group"},this._renderCosts(),this._renderRouteActions(),this._renderManeuverSections()):H("div",{key:"esri-directions__placeholder",class:f.emptyContent},this._renderPlaceholder(),H(I,{class:f.message,level:this.headingLevel},this.messages.directionsPlaceholder))}_renderPlaceholder(){return H("svg",{class:f.emptyIllustration,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},H("path",{fill:"currentcolor",d:"M192 36c-15.477 0-24 6.034-24 16.99v45.822l24 24 24-24v-45.82C216 42.033 207.477 36 192 36zm20 61.155l-20 20-20-20V52.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM192 52a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zM92 140.99C92 130.035 83.477 124 68 124s-24 6.034-24 16.99v45.822l24 24 24-24zm-4 44.165l-20 20-20-20V140.99c0-8.62 6.73-12.99 20-12.99s20 4.37 20 12.99zM68 140a12 12 0 1 0 12 12 12.013 12.013 0 0 0-12-12zm0 20a8 8 0 1 1 8-8 8.008 8.008 0 0 1-8 8zm84-44h16v4h-16zm-24 80h4v12h-12v-4h8zm0-28h4v16h-4zm0-52h12v4h-8v8h-4zm0 24h4v16h-4zm-36 64h16v4H92z"}))}_renderMessage(e){return H(I,{class:f.messageHeading,level:this.headingLevel},e)}_renderRouteActions(){return H("div",{class:f.routeActions},H("button",{"aria-label":this.messages.clearRoute,class:this.classes(f.clearRouteButton,f.button,f.buttonTertiary),tabIndex:0,onclick:this._handleClearRouteClick,bind:this,type:"button"},this.messages.clearRoute))}_getSections(){const{layer:e}=this.viewModel;if(!e)return null;const{directionPoints:t,directionLines:s,stops:i}=e;if(null==t||null==s)return null;const o=[];let r=null;for(const n of t){const{objectId:e,stopId:t}=n;if(null!=t){const e=i.find((({objectId:e})=>e===t)),s=0===o.length;null!=r&&r.stop===e||(r={stop:e,directions:[],open:s},o.push(r));continue}if(null==r)continue;const a=s.find((({directionPointId:t})=>t===e));null!=a&&r.directions.push({directionPoint:n,directionLine:a})}return o}_renderManeuverSections(){return null==this._sections?null:H("div",{class:f.maneuvers,role:"group"},this._sections.map(((e,t)=>{const{open:s}=e;let i;e.directions.length>0&&s&&(i=H("ol",{class:f.maneuverList},e.directions.map((e=>this._renderManeuver(e)))));const o=this._sections.length>2,r=t===this._sections.length-1,n={[f.collapsibleSection]:o},a={[f.openIcon]:!s,[f.closeIcon]:s};let l;if(o&&!r){const t=s?this.messagesCommon.close:this.messagesCommon.open;l=H("header",{class:this.classes(f.maneuverSectionHeader,f.maneuverSectionToggle),key:f.maneuverSectionHeader},H("div",{"aria-expanded":s.toString(),"aria-label":t,bind:this,class:f.maneuverSectionHeaderButton,"data-maneuver-section":e,onkeydown:this._handleSectionToggle,onclick:this._handleSectionToggle,role:"button",tabIndex:0,title:t},H(I,{class:f.maneuverSectionTitle,level:this.headingLevel},e.stop.name),H("span",{"aria-hidden":"true",class:this.classes(a)})))}else l=H("header",{class:f.maneuverSectionHeader,key:f.maneuverSectionHeader},H(I,{class:f.maneuverSectionTitle,level:this.headingLevel},e.stop.name));return H("section",{class:this.classes(f.maneuverSection,n),key:t},l,i)})))}_handleSectionToggle(e){const t=Y(e.currentTarget);t&&(t.open=!t.open)}_renderCosts(){const e=this._getCostSummary(),{directionPoints:t}=this.viewModel.layer;if(null==t||null==e)return null;const{distance:s,duration:i}=e,{primaryCosts:o,secondaryCosts:r,zoomToRoute:n}=this.messages,a=this._renderEta();return H("div",{"aria-label":n,bind:this,class:f.directionCosts,onkeydown:this._handleSummaryInteraction,onclick:this._handleSummaryInteraction,role:"button",tabIndex:0,title:n},H("div",{class:f.costsDetails,role:"group"},H("div",{class:f.primaryCosts,title:o},i),H("div",{class:f.verticalSplitter}),H("div",{class:f.secondaryCosts,title:r},s)),a)}_renderEta(){const{directionPoints:e}=this.viewModel.layer,{eta:t}=this.messages;if(null==e)return null;const s=e.at(-1).arrivalTime,i=x("short-time");return s&&this._departureTimeOption!==M.UNSPECIFIED?H("div",{class:f.arrivalTimeContainer,title:t},H("span",{class:f.arrivalTime},j(s,i))," ",U(s)):null}_handleSummaryInteraction(){this._activeManeuver=null,this._focusedManeuver=null,this.viewModel.clearHighlights(),this.zoomToRoute()}_getErrorMessage(){switch(this.viewModel.lastError?.name){case"directions-view-model:unable-to-route":return this.messages.errors.unableToRoute;case"directions-view-model:service-metadata-unavailable":return this.messages.errors.unableToLoadServiceMetadata;default:return this.messages.errors.unknownError}}_normalizeSearchSources(e){this._overrideDefaultSources(e),this._applyLocatorSourceOverrides(e)}_overrideDefaultSources(e){e.viewModel.defaultSources.forEach((e=>{e.autoNavigate=!1}))}_applyLocatorSourceOverrides({allSources:e}){for(const t of e)"url"in t&&t.url&&(t.locationType??="street",T(t.url)&&this.apiKey&&null==t.apiKey&&(t.apiKey=this.apiKey,t.url=C))}_disposeSearch(e){if(!e||!this._stopsToSearches.has(e))return;const t=this._stopsToSearches.get(e);this.removeHandles(t),t.destroy(),this._stopsToSearches.delete(e)}_renderManeuver(e){const{directionPoint:t,directionLine:s}=e,{distance:i,duration:o}=s,{messages:r,messagesUnits:n,unit:a}=this,l=y(n,i??0,a),c=w(o??0),d=l&&c?`${l} · ${c}`:`${l}${c}`,u=this._getFormattedManeuverText(t),{objectId:h,directionPointType:p}=t,v=b(p),m=`esri-directions__maneuver-${h}`,_=`esri-directions__intermediate-costs-${h}`,g={[f.maneuverActive]:this._activeManeuver===s};return H("li",{"aria-labelledby":`${m} ${_}`,bind:this,class:this.classes(f.maneuver,g),"data-maneuver":s,key:s,onclick:this._handleManeuverClick,onkeydown:this._handleManeuverClick,onfocus:this._handleManeuverFocus,onmouseover:this._handleManeuverMouseOver,onmouseout:this._handleManeuverMouseOut,onblur:this._handleManeuverBlur,tabIndex:0},v&&H("calcite-icon",{alt:"",class:f.maneuverIcon,icon:v}),H("div",{class:f.maneuverCostsContainer},H("span",{id:m,innerHTML:u??""}),H("div",{class:f.maneuverCosts},H("div",{class:f.horizontalSplitter}),H("div",{"aria-hidden":"true",id:_,class:f.intermediateCost,innerHTML:d,title:r.intermediateCosts}))))}_handleManeuverClick(e){const t=J(e.currentTarget);if(!t)return;if(this._activeManeuver===t)return this._activeManeuver=null,void this.zoomToRoute();this._activeManeuver=t;const{geometry:s}=t;this.viewModel.centerAt(s),this.viewModel.highlight(t)}_handleManeuverMouseOver(e){if(this._activeManeuver||this._focusedManeuver)return;const t=J(e.currentTarget);t&&this.viewModel.highlight(t)}_handleManeuverMouseOut(){this._activeManeuver||this._focusedManeuver||this.viewModel.clearHighlights()}_handleManeuverBlur(){this._activeManeuver||(this._focusedManeuver=null,this.viewModel.clearHighlights())}_handleManeuverFocus(e){if(this._activeManeuver)return;const t=J(e.currentTarget);t&&(this._focusedManeuver=t,this.viewModel.highlight(t))}_getFormattedManeuverText(e){const{displayText:t,name:s,intersectingName:i}=e;if(null==t)return"";let o=t;return null!=s&&o.includes(s)&&(o=o.replace(s,`<strong>${s}</strong>`)),null!=i&&o.includes(i)&&(o=o.replace(i,`<strong>${i}</strong>`)),o}_getCostSummary(){const{messagesUnits:e,unit:t,viewModel:s}=this,{routeInfo:i}=s.layer;if(null==i)return null;const o=i.totalDistance??0,r=i.totalDuration??0;return{distance:y(e,o,t),duration:w(r)}}async _getDirections(){const e=this.viewModel.layer?.stops.filter((({geometry:e})=>null!=e));if(e&&!(e.length<2))try{await this.viewModel.getDirections()}catch{}}};e([c()],V.prototype,"apiKey",null),e([c(h)],V.prototype,"defaultUnit",void 0),e([c()],V.prototype,"goToOverride",null),e([c()],V.prototype,"headingLevel",void 0),e([c()],V.prototype,"iconClass",void 0),e([c()],V.prototype,"icon",void 0),e([c()],V.prototype,"label",null),e([c({readOnly:!0})],V.prototype,"lastRoute",null),e([c()],V.prototype,"layer",null),e([c()],V.prototype,"maxStops",null),e([c(),B("esri/widgets/Directions/t9n/Directions")],V.prototype,"messages",void 0),e([c(),B("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([c(),B("esri/core/t9n/Units")],V.prototype,"messagesUnits",void 0),e([c()],V.prototype,"searchProperties",void 0),e([c()],V.prototype,"unit",null),e([c()],V.prototype,"view",null),e([c({type:g})],V.prototype,"viewModel",void 0),e([c()],V.prototype,"visibleElements",void 0),e([d("visibleElements")],V.prototype,"castVisibleElements",null),e([L()],V.prototype,"_handleStopIconClick",null),e([L()],V.prototype,"_handleClearRouteClick",null),e([L()],V.prototype,"_handleReverseStops",null),e([L()],V.prototype,"_handleRemoveStop",null),e([L()],V.prototype,"_handleSectionToggle",null),e([L()],V.prototype,"_handleSummaryInteraction",null),e([L()],V.prototype,"_handleManeuverClick",null),V=e([u("esri.widgets.Directions")],V);const W=V;function q(e){return e?.["data-mode"]}function G(e){return e?.["data-stop-index"]}function Y(e){return e?.["data-maneuver-section"]}function J(e){return e?.["data-maneuver"]}export{W as default};
|