@arcgis/core 4.24.0-next.20220427 → 4.24.0-next.20220430
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/WebMap.js +1 -1
- package/analysis/LineOfSightAnalysis.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{3a43a2918b44781aaf85.js → 055a0ebf22a82f859474.js} +1 -1
- package/assets/esri/core/workers/chunks/{3273b6be43eeb49ee842.js → 0b12ff7b2ed2838afbb8.js} +1 -1
- package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +1 -0
- package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +1 -0
- package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +1 -0
- package/assets/esri/core/workers/chunks/{c388ac33496f004d56f3.js → 135a90ae61f3b3cae91b.js} +1 -1
- package/assets/esri/core/workers/chunks/{54f9b1ab9d472bf4baca.js → 1facbda248863cf72cbd.js} +1 -1
- package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +1 -0
- package/assets/esri/core/workers/chunks/2133499e642193f6738f.js +1 -0
- package/assets/esri/core/workers/chunks/{dee63bfc108b4e5893a3.js → 2cf3934b3ecabdf207c8.js} +1 -1
- package/assets/esri/core/workers/chunks/{3c572629f46e5093223c.js → 30333a95dc0a44e23fb5.js} +1 -1
- package/assets/esri/core/workers/chunks/{7afe89eafab00afb31f2.js → 30837d93116f0337972f.js} +1 -1
- package/assets/esri/core/workers/chunks/31df729c17470245288c.js +2 -0
- package/assets/esri/core/workers/chunks/{c0bf663240df7be68131.js.LICENSE.txt → 31df729c17470245288c.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/4130ea1f5a9f197168d7.js +1 -0
- package/assets/esri/core/workers/chunks/{417ee7a88575cb8f9aaf.js → 492b65fe99641f5740f0.js} +1 -1
- package/assets/esri/core/workers/chunks/4cdd29e1f3a1c7a39af7.js +1 -0
- package/assets/esri/core/workers/chunks/{9a0073d43b7dbaeba736.js → 541e644fc77dbe527124.js} +1 -1
- package/assets/esri/core/workers/chunks/{5a61a12b2492c6eae592.js → 59e341b2db44351bf557.js} +1 -1
- package/assets/esri/core/workers/chunks/{73630d52768e3d932f30.js → 5a10b58533b4116115ac.js} +1 -1
- package/assets/esri/core/workers/chunks/5fd787f63362defc984f.js +1 -0
- package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +1 -0
- package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +972 -0
- package/assets/esri/core/workers/chunks/{ab0c0c29d54f2ed954d6.js → 86b31ae136f931d7884a.js} +1 -1
- package/assets/esri/core/workers/chunks/{dc193247a1980360ec4f.js → 8e98ff9404a802352037.js} +1 -1
- package/assets/esri/core/workers/chunks/{863cfe35ee640bac103f.js → 94e51fe1c539df6257c2.js} +1 -1
- package/assets/esri/core/workers/chunks/{cbe7e6283a427a618d4b.js → 9519a02b9b8db88a3150.js} +1 -1
- package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +1 -0
- package/assets/esri/core/workers/chunks/{50d256bc3b213c8a1b09.js → a0ebf25c9c9a7f839b93.js} +1 -1
- package/assets/esri/core/workers/chunks/{d8a992dee594a6a64fde.js → a25f0a195f9217665530.js} +1 -1
- package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +1 -0
- package/assets/esri/core/workers/chunks/{92ef9b0c61640e0ecbb4.js → a5dbab94697757c87c49.js} +1 -1
- package/assets/esri/core/workers/chunks/{147d3ee9aa81d7b2b7fa.js → a6406a248b7b2ed65f35.js} +1 -1
- package/assets/esri/core/workers/chunks/{ebdf61eb364ac0856f40.js → acbd0f4d72d1f5d8e4e8.js} +1 -1
- package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +1 -0
- package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +1 -0
- package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +1 -0
- package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +1 -0
- package/assets/esri/core/workers/chunks/b97a34d2e7cceef1ac41.js +1 -0
- package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +1 -0
- package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +1 -0
- package/assets/esri/core/workers/chunks/{4a05d0dfa73ff570e1fa.js → d15e6662d90718411d62.js} +1 -1
- package/assets/esri/core/workers/chunks/{b74b9dceabbf7b1aec39.js → d16aac3461af9cee0c29.js} +1 -1
- package/assets/esri/core/workers/chunks/{bb678bc2e2fc48112e07.js → d60dd3e1028f714f2258.js} +1 -1
- package/assets/esri/core/workers/chunks/{31c1ae0532dd991da63d.js → d6c150c243ca1f6108f9.js} +1 -1
- package/assets/esri/core/workers/chunks/{cab6decfcb3f596a3837.js → d8c59b1d73650c060dfb.js} +1 -1
- package/assets/esri/core/workers/chunks/{d24339b37cc9316e6d99.js → dcb6e1b33402d7fa455b.js} +1 -1
- package/assets/esri/core/workers/chunks/{a8da24116180d708cf81.js → df653bca2b14dffc82d1.js} +1 -1
- package/assets/esri/core/workers/chunks/{a3db91d04fe1fca0fe4f.js → e06461703e6f1acfcfdc.js} +1 -1
- package/assets/esri/core/workers/chunks/{423e199c2f695e913c0e.js → e3e1d87b8532bf84a18d.js} +1 -1
- package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +1 -0
- package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +1 -0
- package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +1 -0
- package/assets/esri/core/workers/chunks/fc9b5f40c5179a8c90de.js +1 -0
- package/assets/esri/core/workers/chunks/fd35b69872ac9393924f.js +1 -0
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ar.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bg.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_bs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ca.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_cs.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_da.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_de.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_el.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_es.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_et.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_fr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_he.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_hu.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_id.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_it.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ja.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ko.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lt.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_lv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nb.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_nl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-BR.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_pt-PT.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ro.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_ru.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sl.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_sv.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_th.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_tr.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_uk.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_vi.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-CN.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-HK.json +1 -1
- package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_zh-TW.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ar.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bg.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_bs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ca.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_cs.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_da.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_de.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_el.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_es.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_et.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_fr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_he.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_hu.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_id.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_it.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ja.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ko.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lt.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_lv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nb.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_nl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-BR.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_pt-PT.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ro.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_ru.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sl.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_sv.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_th.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_tr.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_uk.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_vi.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-CN.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-HK.json +1 -1
- package/assets/esri/widgets/Weather/t9n/Weather_zh-TW.json +1 -1
- package/chunks/ColorMaterial.glsl.js +4 -4
- package/chunks/LineMarker.glsl.js +12 -12
- package/chunks/Pattern.glsl.js +17 -17
- package/chunks/RibbonLine.glsl.js +34 -34
- package/chunks/ShadedColorMaterial.glsl.js +11 -11
- package/chunks/index.js +1 -1
- package/chunks/sphere.js +1 -1
- package/config.js +1 -1
- package/core/workers/RemoteClient.js +1 -1
- package/core/workers/WorkerHandle.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +74 -20
- package/layers/mixins/PortalLayer.js +1 -1
- package/layers/support/LercDecoder.js +1 -1
- package/package.json +2 -2
- package/request.js +1 -1
- package/support/elevationInfoUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewSymbol2D.js +1 -1
- package/views/2d/engine/brushes.js +1 -1
- package/views/2d/engine/vectorTiles/TileParser.js +1 -1
- package/views/2d/engine/webgl/GraphicDisplayList.js +1 -1
- package/views/2d/engine/webgl/Painter.js +1 -1
- package/views/2d/engine/webgl/WGLRendererInfo.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLBrushDotDensity.js +5 -0
- package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +5 -0
- package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushFill.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLabel.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushLine.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushMarker.js +1 -1
- package/views/2d/engine/webgl/brushes/WGLGeometryBrushText.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/techniques/Technique.js +5 -0
- package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +5 -0
- package/views/2d/engine/webgl/techniques/heatmap/TechniqueHeatmap.js +5 -0
- package/views/2d/engine/webgl/techniques/utils.js +5 -0
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/support/AttributeStore.js +1 -1
- package/views/2d/layers/features/support/GraphicsReader.js +1 -1
- package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
- package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
- package/views/3d/analysis/Slice/SliceTool.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
- package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
- package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshWorkerHandle.js +1 -1
- package/views/3d/layers/I3SPointsWorkerHandle.js +1 -1
- package/views/3d/layers/PointCloudWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SElevationProvider.js +1 -1
- package/views/3d/layers/i3s/I3SNode.js +1 -1
- package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/support/PBFDecoder.js +1 -1
- package/views/3d/support/geometryUtils/sphere.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/tileUtils.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
- package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRangeRunLengthEncoded.js +1 -1
- package/views/3d/webgl-engine/lib/DrapedHeatmapRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeProcessingWorker.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeWorkerHandle.js +1 -1
- package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
- package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
- package/views/interactive/snapping/LineSnapper.js +1 -1
- package/views/interactive/snapping/ParallelLineSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleSnapper.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingManager.js +1 -1
- package/views/interactive/snapping/candidates/EdgeSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/FeatureSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/IntersectionSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/LineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/ParallelLineSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/RightAngleTriangleSnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/SnappingCandidate.js +1 -1
- package/views/interactive/snapping/candidates/VertexSnappingCandidate.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/SceneLayerSnappingSource.js +5 -0
- package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
- package/views/interactive/snapping/featureSources/queryEngineUtils.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +5 -0
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorkerHandle.js +5 -0
- package/views/interactive/snapping/hints/IntersectionSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/ParallelSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/PointSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/RightAngleSnappingHint.js +1 -1
- package/views/interactive/snapping/hints/SnappingHint.js +1 -1
- package/views/interactive/snapping/snappingUtils.js +1 -1
- package/views/support/colorUtils.js +1 -1
- package/webmap/Bookmark.js +1 -1
- package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
- package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +2 -2
- package/widgets/LineOfSight/LineOfSightViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Slice/SliceViewModel.js +1 -1
- package/widgets/support/AnalysisViewModel.js +1 -1
- package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/2266d6388444ac5d50b3.js +0 -1
- package/assets/esri/core/workers/chunks/3f6b17c9d2629ed396da.js +0 -1
- package/assets/esri/core/workers/chunks/404f1d7bce014c7e6965.js +0 -1
- package/assets/esri/core/workers/chunks/4e4994665549435f51ee.js +0 -1
- package/assets/esri/core/workers/chunks/503226c5c612feab4115.js +0 -1
- package/assets/esri/core/workers/chunks/528033aa0d663b4d41bf.js +0 -1
- package/assets/esri/core/workers/chunks/54af957c5330933805a3.js +0 -1
- package/assets/esri/core/workers/chunks/6ef8de3aa9a8d9c22161.js +0 -1
- package/assets/esri/core/workers/chunks/72d8b2ad36f0d0a40a0d.js +0 -1
- package/assets/esri/core/workers/chunks/756befc4aa3354e1db1d.js +0 -972
- package/assets/esri/core/workers/chunks/8a4e2831e8fdde530b21.js +0 -1
- package/assets/esri/core/workers/chunks/9b9821772b6cbe189fe0.js +0 -1
- package/assets/esri/core/workers/chunks/9c4d41f20c1a94147344.js +0 -1
- package/assets/esri/core/workers/chunks/9cfd66ee9e6328b3693a.js +0 -1
- package/assets/esri/core/workers/chunks/b548bf032c8af34fe155.js +0 -1
- package/assets/esri/core/workers/chunks/bbcae04235830debd814.js +0 -1
- package/assets/esri/core/workers/chunks/bc6f5927f07c5993b998.js +0 -1
- package/assets/esri/core/workers/chunks/c0bf663240df7be68131.js +0 -2
- package/assets/esri/core/workers/chunks/cd9668acbe3babd2b188.js +0 -1
- package/assets/esri/core/workers/chunks/d53c7a9ede56be749f2b.js +0 -1
- package/assets/esri/core/workers/chunks/e07930ab66f89d215666.js +0 -1
- package/assets/esri/core/workers/chunks/f72de828ede4d0c5e9d7.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[739,4889],{57435:(e,t,r)=>{r.d(t,{Z:()=>y});var s=r(43697),i=r(80539),o=r(3920),n=r(70586),l=(r(95330),r(26258),r(87538)),a=r(5600),u=(r(67676),r(80442),r(75215),r(52011));let p=class extends((0,o.p)(i.Z)){constructor(e){super(e),this.getCollections=null}initialize(){this.handles.add((0,l.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,n.pC)(this.getCollections)?this.getCollections():null;if((0,n.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,n.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,a.Cb)()],p.prototype,"getCollections",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,u.j)("esri.core.CollectionFlattener")],p);const y=p},42756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),i=(r(66577),r(80539)),o=r(57435),n=r(70586),l=r(16453),a=r(95330),u=r(17445),p=r(17452),y=r(5600),h=(r(67676),r(80442),r(75215)),d=r(71715),c=r(52011),f=r(30556),m=r(82971),g=r(29600),b=r(71612),v=r(38009),_=r(16859),C=r(34760),w=r(72965),S=r(21506),I=r(32448),x=r(96674),P=r(83379),F=r(19153),E=r(90578),k=r(68773),R=r(40330),G=(r(51773),r(3172)),T=r(22974),Z=r(60437),L=r(20322);r(91423),r(74889);const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(e){const t=e.folders||[],r=t.slice(),s=new Map,i=new Map,o=new Map,n=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:o,esriGeometryPolygon:n};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;s.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?z(i,l,e.featureSet.features):"esriGeometryPolyline"===r?z(o,l,e.featureSet.features):"esriGeometryPolygon"===r&&z(n,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((s=>{const i=function(e,t,r){const s=function(e,t){let r;return t.some((t=>t.id===e&&(r=t,!0))),r}(e,r);return s&&(s.parentFolderId=t,s.networkLink=s),s}(s,t.id,e.networkLinks);i&&r.push(i)}))})),r.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(s.get("esriGeometryPoint")),e.polylines=(0,T.d9)(s.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(s.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[O[t.type]].featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=U([e])}}));const u=U(r);return{folders:t,sublayers:r,extent:u}}function N(e,t,r,s){const i=R.id&&R.id.findCredential(e);e=(0,p.fl)(e,{token:i&&i.token});const o=k.Z.kmlServiceUrl;return(0,G.default)(o,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:s})}function M(e,t,r=null,s=[]){const i=[],o={},n=t.sublayers,l=t.folders.map((e=>e.id));return n.forEach((t=>{const n=new e;if(r?n.read(t,r):n.read(t),s.length&&l.includes(n.id)&&(n.visible=s.includes(n.id)),o[t.id]=n,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=o[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers.unshift(n)}else i.unshift(n)})),i}function z(e,t,r){r.forEach((r=>{e.set(r.attributes[t],r)}))}function U(e){const t=(0,Z.Ue)(Z.Gv),r=(0,Z.Ue)(Z.Gv);for(const s of e){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const e of s.polygons.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const e of s.polylines.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const e of s.points.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.mapImages)for(const e of s.mapImages)(0,L.Yg)(t,e.extent),(0,Z.TC)(r,t)}return(0,Z.fS)(r,Z.Gv)?null:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:m.Z.WGS84}}var D,q=r(6570);let H=D=class extends(I.Z.EventedMixin((0,x.eC)(P.Z))){constructor(){super(...arguments),this._sublayersHandles=null,this.description=null,this.id=null,this.networkLink=null,this.title=null,this.sourceJSON=null,this.fullExtent=null}initialize(){(0,u.N1)((()=>this.networkLink)).then((()=>(0,u.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=(0,n.pC)(e)?e.signal:null,r=this._fetchService(this._get("networkLink").href,t).then((e=>{const t=U(e.sublayers);this.fullExtent=q.Z.fromJSON(t),this.sourceJSON=e;const r=(0,h.se)(i.Z.ofType(D),M(D,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(r),Promise.resolve(this)}set sublayers(e){const t=this._get("sublayers");t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this._sublayersHandles.forEach((e=>e.remove())),this._sublayersHandles=null),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this._sublayersHandles=[e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))]),this._set("sublayers",e)}castSublayers(e){return(0,h.se)(i.Z.ofType(D),e)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}_fetchService(e,t){return N(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>j(e.data)))}};(0,s._)([(0,y.Cb)()],H.prototype,"description",void 0),(0,s._)([(0,y.Cb)()],H.prototype,"id",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,value:null})],H.prototype,"networkLink",void 0),(0,s._)([(0,y.Cb)({json:{write:{allowNull:!0}}})],H.prototype,"parent",void 0),(0,s._)([(0,y.Cb)({value:null,json:{write:{allowNull:!0}}})],H.prototype,"sublayers",null),(0,s._)([(0,E.p)("sublayers")],H.prototype,"castSublayers",null),(0,s._)([(0,y.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],H.prototype,"title",void 0),(0,s._)([(0,y.Cb)({value:!0})],H.prototype,"visible",null),(0,s._)([(0,d.r)("visible",["visibility"])],H.prototype,"readVisible",null),(0,s._)([(0,y.Cb)()],H.prototype,"sourceJSON",void 0),(0,s._)([(0,y.Cb)({value:null})],H.prototype,"layer",null),(0,s._)([(0,y.Cb)({type:q.Z})],H.prototype,"fullExtent",void 0),H=D=(0,s._)([(0,c.j)("esri.layers.support.KMLSublayer")],H);const J=H,W=["kml","xml"];let A=class extends((0,b.h)((0,C.Q)((0,w.M)((0,v.q)((0,_.I)((0,l.R)(g.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=m.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.own([(0,u.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),u.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return M(J,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],s=e.toArray();for(;s.length;){const e=s[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&s.push(...e.sublayers.toArray())),s.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,p.vt)(this.url,W)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=(0,n.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"]},e).catch(a.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=j((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:N(this.url,this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;(0,n.pC)(this.extent)&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const s of r.sublayers.items)t(s),s.visible&&s.fullExtent&&((0,n.pC)(e)?e.union(s.fullExtent):e=s.fullExtent.clone())};return t(this),e}};(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"allSublayers",void 0),(0,s._)([(0,y.Cb)({type:m.Z})],A.prototype,"outSpatialReference",void 0),(0,s._)([(0,y.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"legendEnabled",void 0),(0,s._)([(0,y.Cb)({type:["show","hide","hide-children"]})],A.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)({type:["KML"]})],A.prototype,"operationalLayerType",void 0),(0,s._)([(0,y.Cb)({})],A.prototype,"resourceInfo",void 0),(0,s._)([(0,y.Cb)({type:i.Z.ofType(J),json:{write:{ignoreOrigin:!0}}})],A.prototype,"sublayers",void 0),(0,s._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],A.prototype,"readSublayersFromItemOrWebMap",null),(0,s._)([(0,d.r)("service","sublayers",["sublayers"])],A.prototype,"readSublayers",null),(0,s._)([(0,f.c)("sublayers")],A.prototype,"writeSublayers",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],A.prototype,"type",void 0),(0,s._)([(0,y.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],A.prototype,"title",null),(0,s._)([(0,y.Cb)(S.HQ)],A.prototype,"url",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"visibleSublayers",null),(0,s._)([(0,y.Cb)({type:q.Z})],A.prototype,"extent",void 0),(0,s._)([(0,y.Cb)()],A.prototype,"fullExtent",null),A=(0,s._)([(0,c.j)("esri.layers.KMLLayer")],A);const Q=A},16859:(e,t,r)=>{r.d(t,{I:()=>_});var s=r(43697),i=r(40330),o=r(3172),n=r(66643),l=r(20102),a=r(92604),u=r(70586),p=r(95330),y=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),f=r(30556),m=r(65587),g=r(15235),b=r(86082);const v=a.Z.getLogger("esri.layers.mixins.PortalLayer"),_=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||v.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const l=i.id.findServerInfo(this.url);if(null==l||!l.owningSystemUrl)return null;const a=`${l.owningSystemUrl}/sharing/rest`,p=m.Z.getDefault();if(p&&p.loaded&&(0,y.Fv)(p.restUrl)===(0,y.Fv)(a))return p.user;const h=`${a}/community/self`,d=(0,u.pC)(e)?e.signal:null,c=await(0,n.q6)((0,o.default)(h,{authMode:"no-prompt",query:{f:"json"},signal:d}));return c.ok?b.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||m.Z.getDefault());return r&&s&&!(0,y.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save the scene, set the layer.portalItem to null or save the scene to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),o=r(95330),n=r(5600),l=(r(67676),r(80442),r(75215),r(52011)),a=r(80539),u=(r(26258),r(87538));const p=new a.Z,y=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let c=0,f=0;function m(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=y.get(r))?t:0)+5>=6e4*r.refreshInterval&&(y.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?y.get(r)||y.set(r,e):y.delete(r);if(t!==f){if(f=t,clearInterval(c),0===f)return void(c=0);c=setInterval(m,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){h(this)&&p.includes(this)&&p.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,n.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,n.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51706:(e,t,r)=>{var s,i;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?s.Expression:e.field&&"string"==typeof e.field?s.Field:s.Unknown}function a(e,t){const r=t||l(e),o=e.valueUnit||"unknown";return r===s.Unknown?i.Constant:e.stops?i.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?i.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?i.Proportional:i.Additive:i.Identity:i.RealWorldSize}r.d(t,{PS:()=>l,QW:()=>a,RY:()=>s,hL:()=>i,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(s||(s={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(i||(i={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_});var s,i=r(43697),o=r(66577),n=r(38171),l=r(35454),a=r(96674),u=r(22974),p=r(70586),y=r(5600),h=(r(75215),r(71715)),d=r(52011),c=r(30556),f=r(82971),m=r(33955),g=r(1231);const b=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const i=e[t],o=n.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;(0,p.pC)(o.geometry)&&!l&&(o.geometry.spatialReference=r);const a=i.aggregateGeometries,u=o.aggregateGeometries;if(a&&(0,p.pC)(u))for(const e in u){const t=u[e],s=a[e],i=null==s?void 0:s.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}s.push(o)}return s}writeGeometryType(e,t,r,s){if(e)return void b.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(e&&(0,p.pC)(e.geometry))return void b.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,m.im)(e);return!r&&t.spatialReference&&(s.spatialReference=f.Z.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e&&e[r];s.geometry=t&&t.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r,l=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&l(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(l[0]),i=r(l[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,m.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(i+=s[0],o+=s[1]):(i=s[0],o=s[1]),s[0]=t(i),s[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const s=e.points;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(i+=n[0],o+=n[1]):(i=n[0],o=n[1]),n[0]=t(i),n[1]=r(o)}}:void 0}};(0,i._)([(0,y.Cb)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,y.Cb)({type:[n.Z],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,h.r)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,y.Cb)({type:[g.Z],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,y.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:b.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,c.c)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,y.Cb)({types:o.qM,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,h.r)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,y.Cb)({type:f.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,c.c)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,y.Cb)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v}}]);
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[739,4889],{57435:(e,t,r)=>{r.d(t,{Z:()=>y});var s=r(43697),i=r(80539),o=r(3920),n=r(70586),l=(r(95330),r(26258),r(87538)),a=r(5600),u=(r(67676),r(80442),r(75215),r(52011));let p=class extends((0,o.p)(i.Z)){constructor(e){super(e),this.getCollections=null}initialize(){this.handles.add((0,l.EH)((()=>this._refresh())))}destroy(){this.getCollections=null}_refresh(){const e=(0,n.pC)(this.getCollections)?this.getCollections():null;if((0,n.Wi)(e))return void this.removeAll();let t=0;for(const r of e)(0,n.pC)(r)&&(t=this._processCollection(t,r));this.splice(t,this.length)}_createNewInstance(e){return new i.Z(e)}_processCollection(e,t){if(!t)return e;const r=this.itemFilterFunction?this.itemFilterFunction:e=>!!e;for(const s of t)if(s){if(r(s)){const t=this.indexOf(s,e);t>=0?t!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const t=this.getChildrenFunction(s);if(Array.isArray(t))for(const r of t)e=this._processCollection(e,r);else e=this._processCollection(e,t)}}return e}};(0,s._)([(0,a.Cb)()],p.prototype,"getCollections",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"getChildrenFunction",void 0),(0,s._)([(0,a.Cb)()],p.prototype,"itemFilterFunction",void 0),p=(0,s._)([(0,u.j)("esri.core.CollectionFlattener")],p);const y=p},42756:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Q});var s=r(43697),i=(r(66577),r(80539)),o=r(57435),n=r(70586),l=r(16453),a=r(95330),u=r(17445),p=r(17452),y=r(5600),h=(r(67676),r(80442),r(75215)),d=r(71715),c=r(52011),f=r(30556),m=r(82971),g=r(29600),b=r(71612),v=r(38009),_=r(16859),C=r(34760),w=r(72965),S=r(21506),I=r(32448),x=r(96674),P=r(83379),F=r(19153),E=r(90578),k=r(68773),R=r(40330),G=(r(51773),r(3172)),T=r(22974),Z=r(60437),L=r(20322);r(91423),r(74889);const O={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(e){const t=e.folders||[],r=t.slice(),s=new Map,i=new Map,o=new Map,n=new Map,l=new Map,a={esriGeometryPoint:i,esriGeometryPolyline:o,esriGeometryPolygon:n};(e.featureCollection&&e.featureCollection.layers||[]).forEach((e=>{const t=(0,T.d9)(e);t.featureSet.features=[];const r=e.featureSet.geometryType;s.set(r,t);const l=e.layerDefinition.objectIdField;"esriGeometryPoint"===r?z(i,l,e.featureSet.features):"esriGeometryPolyline"===r?z(o,l,e.featureSet.features):"esriGeometryPolygon"===r&&z(n,l,e.featureSet.features)})),e.groundOverlays&&e.groundOverlays.forEach((e=>{l.set(e.id,e)})),t.forEach((t=>{t.networkLinkIds.forEach((s=>{const i=function(e,t,r){const s=function(e,t){let r;return t.some((t=>t.id===e&&(r=t,!0))),r}(e,r);return s&&(s.parentFolderId=t,s.networkLink=s),s}(s,t.id,e.networkLinks);i&&r.push(i)}))})),r.forEach((e=>{if(e.featureInfos){e.points=(0,T.d9)(s.get("esriGeometryPoint")),e.polylines=(0,T.d9)(s.get("esriGeometryPolyline")),e.polygons=(0,T.d9)(s.get("esriGeometryPolygon")),e.mapImages=[];for(const t of e.featureInfos)switch(t.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const r=a[t.type].get(t.id);r&&e[O[t.type]].featureSet.features.push(r);break}case"GroundOverlay":{const r=l.get(t.id);r&&e.mapImages.push(r);break}}e.fullExtent=U([e])}}));const u=U(r);return{folders:t,sublayers:r,extent:u}}function N(e,t,r,s){const i=R.id&&R.id.findCredential(e);e=(0,p.fl)(e,{token:i&&i.token});const o=k.Z.kmlServiceUrl;return(0,G.default)(o,{query:{url:e,model:"simple",folders:"",refresh:0!==r||void 0,outSR:JSON.stringify(t)},responseType:"json",signal:s})}function M(e,t,r=null,s=[]){const i=[],o={},n=t.sublayers,l=t.folders.map((e=>e.id));return n.forEach((t=>{const n=new e;if(r?n.read(t,r):n.read(t),s.length&&l.includes(n.id)&&(n.visible=s.includes(n.id)),o[t.id]=n,null!=t.parentFolderId&&-1!==t.parentFolderId){const e=o[t.parentFolderId];e.sublayers||(e.sublayers=[]),e.sublayers.unshift(n)}else i.unshift(n)})),i}function z(e,t,r){r.forEach((r=>{e.set(r.attributes[t],r)}))}function U(e){const t=(0,Z.Ue)(Z.Gv),r=(0,Z.Ue)(Z.Gv);for(const s of e){if(s.polygons&&s.polygons.featureSet&&s.polygons.featureSet.features)for(const e of s.polygons.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.polylines&&s.polylines.featureSet&&s.polylines.featureSet.features)for(const e of s.polylines.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.points&&s.points.featureSet&&s.points.featureSet.features)for(const e of s.points.featureSet.features)(0,L.Yg)(t,e.geometry),(0,Z.TC)(r,t);if(s.mapImages)for(const e of s.mapImages)(0,L.Yg)(t,e.extent),(0,Z.TC)(r,t)}return(0,Z.fS)(r,Z.Gv)?null:{xmin:r[0],ymin:r[1],zmin:r[2],xmax:r[3],ymax:r[4],zmax:r[5],spatialReference:m.Z.WGS84}}var D,q=r(6570);let H=D=class extends(I.Z.EventedMixin((0,x.eC)(P.Z))){constructor(){super(...arguments),this._sublayersHandles=null,this.description=null,this.id=null,this.networkLink=null,this.title=null,this.sourceJSON=null,this.fullExtent=null}initialize(){(0,u.N1)((()=>this.networkLink)).then((()=>(0,u.N1)((()=>!0===this.visible)))).then((()=>this.load()))}load(e){if(!this.networkLink)return;if(this.networkLink.viewFormat)return;const t=(0,n.pC)(e)?e.signal:null,r=this._fetchService(this._get("networkLink").href,t).then((e=>{const t=U(e.sublayers);this.fullExtent=q.Z.fromJSON(t),this.sourceJSON=e;const r=(0,h.se)(i.Z.ofType(D),M(D,e));this.sublayers?this.sublayers.addMany(r):this.sublayers=r,this.layer.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")}));return this.addResolvingPromise(r),Promise.resolve(this)}set sublayers(e){const t=this._get("sublayers");t&&(t.forEach((e=>{e.parent=null,e.layer=null})),this._sublayersHandles.forEach((e=>e.remove())),this._sublayersHandles=null),e&&(e.forEach((e=>{e.parent=this,e.layer=this.layer})),this._sublayersHandles=[e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this.layer})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))]),this._set("sublayers",e)}castSublayers(e){return(0,h.se)(i.Z.ofType(D),e)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach((t=>t.layer=e))}_fetchService(e,t){return N(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then((e=>j(e.data)))}};(0,s._)([(0,y.Cb)()],H.prototype,"description",void 0),(0,s._)([(0,y.Cb)()],H.prototype,"id",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,value:null})],H.prototype,"networkLink",void 0),(0,s._)([(0,y.Cb)({json:{write:{allowNull:!0}}})],H.prototype,"parent",void 0),(0,s._)([(0,y.Cb)({value:null,json:{write:{allowNull:!0}}})],H.prototype,"sublayers",null),(0,s._)([(0,E.p)("sublayers")],H.prototype,"castSublayers",null),(0,s._)([(0,y.Cb)({value:null,json:{read:{source:"name",reader:e=>(0,F.Cb)(e)}}})],H.prototype,"title",void 0),(0,s._)([(0,y.Cb)({value:!0})],H.prototype,"visible",null),(0,s._)([(0,d.r)("visible",["visibility"])],H.prototype,"readVisible",null),(0,s._)([(0,y.Cb)()],H.prototype,"sourceJSON",void 0),(0,s._)([(0,y.Cb)({value:null})],H.prototype,"layer",null),(0,s._)([(0,y.Cb)({type:q.Z})],H.prototype,"fullExtent",void 0),H=D=(0,s._)([(0,c.j)("esri.layers.support.KMLSublayer")],H);const J=H,W=["kml","xml"];let A=class extends((0,b.h)((0,C.Q)((0,w.M)((0,v.q)((0,_.I)((0,l.R)(g.Z))))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new o.Z({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.outSpatialReference=m.Z.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.own([(0,u.YP)((()=>this.sublayers),((e,t)=>{t&&t.forEach((e=>{e.parent=null,e.layer=null})),e&&e.forEach((e=>{e.parent=this,e.layer=this}))}),u.Z_),this.on("sublayer-update",(()=>this.notifyChange("fullExtent")))])}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,r){return M(J,t,r,this._visibleFolders)}writeSublayers(e,t){const r=[],s=e.toArray();for(;s.length;){const e=s[0];e.networkLink||(e.visible&&r.push(e.id),e.sublayers&&s.push(...e.sublayers.toArray())),s.shift()}t.visibleFolders=r}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,p.vt)(this.url,W)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],r=e=>{e.visible&&(t.push(e),e.sublayers&&e.sublayers.forEach(r))};return e&&e.forEach(r),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=(0,n.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"]},e).catch(a.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=j((await Promise.resolve().then((()=>this.resourceInfo?{ssl:!1,data:this.resourceInfo}:N(this.url,this.outSpatialReference,this.refreshInterval,e)))).data);t&&this.read(t,{origin:"service"})}_recomputeFullExtent(){let e=null;(0,n.pC)(this.extent)&&(e=this.extent.clone());const t=r=>{if(r.sublayers)for(const s of r.sublayers.items)t(s),s.visible&&s.fullExtent&&((0,n.pC)(e)?e.union(s.fullExtent):e=s.fullExtent.clone())};return t(this),e}};(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"allSublayers",void 0),(0,s._)([(0,y.Cb)({type:m.Z})],A.prototype,"outSpatialReference",void 0),(0,s._)([(0,y.Cb)({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],A.prototype,"path",void 0),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"legendEnabled",void 0),(0,s._)([(0,y.Cb)({type:["show","hide","hide-children"]})],A.prototype,"listMode",void 0),(0,s._)([(0,y.Cb)({type:["KML"]})],A.prototype,"operationalLayerType",void 0),(0,s._)([(0,y.Cb)({})],A.prototype,"resourceInfo",void 0),(0,s._)([(0,y.Cb)({type:i.Z.ofType(J),json:{write:{ignoreOrigin:!0}}})],A.prototype,"sublayers",void 0),(0,s._)([(0,d.r)(["web-map","portal-item"],"sublayers",["visibleFolders"])],A.prototype,"readSublayersFromItemOrWebMap",null),(0,s._)([(0,d.r)("service","sublayers",["sublayers"])],A.prototype,"readSublayers",null),(0,s._)([(0,f.c)("sublayers")],A.prototype,"writeSublayers",null),(0,s._)([(0,y.Cb)({readOnly:!0,json:{read:!1}})],A.prototype,"type",void 0),(0,s._)([(0,y.Cb)({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],A.prototype,"title",null),(0,s._)([(0,y.Cb)(S.HQ)],A.prototype,"url",void 0),(0,s._)([(0,y.Cb)({readOnly:!0})],A.prototype,"visibleSublayers",null),(0,s._)([(0,y.Cb)({type:q.Z})],A.prototype,"extent",void 0),(0,s._)([(0,y.Cb)()],A.prototype,"fullExtent",null),A=(0,s._)([(0,c.j)("esri.layers.KMLLayer")],A);const Q=A},16859:(e,t,r)=>{r.d(t,{I:()=>_});var s=r(43697),i=r(40330),o=r(3172),n=r(66643),l=r(20102),a=r(92604),u=r(70586),p=r(95330),y=r(17452),h=r(5600),d=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),f=r(30556),m=r(65587),g=r(15235),b=r(86082);const v=a.Z.getLogger("esri.layers.mixins.PortalLayer"),_=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,p.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,p.D_)(e)||v.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,p.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=C.credential===t?C.user:await this._fetchEditingUser(e);return C.credential=t,C.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const l=i.id.findServerInfo(this.url);if(null==l||!l.owningSystemUrl)return null;const a=`${l.owningSystemUrl}/sharing/rest`,p=m.Z.getDefault();if(p&&p.loaded&&(0,y.Fv)(p.restUrl)===(0,y.Fv)(a))return p.user;const h=`${a}/community/self`,d=(0,u.pC)(e)?e.signal:null,c=await(0,n.q6)((0,o.default)(h,{authMode:"no-prompt",query:{f:"json"},signal:d}));return c.ok?b.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||m.Z.getDefault());return r&&s&&!(0,y.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new l.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,h.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,s._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,f.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,h.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,h.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},C={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>g});var s=r(43697),i=r(92604),o=r(95330),n=r(5600),l=(r(67676),r(80442),r(75215),r(52011)),a=r(80539),u=(r(26258),r(87538));const p=new a.Z,y=new WeakMap;function h(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function d(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:d(t,e%t):0}let c=0,f=0;function m(){const e=Date.now();for(const r of p)if(r.refreshInterval){var t;e-(null!=(t=y.get(r))?t:0)+5>=6e4*r.refreshInterval&&(y.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of p)t=d(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?y.get(r)||y.set(r,e):y.delete(r);if(t!==f){if(f=t,clearInterval(c),0===f)return void(c=0);c=setInterval(m,f)}}));const g=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){h(e)&&p.push(e)}(this)}),(()=>{}))}destroy(){h(this)&&p.includes(this)&&p.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,n.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,n.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,n.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,l.j)("esri.layers.mixins.RefreshableLayer")],t),t}},51706:(e,t,r)=>{var s,i;function o(e){return e&&"esri.renderers.visualVariables.SizeVariable"===e.declaredClass}function n(e){return null!=e&&!isNaN(e)&&isFinite(e)}function l(e){return e.valueExpression?s.Expression:e.field&&"string"==typeof e.field?s.Field:s.Unknown}function a(e,t){const r=t||l(e),o=e.valueUnit||"unknown";return r===s.Unknown?i.Constant:e.stops?i.Stops:null!=e.minSize&&null!=e.maxSize&&null!=e.minDataValue&&null!=e.maxDataValue?i.ClampedLinear:"unknown"===o?null!=e.minSize&&null!=e.minDataValue?e.minSize&&e.minDataValue?i.Proportional:i.Additive:i.Identity:i.RealWorldSize}r.d(t,{PS:()=>l,QW:()=>a,RY:()=>s,hL:()=>i,iY:()=>o,qh:()=>n}),function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"}(s||(s={})),function(e){e.Unknown="unknown",e.Stops="stops",e.ClampedLinear="clamped-linear",e.Proportional="proportional",e.Additive="additive",e.Constant="constant",e.Identity="identity",e.RealWorldSize="real-world-size"}(i||(i={}))},74889:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_});var s,i=r(43697),o=r(66577),n=r(38171),l=r(35454),a=r(96674),u=r(22974),p=r(70586),y=r(5600),h=(r(75215),r(71715)),d=r(52011),c=r(30556),f=r(82971),m=r(33955),g=r(1231);const b=new l.X({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let v=s=class extends a.wq{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){const r=f.Z.fromJSON(t.spatialReference),s=[];for(let t=0;t<e.length;t++){const i=e[t],o=n.Z.fromJSON(i),l=i.geometry&&i.geometry.spatialReference;(0,p.pC)(o.geometry)&&!l&&(o.geometry.spatialReference=r);const a=i.aggregateGeometries,u=o.aggregateGeometries;if(a&&(0,p.pC)(u))for(const e in u){const t=u[e],s=a[e],i=null==s?void 0:s.spatialReference;(0,p.pC)(t)&&!i&&(t.spatialReference=r)}s.push(o)}return s}writeGeometryType(e,t,r,s){if(e)return void b.write(e,t,r,s);const{features:i}=this;if(i)for(const e of i)if(e&&(0,p.pC)(e.geometry))return void b.write(e.geometry.type,t,r,s)}readQueryGeometry(e,t){if(!e)return null;const r=!!e.spatialReference,s=(0,m.im)(e);return!r&&t.spatialReference&&(s.spatialReference=f.Z.fromJSON(t.spatialReference)),s}writeSpatialReference(e,t){if(e)return void(t.spatialReference=e.toJSON());const{features:r}=this;if(r)for(const e of r)if(e&&(0,p.pC)(e.geometry)&&e.geometry.spatialReference)return void(t.spatialReference=e.geometry.spatialReference.toJSON())}clone(){return new s(this.cloneProperties())}cloneProperties(){return(0,u.d9)({displayFieldName:this.displayFieldName,exceededTransferLimit:this.exceededTransferLimit,features:this.features,fields:this.fields,geometryType:this.geometryType,hasM:this.hasM,hasZ:this.hasZ,queryGeometry:this.queryGeometry,spatialReference:this.spatialReference,transform:this.transform})}toJSON(e){const t=this.write();if(t.features&&Array.isArray(e)&&e.length>0)for(let r=0;r<t.features.length;r++){const s=t.features[r];if(s.geometry){const t=e&&e[r];s.geometry=t&&t.toJSON()||s.geometry}}return t}quantize(e){const{scale:[t,r],translate:[s,i]}=e,o=this.features,n=this._getQuantizationFunction(this.geometryType,(e=>Math.round((e-s)/t)),(e=>Math.round((i-e)/r)));for(let e=0,t=o.length;e<t;e++)n((0,p.Wg)(o[e].geometry))||(o.splice(e,1),e--,t--);return this.transform=e,this}unquantize(){const{geometryType:e,features:t,transform:r}=this;if(!r)return this;const{translate:[s,i],scale:[o,n]}=r,l=this._getHydrationFunction(e,(e=>e*o+s),(e=>i-e*n));for(const{geometry:e}of t)(0,p.pC)(e)&&l(e);return this.transform=null,this}_quantizePoints(e,t,r){let s,i;const o=[];for(let n=0,l=e.length;n<l;n++){const l=e[n];if(n>0){const e=t(l[0]),n=r(l[1]);e===s&&n===i||(o.push([e-s,n-i]),s=e,i=n)}else s=t(l[0]),i=r(l[1]),o.push([s,i])}return o.length>0?o:null}_getQuantizationFunction(e,t,r){return"point"===e?e=>(e.x=t(e.x),e.y=r(e.y),e):"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths,i=[];for(let e=0,o=s.length;e<o;e++){const o=s[e],n=this._quantizePoints(o,t,r);n&&i.push(n)}return i.length>0?((0,m.oU)(e)?e.rings=i:e.paths=i,e):null}:"multipoint"===e?e=>{const s=this._quantizePoints(e.points,t,r);return s.length>0?(e.points=s,e):null}:"extent"===e?e=>e:null}_getHydrationFunction(e,t,r){return"point"===e?e=>{e.x=t(e.x),e.y=r(e.y)}:"polyline"===e||"polygon"===e?e=>{const s=(0,m.oU)(e)?e.rings:e.paths;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];for(let e=0,s=n.length;e<s;e++){const s=n[e];e>0?(i+=s[0],o+=s[1]):(i=s[0],o=s[1]),s[0]=t(i),s[1]=r(o)}}}:"extent"===e?e=>{e.xmin=t(e.xmin),e.ymin=r(e.ymin),e.xmax=t(e.xmax),e.ymax=r(e.ymax)}:"multipoint"===e?e=>{const s=e.points;let i,o;for(let e=0,n=s.length;e<n;e++){const n=s[e];e>0?(i+=n[0],o+=n[1]):(i=n[0],o=n[1]),n[0]=t(i),n[1]=r(o)}}:void 0}};(0,i._)([(0,y.Cb)({type:String,json:{write:!0}})],v.prototype,"displayFieldName",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"exceededTransferLimit",void 0),(0,i._)([(0,y.Cb)({type:[n.Z],json:{write:!0}})],v.prototype,"features",void 0),(0,i._)([(0,h.r)("features")],v.prototype,"readFeatures",null),(0,i._)([(0,y.Cb)({type:[g.Z],json:{write:!0}})],v.prototype,"fields",void 0),(0,i._)([(0,y.Cb)({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:b.read}}})],v.prototype,"geometryType",void 0),(0,i._)([(0,c.c)("geometryType")],v.prototype,"writeGeometryType",null),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasM",void 0),(0,i._)([(0,y.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],v.prototype,"hasZ",void 0),(0,i._)([(0,y.Cb)({types:o.qM,json:{write:!0}})],v.prototype,"queryGeometry",void 0),(0,i._)([(0,h.r)("queryGeometry")],v.prototype,"readQueryGeometry",null),(0,i._)([(0,y.Cb)({type:f.Z,json:{write:!0}})],v.prototype,"spatialReference",void 0),(0,i._)([(0,c.c)("spatialReference")],v.prototype,"writeSpatialReference",null),(0,i._)([(0,y.Cb)({json:{write:!0}})],v.prototype,"transform",void 0),v=s=(0,i._)([(0,d.j)("esri.rest.support.FeatureSet")],v),v.prototype.toJSON.isDefaultToJSON=!0;const _=v}}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3723],{3723:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var s=r(43697),i=r(68773),o=r(3172),l=(r(78223),r(70586)),a=r(16453),n=r(95330),u=r(17452),h=r(5600),p=(r(67676),r(80442),r(75215),r(71715)),d=r(52011),y=r(6570),c=r(8744),m=r(29600),f=r(71612),v=r(38009),g=r(16859),b=r(34760),C=r(72965),_=r(21506),I=r(89164),S=r(4095),w=r(37898),P=r(77987),D=r(20256);const R=["atom","xml"],Z={base:I.Z,key:"type",typeMap:{"simple-line":S.Z},errorContext:"symbol"},E={base:I.Z,key:"type",typeMap:{"picture-marker":w.Z,"simple-marker":P.Z},errorContext:"symbol"},k={base:I.Z,key:"type",typeMap:{"simple-fill":D.Z},errorContext:"symbol"};let x=class extends((0,f.h)((0,b.Q)((0,v.q)((0,g.I)((0,C.M)((0,a.R)(m.Z))))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readFeatureCollections(e,t){return t.featureCollection.layers.forEach((e=>{var t;const r=e.layerDefinition.drawingInfo.renderer.symbol;r&&"esriSFS"===r.type&&null!=(t=r.outline)&&t.style.includes("esriSFS")&&(r.outline.style="esriSLSSolid")})),t.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,R)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const t=(0,l.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(n.r9).then((()=>this._fetchService(t))).then((e=>{this.read(e,{origin:"service"})}))),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var t;const r=this.spatialReference,{data:s}=await(0,o.default)(i.Z.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:(0,c.oR)(r)?void 0:null!=(t=r.wkid)?t:JSON.stringify(r)},signal:e});return s}_hasGeometry(e){var t,r;return null!=(t=null==(r=this.featureCollections)?void 0:r.some((t=>{var r,s;return(null==(r=t.featureSet)?void 0:r.geometryType)===e&&(null==(s=t.featureSet.features)?void 0:s.length)>0})))&&t}};(0,s._)([(0,h.Cb)()],x.prototype,"description",void 0),(0,s._)([(0,h.Cb)()],x.prototype,"featureCollections",void 0),(0,s._)([(0,p.r)("service","featureCollections",["featureCollection.layers"])],x.prototype,"readFeatureCollections",null),(0,s._)([(0,h.Cb)({type:y.Z,json:{name:"lookAtExtent"}})],x.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)(_.id)],x.prototype,"id",void 0),(0,s._)([(0,h.Cb)(_.rn)],x.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({types:Z,json:{write:!0}})],x.prototype,"lineSymbol",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],x.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({types:E,json:{write:!0}})],x.prototype,"pointSymbol",void 0),(0,s._)([(0,h.Cb)({types:k,json:{write:!0}})],x.prototype,"polygonSymbol",void 0),(0,s._)([(0,h.Cb)({type:["GeoRSS"]})],x.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)(_.HQ)],x.prototype,"url",void 0),(0,s._)([(0,h.Cb)({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],x.prototype,"title",null),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1},value:"geo-rss"})],x.prototype,"type",void 0),x=(0,s._)([(0,d.j)("esri.layers.GeoRSSLayer")],x);const F=x},16859:(e,t,r)=>{r.d(t,{I:()=>C});var s=r(43697),i=r(40330),o=r(3172),l=r(66643),a=r(20102),n=r(92604),u=r(70586),h=r(95330),p=r(17452),d=r(5600),y=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),m=r(30556),f=r(65587),v=r(15235),g=r(86082);const b=n.Z.getLogger("esri.layers.mixins.PortalLayer"),C=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,h.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,h.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const a=i.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,h=f.Z.getDefault();if(h&&h.loaded&&(0,p.Fv)(h.restUrl)===(0,p.Fv)(n))return h.user;const d=`${n}/community/self`,y=(0,u.pC)(e)?e.signal:null,c=await(0,l.q6)((0,o.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:y}));return c.ok?g.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[3723],{3723:(e,t,r)=>{r.r(t),r.d(t,{default:()=>F});var s=r(43697),i=r(68773),o=r(3172),l=(r(78223),r(70586)),a=r(16453),n=r(95330),u=r(17452),h=r(5600),p=(r(67676),r(80442),r(75215),r(71715)),d=r(52011),y=r(6570),c=r(8744),m=r(29600),f=r(71612),v=r(38009),g=r(16859),b=r(34760),C=r(72965),_=r(21506),I=r(89164),S=r(4095),w=r(37898),P=r(77987),D=r(20256);const R=["atom","xml"],Z={base:I.Z,key:"type",typeMap:{"simple-line":S.Z},errorContext:"symbol"},E={base:I.Z,key:"type",typeMap:{"picture-marker":w.Z,"simple-marker":P.Z},errorContext:"symbol"},k={base:I.Z,key:"type",typeMap:{"simple-fill":D.Z},errorContext:"symbol"};let x=class extends((0,f.h)((0,b.Q)((0,v.q)((0,g.I)((0,C.M)((0,a.R)(m.Z))))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readFeatureCollections(e,t){return t.featureCollection.layers.forEach((e=>{var t;const r=e.layerDefinition.drawingInfo.renderer.symbol;r&&"esriSFS"===r.type&&null!=(t=r.outline)&&t.style.includes("esriSFS")&&(r.outline.style="esriSLSSolid")})),t.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&"defaults"!==this.originOf("title")?e:this.url?(0,u.vt)(this.url,R)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const t=(0,l.pC)(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(n.r9).then((()=>this._fetchService(t))).then((e=>{this.read(e,{origin:"service"})}))),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var t;const r=this.spatialReference,{data:s}=await(0,o.default)(i.Z.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:(0,c.oR)(r)?void 0:null!=(t=r.wkid)?t:JSON.stringify(r)},signal:e});return s}_hasGeometry(e){var t,r;return null!=(t=null==(r=this.featureCollections)?void 0:r.some((t=>{var r,s;return(null==(r=t.featureSet)?void 0:r.geometryType)===e&&(null==(s=t.featureSet.features)?void 0:s.length)>0})))&&t}};(0,s._)([(0,h.Cb)()],x.prototype,"description",void 0),(0,s._)([(0,h.Cb)()],x.prototype,"featureCollections",void 0),(0,s._)([(0,p.r)("service","featureCollections",["featureCollection.layers"])],x.prototype,"readFeatureCollections",null),(0,s._)([(0,h.Cb)({type:y.Z,json:{name:"lookAtExtent"}})],x.prototype,"fullExtent",void 0),(0,s._)([(0,h.Cb)(_.id)],x.prototype,"id",void 0),(0,s._)([(0,h.Cb)(_.rn)],x.prototype,"legendEnabled",void 0),(0,s._)([(0,h.Cb)({types:Z,json:{write:!0}})],x.prototype,"lineSymbol",void 0),(0,s._)([(0,h.Cb)({type:["show","hide"]})],x.prototype,"listMode",void 0),(0,s._)([(0,h.Cb)({types:E,json:{write:!0}})],x.prototype,"pointSymbol",void 0),(0,s._)([(0,h.Cb)({types:k,json:{write:!0}})],x.prototype,"polygonSymbol",void 0),(0,s._)([(0,h.Cb)({type:["GeoRSS"]})],x.prototype,"operationalLayerType",void 0),(0,s._)([(0,h.Cb)(_.HQ)],x.prototype,"url",void 0),(0,s._)([(0,h.Cb)({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],x.prototype,"title",null),(0,s._)([(0,h.Cb)({readOnly:!0,json:{read:!1},value:"geo-rss"})],x.prototype,"type",void 0),x=(0,s._)([(0,d.j)("esri.layers.GeoRSSLayer")],x);const F=x},16859:(e,t,r)=>{r.d(t,{I:()=>C});var s=r(43697),i=r(40330),o=r(3172),l=r(66643),a=r(20102),n=r(92604),u=r(70586),h=r(95330),p=r(17452),d=r(5600),y=(r(67676),r(80442),r(75215),r(71715)),c=r(52011),m=r(30556),f=r(65587),v=r(15235),g=r(86082);const b=n.Z.getLogger("esri.layers.mixins.PortalLayer"),C=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new v.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const s=await r.e(8062).then(r.bind(r,18062));return(0,h.k_)(t),await s.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,h.D_)(e)||b.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,h.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==i.id?void 0:i.id.findCredential(this.url):null;if(!t)return!0;const r=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=r,(0,u.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const s=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(s)return s;const a=i.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,h=f.Z.getDefault();if(h&&h.loaded&&(0,p.Fv)(h.restUrl)===(0,p.Fv)(n))return h.user;const d=`${n}/community/self`,y=(0,u.pC)(e)?e.signal:null,c=await(0,l.q6)((0,o.default)(d,{authMode:"no-prompt",query:{f:"json"},signal:y}));return c.ok?g.default.fromJSON(c.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,s=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return r&&s&&!(0,p.tm)(s.restUrl,r.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,s._)([(0,d.Cb)({type:v.default})],t.prototype,"portalItem",null),(0,s._)([(0,y.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,s._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,s._)([(0,d.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,s._)([(0,d.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,s._)([(0,c.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},34760:(e,t,r)=>{r.d(t,{Q:()=>v});var s=r(43697),i=r(92604),o=r(95330),l=r(5600),a=(r(67676),r(80442),r(75215),r(52011)),n=r(80539),u=(r(26258),r(87538));const h=new n.Z,p=new WeakMap;function d(e){return e&&"object"==typeof e&&"refreshInterval"in e&&"refresh"in e}function y(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:y(t,e%t):0}let c=0,m=0;function f(){const e=Date.now();for(const r of h)if(r.refreshInterval){var t;e-(null!=(t=p.get(r))?t:0)+5>=6e4*r.refreshInterval&&(p.set(r,e),r.refresh(e))}}(0,u.EH)((()=>{const e=Date.now();let t=0;for(const r of h)t=y(Math.round(6e4*r.refreshInterval),t),r.refreshInterval?p.get(r)||p.set(r,e):p.delete(r);if(t!==m){if(m=t,clearInterval(c),0===m)return void(c=0);c=setInterval(f,m)}}));const v=e=>{let t=class extends e{constructor(...e){super(...e),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=(0,o.Ds)((()=>this.hasDataChanged())),this.when().then((()=>{!function(e){d(e)&&h.push(e)}(this)}),(()=>{}))}destroy(){d(this)&&h.includes(this)&&h.remove(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(e=Date.now()){(0,o.R8)(this._debounceHasDataChanged()).then((t=>{t&&this._set("refreshTimestamp",e),this.emit("refresh",{dataChanged:t})}),(e=>{i.Z.getLogger(this.declaredClass).error(e),this.emit("refresh",{dataChanged:!1,error:e})}))}async hasDataChanged(){return!0}};return(0,s._)([(0,l.Cb)({type:Number,cast:e=>e>=.1?e:e<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),(0,s._)([(0,l.Cb)({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),(0,s._)([(0,l.Cb)()],t.prototype,"refreshParameters",null),t=(0,s._)([(0,a.j)("esri.layers.mixins.RefreshableLayer")],t),t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1825],{88764:(e,t,s)=>{s.d(t,{q:()=>o});var i,r,n,a={exports:{}};i=a,r=function(){function e(s,i,r,n,a){for(;n>r;){if(n-r>600){var o=n-r+1,h=i-r+1,u=Math.log(o),l=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*l*(o-l)/o)*(h-o/2<0?-1:1);e(s,i,Math.max(r,Math.floor(i-h*l/o+c)),Math.min(n,Math.floor(i+(o-h)*l/o+c)),a)}var d=s[i],_=r,f=n;for(t(s,r,i),a(s[n],d)>0&&t(s,r,n);_<f;){for(t(s,_,f),_++,f--;a(s[_],d)<0;)_++;for(;a(s[f],d)>0;)f--}0===a(s[r],d)?t(s,r,f):t(s,++f,n),f<=i&&(r=f+1),i<=f&&(n=f-1)}}function t(e,t,s){var i=e[t];e[t]=e[s],e[s]=i}function s(e,t){return e<t?-1:e>t?1:0}return function(t,i,r,n,a){e(t,i,r||0,n||t.length-1,a||s)}},void 0!==(n=r())&&(i.exports=n);const o=a.exports},80539:(e,t,s)=>{s.d(t,{Z:()=>O});var i,r=s(43697),n=s(3894),a=s(32448),o=s(22974),h=s(70586),u=s(71143);!function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"}(i||(i={}));var l,c=s(1654),d=s(5600),_=s(75215),f=s(52421),p=s(52011),m=s(58971),g=s(39020);class y{constructor(){this._observers=[]}observe(e){return this._observers.includes(e)||this._observers.push(e),new g.X(this._observers,e)}notify(){const e=this._observers.slice();for(let t=0;t<e.length;++t){const s=e[t];s.onInvalidated(),s.onCommitted()}}}const E=new u.Z(class{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(e){this.defaultPrevented=!1,this.item=e}},void 0,(e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1})),I=()=>{};function b(e){return e?e instanceof F?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function S(e){if(e&&e.length)return e[0]}function T(e,t,s,i){const r=Math.min(e.length-s,t.length-i);let n=0;for(;n<r&&e[s+n]===t[i+n];)n++;return n}function R(e,t,s,i){t&&t.forEach(((t,r,n)=>{e.push(t),R(e,s.call(i,t,r,n),s,i)}))}const v=new Set,A=new Set,x=new Set,w=new Map;let C=0,F=l=class extends a.Z.EventedAccessor{constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new y,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:C++})}static isCollection(e){return null!=e&&e instanceof l}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof l?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return(0,m.it)(this._observable),this._items}set items(e){this._emitBeforeChanges(i.ADD)||(this._splice(0,this.length,b(e)),this._emitAfterChanges(i.ADD))}hasEventListener(e){return"change"===e?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if("change"===e){const e=this._chgListeners,s={removed:!1,callback:t};return e.push(s),this._notifications&&this._notifications.push({listeners:e.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=I,s.removed=!0,e.splice(e.indexOf(s),1)}}}return this._emitter.on(e,t)}once(e,t){const s=this.on(e,t);return{remove(){s.remove()}}}add(e,t){if((0,m.it)(this._observable),this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(null!=t?t:null);return this._splice(s,0,[e]),this._emitAfterChanges(i.ADD),this}addMany(e,t=this._items.length){if((0,m.it)(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(i.ADD))return this;const s=this.getNextIndex(t);return this._splice(s,0,b(e)),this._emitAfterChanges(i.ADD),this}at(e){if((0,m.it)(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if((0,m.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(i.REMOVE),e}clone(){return(0,m.it)(this._observable),this._createNewInstance({items:this._items.map(o.d9)})}concat(...e){(0,m.it)(this._observable);const t=e.map(b);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if((0,m.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const s=(0,h.j0)(this._splice(0,this.length)),r=s.length;for(let i=0;i<r;i++)e.call(t,s[i],i,s);this._emitAfterChanges(i.REMOVE)}every(e,t){return(0,m.it)(this._observable),this._items.every(e,t)}filter(e,t){let s;return(0,m.it)(this._observable),s=2===arguments.length?this._items.filter(e,t):this._items.filter(e),this._createNewInstance({items:s})}find(e,t){return(0,m.it)(this._observable),this._items.find(e,t)}findIndex(e,t){return(0,m.it)(this._observable),this._items.findIndex(e,t)}flatten(e,t){(0,m.it)(this._observable);const s=[];return R(s,this,e,t),new l(s)}forEach(e,t){return(0,m.it)(this._observable),this._items.forEach(e,t)}getItemAt(e){return(0,m.it)(this._observable),this._items[e]}getNextIndex(e){(0,m.it)(this._observable);const t=this.length;return(e=null==e?t:e)<0?e=0:e>t&&(e=t),e}includes(e,t=0){return(0,m.it)(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return(0,m.it)(this._observable),this._items.indexOf(e,t)}join(e=","){return(0,m.it)(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return(0,m.it)(this._observable),this._items.lastIndexOf(e,t)}map(e,t){(0,m.it)(this._observable);const s=this._items.map(e,t);return new l({items:s})}reorder(e,t=this.length-1){(0,m.it)(this._observable);const s=this.indexOf(e);if(-1!==s){if(t<0?t=0:t>=this.length&&(t=this.length-1),s!==t){if(this._emitBeforeChanges(i.MOVE))return e;this._splice(s,1),this._splice(t,0,[e]),this._emitAfterChanges(i.MOVE)}return e}}pop(){if((0,m.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=S(this._splice(this.length-1,1));return this._emitAfterChanges(i.REMOVE),e}push(...e){return(0,m.it)(this._observable),this._emitBeforeChanges(i.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(i.ADD)),this.length}reduce(e,t){(0,m.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduce(e,t):s.reduce(e)}reduceRight(e,t){(0,m.it)(this._observable);const s=this._items;return 2===arguments.length?s.reduceRight(e,t):s.reduceRight(e)}remove(e){return(0,m.it)(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if((0,m.it)(this._observable),e<0||e>=this.length||this._emitBeforeChanges(i.REMOVE))return;const t=S(this._splice(e,1));return this._emitAfterChanges(i.REMOVE),t}removeMany(e){if((0,m.it)(this._observable),!e||!e.length||this._emitBeforeChanges(i.REMOVE))return[];const t=e instanceof l?e.toArray():e,s=this._items,r=[],n=t.length;for(let e=0;e<n;e++){const i=t[e],n=s.indexOf(i);if(n>-1){const i=1+T(t,s,e+1,n+1),a=this._splice(n,i);a&&a.length>0&&r.push.apply(r,a),e+=i-1}}return this._emitAfterChanges(i.REMOVE),r}reverse(){if((0,m.it)(this._observable),this._emitBeforeChanges(i.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(i.MOVE),this}shift(){if((0,m.it)(this._observable),!this.length||this._emitBeforeChanges(i.REMOVE))return;const e=S(this._splice(0,1));return this._emitAfterChanges(i.REMOVE),e}slice(e=0,t=this.length){return(0,m.it)(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return(0,m.it)(this._observable),this._items.some(e,t)}sort(e){if((0,m.it)(this._observable),!this.length||this._emitBeforeChanges(i.MOVE))return this;const t=(0,h.j0)(this._splice(0,this.length));return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(i.MOVE),this}splice(e,t,...s){(0,m.it)(this._observable);const r=(t?i.REMOVE:0)|(s.length?i.ADD:0);if(this._emitBeforeChanges(r))return[];const n=this._splice(e,t,s)||[];return this._emitAfterChanges(r),n}toArray(){return(0,m.it)(this._observable),this._items.slice()}toJSON(){return(0,m.it)(this._observable),this.toArray()}toLocaleString(){return(0,m.it)(this._observable),this._items.toLocaleString()}toString(){return(0,m.it)(this._observable),this._items.toString()}unshift(...e){return(0,m.it)(this._observable),!e.length||this._emitBeforeChanges(i.ADD)||(this._splice(0,0,e),this._emitAfterChanges(i.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,s){const i=this._items,r=this.itemType;let n,a;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=(0,c.Os)((()=>this._dispatchChange()))),t){if(a=i.splice(e,t),this.hasEventListener("before-remove")){const t=E.acquire();t.target=this,t.cancellable=!0;for(let s=0,r=a.length;s<r;s++)n=a[s],t.reset(n),this.emit("before-remove",t),t.defaultPrevented&&(a.splice(s,1),i.splice(e,0,n),e+=1,s-=1,r-=1);E.release(t)}if(this.length=this._items.length,this.hasEventListener("after-remove")){const e=E.acquire();e.target=this,e.cancellable=!1;const t=a.length;for(let s=0;s<t;s++)e.reset(a[s]),this.emit("after-remove",e);E.release(e)}}if(s&&s.length){if(r){const e=[];for(const t of s){const s=r.ensureType(t);null==s&&null!=t||e.push(s)}s=e}const t=this.hasEventListener("before-add"),n=this.hasEventListener("after-add"),a=e===this.length;if(t||n){const r=E.acquire();r.target=this,r.cancellable=!0;const o=E.acquire();o.target=this,o.cancellable=!1;for(const h of s)t?(r.reset(h),this.emit("before-add",r),r.defaultPrevented||(a?i.push(h):i.splice(e++,0,h),this._set("length",i.length),n&&(o.reset(h),this.emit("after-add",o)))):(a?i.push(h):i.splice(e++,0,h),this._set("length",i.length),o.reset(h),this.emit("after-add",o));E.release(o),E.release(r)}else{if(a)for(const e of s)i.push(e);else i.splice(e,0,...s);this._set("length",i.length)}}return(s&&s.length||a&&a.length)&&this._notifyChangeEvent(s,a),a}_emitBeforeChanges(e){let t=!1;if(this.hasEventListener("before-changes")){const s=E.acquire();s.target=this,s.cancellable=!0,s.type=e,this.emit("before-changes",s),t=s.defaultPrevented,E.release(s)}return t}_emitAfterChanges(e){if(this.hasEventListener("after-changes")){const t=E.acquire();t.target=this,t.cancellable=!1,t.type=e,this.emit("after-changes",t),E.release(t)}this._observable.notify()}_notifyChangeEvent(e,t){this.hasEventListener("change")&&this._notifications&&this._notifications[this._notifications.length-1].changes.push({added:e,removed:t})}_dispatchChange(){if(this._timer&&(this._timer.remove(),this._timer=null),!this._notifications)return;const e=this._notifications;this._notifications=null;for(const t of e){const e=t.changes;v.clear(),A.clear(),x.clear();for(const{added:t,removed:s}of e){if(t)if(0===x.size&&0===A.size)for(const e of t)v.add(e);else for(const e of t)A.has(e)?(x.add(e),A.delete(e)):x.has(e)||v.add(e);if(s)if(0===x.size&&0===v.size)for(const e of s)A.add(e);else for(const e of s)v.has(e)?v.delete(e):(x.delete(e),A.add(e))}const s=n.Z.acquire();v.forEach((e=>{s.push(e)}));const i=n.Z.acquire();A.forEach((e=>{i.push(e)}));const r=this._items,a=t.items,o=n.Z.acquire();if(x.forEach((e=>{a.indexOf(e)!==r.indexOf(e)&&o.push(e)})),t.listeners&&(s.length||i.length||o.length)){const e={target:this,added:s,removed:i,moved:o},r=t.listeners.length;for(let s=0;s<r;s++){const i=t.listeners[s];i.removed||i.callback.call(this,e)}}n.Z.release(s),n.Z.release(i),n.Z.release(o)}v.clear(),A.clear(),x.clear()}};F.ofType=e=>{if(!e)return l;if(w.has(e))return w.get(e);let t=null;if("function"==typeof e)t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const s in e.typeMap){const i=e.typeMap[s].prototype.declaredClass;t?t+=` | ${i}`:t=i}let s=class extends l{};return(0,r._)([(0,f.c)({Type:e,ensureType:"function"==typeof e?(0,_.se)(e):(0,_.N7)(e)})],s.prototype,"itemType",void 0),s=(0,r._)([(0,p.j)(`esri.core.Collection<${t}>`)],s),w.set(e,s),s},(0,r._)([(0,d.Cb)()],F.prototype,"length",void 0),(0,r._)([(0,d.Cb)()],F.prototype,"items",null),F=l=(0,r._)([(0,p.j)("esri.core.Collection")],F);const O=F},32448:(e,t,s)=>{s.d(t,{Z:()=>h});var i=s(43697),r=s(15923),n=s(50758),a=s(52011);class o{constructor(){this._emitter=new o.EventEmitter(this)}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}}!function(e){class t{constructor(e=null){this.target=e,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(e,t){const s=this._listenersMap&&this._listenersMap.get(e);if(!s)return!1;const i=this.target||this;return[...s].forEach((e=>{e.call(i,t)})),s.length>0}on(e,t){if(Array.isArray(e)){const s=e.map((e=>this.on(e,t)));return(0,n.AL)(s)}if(e.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const s=this._listenersMap.get(e)||[];return s.push(t),this._listenersMap.set(e,s),{remove:()=>{const s=this._listenersMap&&this._listenersMap.get(e)||[],i=s.indexOf(t);i>=0&&s.splice(i,1)}}}once(e,t){const s=this.on(e,(e=>{s.remove(),t.call(null,e)}));return s}hasEventListener(e){const t=this._listenersMap&&this._listenersMap.get(e);return null!=t&&t.length>0}}e.EventEmitter=t,e.EventedMixin=e=>{let s=class extends e{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};return s=(0,i._)([(0,a.j)("esri.core.Evented")],s),s};let s=class extends r.Z{constructor(){super(...arguments),this._emitter=new o.EventEmitter(this)}destroy(){this._emitter.clear()}emit(e,t){return this._emitter.emit(e,t)}on(e,t){return this._emitter.on(e,t)}once(e,t){return this._emitter.once(e,t)}hasEventListener(e){return this._emitter.hasEventListener(e)}};s=(0,i._)([(0,a.j)("esri.core.Evented")],s),e.EventedAccessor=s}(o||(o={}));const h=o},61247:(e,t,s)=>{s.d(t,{Z:()=>l});var i=s(43697),r=s(15923),n=s(80539),a=s(70586),o=s(5600),h=s(52011);let u=class extends r.Z{constructor(e){super(e),this._groups=new Map}destroy(){this.removeAll()}get size(){let e=0;return this._groups.forEach((t=>{e+=t.length})),e}add(e,t){if(!this._isHandle(e)&&!Array.isArray(e)&&!n.Z.isCollection(e))return this;const s=this._getOrCreateGroup(t);return Array.isArray(e)||n.Z.isCollection(e)?e.forEach((e=>this._isHandle(e)&&s.push(e))):s.push(e),this.notifyChange("size"),this}forEach(e,t){if("function"==typeof e)this._groups.forEach((t=>t.forEach(e)));else{const s=this._getGroup(e);s&&t&&s.forEach(t)}}has(e){return this._groups.has(this._ensureGroupKey(e))}remove(e){if(Array.isArray(e)||n.Z.isCollection(e))return e.forEach(this.remove,this),this;if(!this.has(e))return this;const t=this._getGroup(e);for(let e=0;e<t.length;e++)t[e].remove();return this._deleteGroup(e),this.notifyChange("size"),this}removeAll(){return this._groups.forEach((e=>{for(let t=0;t<e.length;t++)e[t].remove()})),this._groups.clear(),this.notifyChange("size"),this}_isHandle(e){return e&&!!e.remove}_getOrCreateGroup(e){if(this.has(e))return this._getGroup(e);const t=[];return this._groups.set(this._ensureGroupKey(e),t),t}_getGroup(e){return(0,a.j0)(this._groups.get(this._ensureGroupKey(e)))}_deleteGroup(e){return this._groups.delete(this._ensureGroupKey(e))}_ensureGroupKey(e){return e||"_default_"}};(0,i._)([(0,o.Cb)({readOnly:!0})],u.prototype,"size",null),u=(0,i._)([(0,h.j)("esri.core.Handles")],u);const l=u},52421:(e,t,s)=>{function i(e){return(t,s)=>{t[s]=e}}s.d(t,{c:()=>i})},17445:(e,t,s)=>{s.d(t,{N1:()=>d,YP:()=>h,Z_:()=>p,gx:()=>u,nn:()=>m,on:()=>c,tX:()=>g});var i=s(91460),r=s(50758),n=s(70586),a=s(95330),o=s(26258);function h(e,t,s={}){return l(e,t,s,_)}function u(e,t,s={}){return l(e,t,s,f)}function l(e,t,s={},i){let r=null;const a=s.once?(e,s)=>{i(e)&&((0,n.hw)(r),t(e,s))}:(e,s)=>{i(e)&&t(e,s)};if(r=(0,o.aQ)(e,a,s.sync,s.equals),s.initial){const t=e();a(t,t)}return r}function c(e,t,s,a={}){let o=null,u=null,l=null;function c(){o&&u&&(u.remove(),null==a.onListenerRemove||a.onListenerRemove(o),o=null,u=null)}function d(e){a.once&&a.once&&(0,n.hw)(l),s(e)}const _=h(e,((e,s)=>{c(),(0,i.vT)(e)&&(o=e,u=(0,i.on)(e,t,d),null==a.onListenerAdd||a.onListenerAdd(e))}),{sync:a.sync,initial:!0});return l=(0,r.kB)((()=>{_.remove(),c()})),l}function d(e,t){return function(e,t,s){if((0,a.Hc)(s))return Promise.reject((0,a.zE)());const i=e();if(null!=t&&t(i))return Promise.resolve(i);let o=null;function h(){o=(0,n.hw)(o)}return new Promise(((i,n)=>{o=(0,r.AL)([(0,a.fu)(s,(()=>{h(),n((0,a.zE)())})),l(e,(e=>{h(),i(e)}),{sync:!1,once:!0},null!=t?t:_)])}))}(e,f,t)}function _(e){return!0}function f(e){return!!e}s(87538);const p={sync:!0},m={initial:!0},g={sync:!0,initial:!0}},60437:(e,t,s)=>{s.d(t,{Gv:()=>m,JR:()=>_,TC:()=>a,Tn:()=>l,Ue:()=>r,al:()=>n,cS:()=>d,dp:()=>h,fS:()=>p,op:()=>u,pp:()=>o,t8:()=>c});var i=s(70586);function r(e=g){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function n(e,t,s,i,n,a,o=r()){return o[0]=e,o[1]=t,o[2]=s,o[3]=i,o[4]=n,o[5]=a,o}function a(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function o(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function h(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function u(e,t,s=e){return s[0]=t[0],s[1]=t[1],s[2]=t[2],s!==e&&(s[3]=e[3],s[4]=e[4],s[5]=e[5]),s}function l(e,t,s=e){return s[3]=t[0],s[4]=t[1],s[5]=t[2],s!==e&&(s[0]=e[0],s[1]=e[1],s[2]=e[2]),e}function c(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function d(e){return e?c(e,m):r(m)}function _(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function f(e){return 6===e.length}function p(e,t,s){if((0,i.Wi)(e)||(0,i.Wi)(t))return e===t;if(!f(e)||!f(t))return!1;if(s){for(let i=0;i<e.length;i++)if(!s(e[i],t[i]))return!1}else for(let s=0;s<e.length;s++)if(e[s]!==t[s])return!1;return!0}s(6570),s(24470);const m=[1/0,1/0,1/0,-1/0,-1/0,-1/0],g=[0,0,0,0,0,0];r()},29730:(e,t,s)=>{s.d(t,{Y:()=>n});var i=s(70586);function r(e,t){return e?t?4:3:t?3:2}function n(e,t,s,n,h){if((0,i.Wi)(t)||!t.lengths.length)return null;const u="upperLeft"===(null==h?void 0:h.originPosition)?-1:1;e.lengths.length&&(e.lengths.length=0),e.coords.length&&(e.coords.length=0);const l=e.coords,c=[],d=s?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:_,coords:f}=t,p=r(s,n);let m=0;for(const e of _){const t=a(d,f,m,e,s,n,u);t&&c.push(t),m+=e*p}if(c.sort(((e,t)=>{let i=u*e[2]-u*t[2];return 0===i&&s&&(i=e[4]-t[4]),i})),c.length){let e=6*c[0][2];l[0]=c[0][0]/e,l[1]=c[0][1]/e,s&&(e=6*c[0][4],l[2]=0!==e?c[0][3]/e:0),(l[0]<d[0]||l[0]>d[1]||l[1]<d[2]||l[1]>d[3]||s&&(l[2]<d[4]||l[2]>d[5]))&&(l.length=0)}if(!l.length){const e=t.lengths[0]?o(f,0,_[0],s,n):null;if(!e)return null;l[0]=e[0],l[1]=e[1],s&&e.length>2&&(l[2]=e[2])}return e}function a(e,t,s,i,n,a,o=1){const h=r(n,a);let u=s,l=s+h,c=0,d=0,_=0,f=0,p=0;for(let s=0,r=i-1;s<r;s++,u+=h,l+=h){const s=t[u],i=t[u+1],r=t[u+2],a=t[l],o=t[l+1],h=t[l+2];let m=s*o-a*i;f+=m,c+=(s+a)*m,d+=(i+o)*m,n&&(m=s*h-a*r,_+=(r+h)*m,p+=m),s<e[0]&&(e[0]=s),s>e[1]&&(e[1]=s),i<e[2]&&(e[2]=i),i>e[3]&&(e[3]=i),n&&(r<e[4]&&(e[4]=r),r>e[5]&&(e[5]=r))}if(f*o>0&&(f*=-1),p*o>0&&(p*=-1),!f)return null;const m=[c,d,.5*f];return n&&(m[3]=_,m[4]=.5*p),m}function o(e,t,s,i,n){const a=r(i,n);let o=t,d=t+a,_=0,f=0,p=0,m=0;for(let t=0,r=s-1;t<r;t++,o+=a,d+=a){const t=e[o],s=e[o+1],r=e[o+2],n=e[d],a=e[d+1],g=e[d+2],y=i?u(t,s,r,n,a,g):h(t,s,n,a);if(y)if(_+=y,i){const e=c(t,s,r,n,a,g);f+=y*e[0],p+=y*e[1],m+=y*e[2]}else{const e=l(t,s,n,a);f+=y*e[0],p+=y*e[1]}}return _>0?i?[f/_,p/_,m/_]:[f/_,p/_]:s>0?i?[e[t],e[t+1],e[t+2]]:[e[t],e[t+1]]:null}function h(e,t,s,i){const r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}function u(e,t,s,i,r,n){const a=i-e,o=r-t,h=n-s;return Math.sqrt(a*a+o*o+h*h)}function l(e,t,s,i){return[e+.5*(s-e),t+.5*(i-t)]}function c(e,t,s,i,r,n){return[e+.5*(i-e),t+.5*(r-t),s+.5*(n-s)]}},41006:(e,t,s)=>{s.d(t,{q:()=>re});var i=s(20102),r=s(22974),n=s(70586),a=s(69801),o=s(67900),h=s(60437),u=s(24470),l=s(20322),c=s(33955),d=s(82526),_=s(8744),f=s(62432),p=s(37427),m=s(61159),g=s(98370),y=s(10402),E=s(17590),I=s(11490),b=s(99514),S=s(59266),T=s(43697),R=s(15923),v=s(61247),A=s(92604),x=s(54790),w=s(44553),C=s(95330),F=s(17445),O=s(76882),N=s(5600),k=(s(67676),s(80442),s(75215),s(52011));let L=class extends R.Z{constructor(){super(...arguments),this._tasks=new Array,this.running=!1}get length(){return this._tasks.length}destroy(){this.cancelAll()}runTask(e){for(;!e.done&&this._process(e);)e.madeProgress()}push(e,t,s){return this.running=!0,new Promise(((i,r)=>this._tasks.push(new P(i,r,e,t,s))))}unshift(e,t,s){return this.running=!0,new Promise(((i,r)=>this._tasks.unshift(new P(i,r,e,t,s))))}_process(e){if(0===this._tasks.length)return!1;const t=this._tasks.shift();try{const s=(0,C.Hc)(t.signal);if(s&&!t.abortCallback)t.reject((0,C.zE)());else{const i=s?t.abortCallback((0,C.zE)()):t.callback(e);(0,C.y8)(i)?i.then(t.resolve,t.reject):t.resolve(i)}}catch(e){t.reject(e)}return this.running=this._tasks.length>0,!0}cancelAll(){const e=(0,C.zE)();for(const t of this._tasks)if(t.abortCallback){const s=t.abortCallback(e);t.resolve(s)}else t.reject(e);this._tasks.length=0,this.running=!1}};(0,T._)([(0,N.Cb)()],L.prototype,"running",void 0),L=(0,T._)([(0,k.j)("esri.layers.support.PromiseQueue")],L);class P{constructor(e,t,s,i,r){this.resolve=e,this.reject=t,this.callback=s,this.signal=i,this.abortCallback=r}}let M=class extends R.Z{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,T._)([(0,N.Cb)()],M.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,T._)([(0,N.Cb)()],M.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),M=(0,T._)([(0,k.j)("esri.views.support.DebugFlags")],M);const Q=new M,G=A.Z.getLogger("esri.views.support.Scheduler");var U,D;(D=U||(U={})).RESOURCE_CONTROLLER="schedule",D.SLIDE="slide",D.STREAM_DATA_LOADER="stream loader",D.ELEVATION_QUERY="elevation query",D.TERRAIN_SURFACE="terrain",D.SURFACE_GEOMETRY_UPDATES="surface geometry updates",D.GRAPHICS_CORE="Graphics3D",D.I3S_CONTROLLER="I3S",D.POINT_CLOUD_LAYER="point cloud",D.FEATURE_TILE_FETCHER="feature fetcher",D.OVERLAY="overlay",D.STAGE="stage",D.GRAPHICS_DECONFLICTOR="graphics deconflictor",D.FILTER_VISIBILITY="Graphics3D filter visibility",D.SCALE_VISIBILITY="Graphics3D scale visibility",D.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",D.POINT_OF_INTEREST_FREQUENT="POI frequent",D.POINT_OF_INTEREST_INFREQUENT="POI infrequent",D.LABELER="labeler",D.FEATURE_QUERY_ENGINE="feature query",D.FEATURE_TILE_TREE="feature tile tree",D.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",D.ELEVATION_ALIGNMENT="elevation alignment",D.TEXT_TEXTURE_ATLAS="text texture atlas",D.TEXTURE_UNLOAD="texture unload",D.LINE_OF_SIGHT_TOOL="line of sight tool",D.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",D.ELEVATION_PROFILE="elevation profile",D.SNAPPING="snapping",D.SHADOW_ACCUMULATOR="shadow accumulator",D.CLOUDS_GENERATOR="cloud generator",D[D.TEST_PRIO=1]="TEST_PRIO";const B=new Map([[U.RESOURCE_CONTROLLER,0],[U.SLIDE,0],[U.STREAM_DATA_LOADER,0],[U.ELEVATION_QUERY,0],[U.TERRAIN_SURFACE,1],[U.SURFACE_GEOMETRY_UPDATES,1],[U.GRAPHICS_CORE,2],[U.I3S_CONTROLLER,2],[U.POINT_CLOUD_LAYER,2],[U.FEATURE_TILE_FETCHER,2],[U.OVERLAY,4],[U.STAGE,4],[U.GRAPHICS_DECONFLICTOR,4],[U.FILTER_VISIBILITY,4],[U.SCALE_VISIBILITY,4],[U.FRUSTUM_VISIBILITY,4],[U.POINT_OF_INTEREST_FREQUENT,6],[U.POINT_OF_INTEREST_INFREQUENT,30],[U.LABELER,8],[U.FEATURE_QUERY_ENGINE,8],[U.FEATURE_TILE_TREE,16],[U.FEATURE_TILE_TREE_ACTIVE,0],[U.ELEVATION_ALIGNMENT,12],[U.TEXT_TEXTURE_ATLAS,12],[U.CLOUDS_GENERATOR,12],[U.TEXTURE_UNLOAD,12],[U.LINE_OF_SIGHT_TOOL,16],[U.LINE_OF_SIGHT_TOOL_INTERACTIVE,0],[U.SNAPPING,0],[U.SHADOW_ACCUMULATOR,30]]);function V(e){return B.has(e)?B.get(e):"number"==typeof e?e:1}var q;!function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"}(q||(q={}));const Z=(0,O.HA)(6.5),H=(0,O.HA)(1),z=(0,O.HA)(30),j=(0,O.HA)(1e3/30),Y=(0,O.HA)(100);var W,X;!function(e){let t=class extends R.Z{constructor(e){super(e),this.updating=!0,this._microTaskQueued=!1,this.performanceInfo={total:new x.Z("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=null,this._state=q.INTERACTING,this._tasks=new w.Z,this._runQueue=new w.Z,this._load=0,this._idleStateCallbacks=new w.Z,this._idleUpdatesStartFired=!1,this._maxReschedule=K,this._forceTask=!1,this._debug=!1,this._debugHandle=(0,F.YP)((()=>Q.SCHEDULER_LOG_SLOW_TASKS),(e=>this._debug=e),F.nn),this._budget=new i(e.nowFunc);for(const e of Object.keys(U))this.performanceInfo.tasks.set(U[e],new x.Z(U[e]));let t;const s=this;this._test={get state(){return(0,n.Pt)(t,s._state)},set state(e){t=e},FRAME_SAFETY_BUDGET:Z,INTERACTING_BUDGET:j,IDLE_BUDGET:Y,get budget(){return s._budget.budget},usedBudget:0,setBudget:e=>s._budget=e,updateTask:e=>this._updateTask(e),getState:e=>this._getState(e),getRuntime:e=>this._getRuntime(e),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}destroy(){this._tasks.toArray().forEach((e=>e.remove())),this._tasks.clear(),(0,n.hw)(this._debugHandle),this._microTaskQueued=!1,this.updating=!1}activate(){this._budget.done||this._microTaskQueued||(this._microTaskQueued=!0,queueMicrotask((()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.done||(this._maxReschedule=K,this._schedule(),this.frame()))})))}registerTask(e,t){const i=V(e),r=new s(this,e,t,i);return this._tasks.push(r),this.performanceInfo.tasks.has(e)||this.performanceInfo.tasks.set(e,new x.Z(e)),r}registerIdleStateCallbacks(e,t){const s={idleBegin:e,idleEnd:t};this._idleStateCallbacks.push(s),this.state===q.IDLE&&this._idleUpdatesStartFired&&s.idleBegin();const i=this;return{remove:()=>this._removeIdleStateCallbacks(s),set idleBegin(e){i._idleUpdatesStartFired&&(s.idleEnd(),i._state===q.IDLE&&e()),s.idleBegin=e},set idleEnd(e){s.idleEnd=e}}}get now(){return this.nowFunc()}get load(){return this._load}set state(e){this._state!==e&&(this._state=e,this.state!==q.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll((e=>e.idleEnd()))))}get state(){return(0,n.Wi)(this._test.state)?this._state:this._test.state}updateBudget(e){this._test.usedBudget=0;let t=Z,s=e.frameDuration,i=H;switch(this.state){case q.IDLE:t=(0,O.HA)(0),s=(0,O.HA)(Math.max(Y,e.frameDuration)),i=z;break;case q.INTERACTING:s=(0,O.HA)(Math.max(j,e.frameDuration));case q.ANIMATING:}return s=(0,O.HA)(s-e.elapsedFrameTime-t),this.state!==q.IDLE&&s<H&&!this._forceTask?(this._forceTask=!0,!1):(s=(0,O.HA)(Math.max(s,i)),this._budget.reset(s,this.state),this._maxReschedule=K,this._updateLoad(),this._schedule())}frame(){switch(this._forceTask=!1,this._microTaskQueued=!1,this.state){case q.IDLE:this._idleUpdatesStartFired||(this._idleUpdatesStartFired=!0,this._idleStateCallbacks.forAll((e=>e.idleBegin()))),this._runIdle();break;case q.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset((0,O.HA)(0),this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(e){this._idleUpdatesStartFired&&e.idleEnd(),this._idleStateCallbacks.removeUnordered(e)}removeTask(e){this._tasks.removeUnordered(e),this._runQueue.removeUnordered(e)}_updateTask(e){this._tasks.forAll((t=>{t.name===e&&t.setPriority(e)}))}_getState(e){if(this._runQueue.some((t=>t.name===e)))return X.SCHEDULED;let t=X.IDLE;return this._tasks.forAll((s=>{s.name===e&&s.needsUpdate&&(s.schedulePriority<=1?t=X.READY:t!==X.READY&&(t=X.WAITING))})),t}_getRuntime(e){let t=0;return this._tasks.forAll((s=>{s.name===e&&(t+=s.runtime)})),t}_resetRuntimes(){this._tasks.forAll((e=>e.runtime=0))}_getRunning(){const e=new Map;if(this._tasks.forAll((t=>{t.needsUpdate&&e.set(t.name,(e.get(t.name)||0)+1)})),0===e.size)return null;let t="";return e.forEach(((e,s)=>{t+=e>1?` ${e}x ${s}`:` ${s}`})),t}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const e=this._tasks.reduce(((e,t)=>t.needsUpdate?++e:e),0);this._load=.9*this._load+e*(1-.9)}_schedule(){if(this._maxReschedule<=0)return!1;for(this._runQueue.filterInPlace((e=>!!e.needsUpdate||(e.schedulePriority=e.basePriority,!1))),this._tasks.forAll((e=>{0===e.basePriority&&e.needsUpdate&&!this._runQueue.includes(e)&&this._runQueue.unshift(e)}));0===this._runQueue.length;){let e=!1,t=0;if(this._tasks.forAll((s=>{s.needsUpdate&&0!==s.schedulePriority&&0!==s.basePriority&&(e=!0,t=Math.max(t,s.basePriority),1===s.schedulePriority?(s.schedulePriority=0,this._runQueue.push(s)):--s.schedulePriority)})),!e)return this.updating=!1,!1;this._maxReschedule===K&&(this._maxReschedule=t),--this._maxReschedule}return this.updating=!0,!0}_run(){const e=this._budget.now();this._startFrameTaskTimes();do{for(;this._runQueue.length>0;){const t=this._budget.now(),s=this._runQueue.pop();this._budget.resetProgress();try{s.task.runTask(this._budget)}catch(e){G.error(`Exception in task "${s.name}"`,e)}s.schedulePriority=s.basePriority;const i=this._budget.now()-t;if(s.runtime+=i,this._frameTaskTimes.set(s.priority,this._frameTaskTimes.get(s.priority)+i),this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",s.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this.updating=this._tasks.some((e=>e.needsUpdate)),void this._recordFrameTaskTimes(this._budget.now()-e)}}while(this._schedule());this.updating=this._tasks.some((e=>e.needsUpdate)),this._recordFrameTaskTimes(this._budget.now()-e)}_startFrameTaskTimes(){for(const e of Object.keys(U))this._frameTaskTimes.set(U[e],0)}_recordFrameTaskTimes(e){this._frameTaskTimes.forEach(((e,t)=>this.performanceInfo.tasks.get(t).record(e))),this.performanceInfo.total.record(e)}get test(){return this._test}};(0,T._)([(0,N.Cb)()],t.prototype,"updating",void 0),(0,T._)([(0,N.Cb)()],t.prototype,"nowFunc",void 0),t=(0,T._)([(0,k.j)("esri.views.support.Scheduler")],t),e.Scheduler=t;let s=class extends R.Z{constructor(e,t,s,i){super({}),this._scheduler=e,this.name=t,this._basePriority=i,this.runtime=0,this._queue=new L,this._handles=new v.Z,this.schedulePriority=this._basePriority,this.task=(0,n.pC)(s)?s:this._queue,this._handles.add((0,F.gx)((()=>this.task.running),(()=>e.activate())))}get updating(){return this._queue.running}normalizeCtorArgs(){return{}}remove(){this.processQueue(J),this._scheduler.removeTask(this),this.schedule=$.schedule,this.reschedule=$.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(e){this.name=e;const t=V(e);0!==this._basePriority&&0===this.schedulePriority||(this.schedulePriority=t),this._basePriority=t}get priority(){return this.name}set priority(e){this.setPriority(e)}get needsUpdate(){return this.updating||this.task.running}schedule(e,t,s){return this._queue.push(e,t,s)}reschedule(e,t,s){return this._queue.unshift(e,t,s)}processQueue(e){this._queue.runTask(e)}};(0,T._)([(0,N.Cb)({constructOnly:!0})],s.prototype,"task",void 0),(0,T._)([(0,N.Cb)({readOnly:!0})],s.prototype,"updating",null),s=(0,T._)([(0,k.j)("esri.views.support.SchedulerTask")],s);class i{constructor(e){this.now=e,this._begin=0,this._budget=0,this._state=q.IDLE,this._didWork=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&(this._didWork=!0),!0)}get done(){return this._didWork&&this.elapsed>=this._budget&&this._enabled}get budget(){return this._budget}madeProgress(){this._didWork=!0}get state(){return this._state}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e,t){this._begin=this.now(),this._budget=e,this._state=t,this._didWork=!1}get remaining(){return Math.max(this._budget-this.elapsed,0)}get elapsed(){return this.now()-this._begin}resetProgress(){this._didWork=!1}get hasProgressed(){return this._didWork}}e.Budget=i}(W||(W={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(X||(X={}));const J=(()=>{const e=new W.Budget((()=>performance.now()));return e.enabled=!1,e})(),$=new class{remove(){}processQueue(){}schedule(e,t,s){try{if((0,C.Hc)(t)){const e=(0,C.zE)();return s?Promise.resolve(s(e)):Promise.reject(e)}return(0,C.gx)(e(J))}catch(e){return Promise.reject(e)}}reschedule(e,t,s){return this.schedule(e,t,s)}},K=Number.MAX_SAFE_INTEGER,ee="feature-store:unsupported-query",te=new Set,se=new a.WJ(2e6);let ie=0;class re{constructor(e){this.capabilities={query:m.g},this.geometryType=e.geometryType,this.hasM=e.hasM,this.hasZ=e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",(()=>this.clearCache())),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new a.Xq(ie+++"$$",se)),this.fieldsIndex=new b.Z(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=(0,n.hw)(this._frameTask),this.clearCache(),(0,n.SC)(this._geometryQueryCache),this._changeHandle=(0,n.hw)(this._changeHandle),(0,n.SC)(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}get fullExtent(){const e=this.featureStore.fullBounds;return e?{xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:(0,I.S2)(this.spatialReference)}:null}get timeExtent(){return this.timeInfo?(this._timeExtent||(this._timeExtent=(0,E.R)(this.timeInfo,this.featureStore)),this._timeExtent):null}clearCache(){this._geometryQueryCache&&this._geometryQueryCache.clear(),this._allItems=null,this._timeExtent=null}async executeQuery(e={},t){let s,i=(0,r.d9)(e);try{i=await this._schedule((()=>(0,I.Up)(i,this.definitionExpression,this.spatialReference)),t),i=await this._reschedule((()=>this._checkQuerySupport(i)),t),s=await this._reschedule((()=>this._executeGeometryQuery(i,t)),t),s=await this._reschedule((()=>s.executeAggregateIdsQuery(i)),t),s=await this._reschedule((()=>s.executeObjectIdsQuery(i)),t),s=await this._reschedule((()=>s.executeTimeQuery(i)),t),s=await this._reschedule((()=>s.executeAttributesQuery(i)),t)}catch(e){if(e!==I.vF)throw e;s=new g.y([],null,this)}return s.createQueryResponse(i)}async executeQueryForCount(e={},t){let s=(0,r.d9)(e);s.returnGeometry=!1,s.returnCentroid=!1,s.outSR=null;try{s=await this._schedule((()=>(0,I.Up)(s,this.definitionExpression,this.spatialReference)),t),s=await this._reschedule((()=>this._checkQuerySupport(s)),t);let e=await this._reschedule((()=>this._executeGeometryQuery(s,t)),t);return e=await this._reschedule((()=>e.executeAggregateIdsQuery(s)),t),e=await this._reschedule((()=>e.executeObjectIdsQuery(s)),t),e=await this._reschedule((()=>e.executeTimeQuery(s)),t),e=await this._reschedule((()=>e.executeAttributesQuery(s)),t),e.createQueryResponseForCount(s)}catch(e){if(e!==I.vF)throw e;return 0}}async executeQueryForExtent(e={},t){let s,i=(0,r.d9)(e);const n=i.outSR;try{i=await this._schedule((()=>(0,I.Up)(i,this.definitionExpression,this.spatialReference)),t),i=await this._reschedule((()=>this._checkQuerySupport(i)),t),i.returnGeometry=!0,i.returnCentroid=!1,i.outSR=null,s=await this._reschedule((()=>this._executeGeometryQuery(i,t)),t),s=await this._reschedule((()=>s.executeAggregateIdsQuery(i)),t),s=await this._reschedule((()=>s.executeObjectIdsQuery(i)),t),s=await this._reschedule((()=>s.executeTimeQuery(i)),t),s=await this._reschedule((()=>s.executeAttributesQuery(i)),t);const e=s.size;if(!e)return{count:e,extent:null};(0,h.t8)(ae,h.Gv),this.featureStore.forEachBounds(s.items,(e=>(0,h.TC)(ae,e)),ne);const r={xmin:ae[0],ymin:ae[1],xmax:ae[3],ymax:ae[4],spatialReference:(0,I.S2)(this.spatialReference)};this.hasZ&&isFinite(ae[2])&&isFinite(ae[5])&&(r.zmin=ae[2],r.zmax=ae[5]);const a=(0,p.iV)(r,s.spatialReference,n);if(a.spatialReference=(0,I.S2)(n||this.spatialReference),a.xmax-a.xmin==0){const e=(0,o.c9)(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin==0){const e=(0,o.c9)(a.spatialReference);a.ymin-=e,a.ymax+=e}if(this.hasZ&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin==0){const e=(0,o.c9)(a.spatialReference);a.zmin-=e,a.zmax+=e}return{count:e,extent:a}}catch(e){if(e===I.vF)return{count:0,extent:null};throw e}}async executeQueryForIds(e={},t){return this.executeQueryForIdSet(e,t).then((e=>Array.from(e)))}async executeQueryForIdSet(e={},t){let s,i=(0,r.d9)(e);i.returnGeometry=!1,i.returnCentroid=!1,i.outSR=null;try{i=await this._schedule((()=>(0,I.Up)(i,this.definitionExpression,this.spatialReference)),t),i=await this._reschedule((()=>this._checkQuerySupport(i)),t),s=await this._reschedule((()=>this._executeGeometryQuery(i,t)),t),s=await this._reschedule((()=>s.executeAggregateIdsQuery(i)),t),s=await this._reschedule((()=>s.executeObjectIdsQuery(i)),t),s=await this._reschedule((()=>s.executeTimeQuery(i)),t),s=await this._reschedule((()=>s.executeAttributesQuery(i)),t);const e=s.items,r=new Set;return await this._reschedule((()=>{for(const t of e)r.add(s.featureAdapter.getObjectId(t))}),t),r}catch(e){if(e===I.vF)return new Set;throw e}}async executeQueryForSnapping(e,t){const{point:s,distance:i,types:r}=e;if(r===g.r.NONE)return{candidates:[]};const a=await this._reschedule((()=>this._checkQuerySupport(e.query)),t),o=!(0,_.fS)(s.spatialReference,this.spatialReference);o&&await(0,p._W)(s.spatialReference,this.spatialReference);const h="number"==typeof i?i:i.x,u="number"==typeof i?i:i.y,l={xmin:s.x-h,xmax:s.x+h,ymin:s.y-u,ymax:s.y+u,spatialReference:s.spatialReference},f=o?(0,p.iV)(l,this.spatialReference):l;if(!f)return{candidates:[]};const m=(await(0,d.aX)((0,c.im)(s),null,{signal:t}))[0],y=(await(0,d.aX)((0,c.im)(f),null,{signal:t}))[0];if((0,n.Wi)(m)||(0,n.Wi)(y))return{candidates:[]};let E=new g.y(this._searchFeatures(this._getQueryBBoxes(y.toJSON())),null,this);E=await this._reschedule((()=>E.executeObjectIdsQuery(a)),t),E=await this._reschedule((()=>E.executeTimeQuery(a)),t),E=await this._reschedule((()=>E.executeAttributesQuery(a)),t);const I=m.toJSON(),b=o?(0,p.iV)(I,this.spatialReference):I,S=o?Math.max(f.xmax-f.xmin,f.ymax-f.ymin)/2:i;return E.createSnappingResponse({...e,point:b,distance:S},s.spatialReference)}async executeQueryForLatestObservations(e={},t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new i.Z(ee,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});let s,n=(0,r.d9)(e);try{n=await this._schedule((()=>(0,I.Up)(n,this.definitionExpression,this.spatialReference)),t),n=await this._reschedule((()=>this._checkQuerySupport(n)),t),s=await this._reschedule((()=>this._executeGeometryQuery(n,t)),t),s=await this._reschedule((()=>s.executeAggregateIdsQuery(n)),t),s=await this._reschedule((()=>s.executeObjectIdsQuery(n)),t),s=await this._reschedule((()=>s.executeTimeQuery(n)),t),s=await this._reschedule((()=>s.executeAttributesQuery(n)),t),s=await this._reschedule((()=>s.filterLatest()),t)}catch(e){if(e!==I.vF)throw e;s=new g.y([],null,this)}return s.createQueryResponse(n)}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(e,t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,valueExpression:r}=t;return(await this._getQueryEngineResultForStats(e,{field:i,valueExpression:r},s)).createUniqueValuesResponse(e,t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(e,t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(e,t)}async _schedule(e,t){return(0,n.pC)(this._frameTask)?this._frameTask.schedule(e,t):e(J)}async _reschedule(e,t){return(0,n.pC)(this._frameTask)?this._frameTask.reschedule(e,t):e(J)}_getAll(){if(!this._allItems){const e=[];this.featureStore.forEach((t=>e.push(t))),this._allItems=new g.y(e,null,this)}return this._allItems}async _executeGeometryQuery(e,t){const{geometry:s,outSR:i,spatialRel:r,returnGeometry:a,returnCentroid:o}=e,h=this.featureStore.featureSpatialReference,u=s&&h&&h!==s.spatialReference?(0,p.iV)(s,h):s,l=a||o,c=(0,_.JY)(i)&&!(0,_.fS)(this.spatialReference,i),d=this._geometryQueryCache?c&&l?JSON.stringify({originalFilterGeometry:s,spatialRelationship:r,outSpatialReference:i}):JSON.stringify({originalFilterGeometry:s,spatialRelationship:r}):null;if(d){const e=this._geometryQueryCache.get(d);if(!(0,n.o8)(e))return e}const f=async e=>{if(c&&l){const t=await e.project(i);return d&&this._geometryQueryCache.put(d,t,t.size||1),t}return d&&this._geometryQueryCache.put(d,e,e.size||1),e};if(!u)return f(this._getAll());const m=this.featureAdapter;if("esriSpatialRelDisjoint"===r){const e=this._searchFeatures(this._getQueryBBoxes(s));if(!e.length)return f(this._getAll());let i,n;const a=new Set;for(const t of e)a.add(m.getObjectId(t));await this._reschedule((()=>{let e=0;i=new Array(a.size),this.featureStore.forEach((t=>i[e++]=t)),n=a}),t);const o=await this._reschedule((async()=>{const e=await(0,y.cW)(r,u,this.geometryType,this.hasZ,this.hasM);return new g.y(await this._runSpatialFilter(i,(t=>!n.has(m.getObjectId(t))||e(m.getGeometry(t))),t),s,this)}),t);return f(o)}const E=this._searchFeatures(this._getQueryBBoxes(s));if(!E.length){const e=new g.y([],s,this);return d&&this._geometryQueryCache.put(d,e,e.size||1),e}if(this._canExecuteSoloPass(u,e))return f(new g.y(E,s,this));const I=await(0,y.cW)(r,u,this.geometryType,this.hasZ,this.hasM),b=await this._runSpatialFilter(E,(e=>I(m.getGeometry(e))),t);return f(new g.y(b,s,this))}async _runSpatialFilter(e,t,s){if(!t)return e;if((0,n.Wi)(this._frameTask))return e.filter((e=>t(e)));let i=0;const r=new Array,a=async n=>{for(;i<e.length;){const o=e[i++];t(o)&&(r.push(o),n.madeProgress()),n.done&&await this._reschedule((e=>a(e)),s)}};return this._reschedule((e=>a(e)),s).then((()=>r))}_canExecuteSoloPass(e,t){const{geometryType:s}=this,{spatialRel:i}=t;return(0,y.hN)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===s&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i||"esriSpatialRelWithin"===i))}_getQueryBBoxes(e){if((0,y.hN)(e)){if((0,c.YX)(e))return[(0,u.al)(e.xmin,e.ymin,e.xmax,e.ymax)];if((0,c.oU)(e))return e.rings.map((e=>(0,u.al)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1]))))}return[(0,l.$P)((0,u.Ue)(),e)]}_searchFeatures(e){for(const t of e)this.featureStore.forEachInBounds(t,(e=>{te.add(e)}));const t=new Array(te.size);let s=0;return te.forEach((e=>t[s++]=e)),te.clear(),t}async _checkStatisticsSupport(e,t){if(e.distance<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new i.Z(ee,"Unsupported query options",{query:e});return Promise.all([this._checkAttributesQuerySupport(e),this._checkStatisticsParamsSupport(t),(0,y.P0)(e,this.geometryType,this.spatialReference),(0,p._W)(this.spatialReference,e.outSR)]).then((()=>e))}async _checkStatisticsParamsSupport(e){let t=[];if(e.valueExpression){const{arcadeUtils:s}=await(0,S.LC)();t=s.extractFieldNames(e.valueExpression)}if(e.field&&t.push(e.field),e.normalizationField&&t.push(e.normalizationField),!t.length)throw new i.Z(ee,"params should have at least a field or valueExpression",{params:e});(0,f.Of)(this.fieldsIndex,t,"params contains missing fields")}async _checkQuerySupport(e){if(e.distance<0||null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new i.Z(ee,"Unsupported query options",{query:e});return Promise.all([this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),(0,y.P0)(e,this.geometryType,this.spatialReference),(0,p._W)(this.spatialReference,e.outSR)]).then((()=>e))}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:r,outStatistics:n}=e,a=n?n.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(s&&s.length>0){const e=" asc",t=" desc",i=s.map((s=>{const i=s.toLowerCase();return i.includes(e)?i.split(e)[0]:i.includes(t)?i.split(t)[0]:s})).filter((e=>!a.includes(e)));(0,f.Of)(this.fieldsIndex,i,"orderByFields contains missing fields")}if(t&&t.length>0)(0,f.Of)(this.fieldsIndex,t,"outFields contains missing fields");else if(r)throw new i.Z(ee,"outFields should be specified for returnDistinctValues",{query:e});(0,f.hO)(this.fieldsIndex,e.where)}async _checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:r}=e,n=s&&s.length,a=t&&t.length;if(r){if(!n||!a)throw new i.Z(ee,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});(0,f.z4)(this.fieldsIndex,r,t)}if(a){if(!function(e){return e.every((e=>"exceedslimit"!==e.statisticType))}(t))return;const r=t.map((e=>e.onStatisticField)).filter(Boolean);(0,f.Of)(this.fieldsIndex,r,"onStatisticFields contains missing fields"),n&&(0,f.Of)(this.fieldsIndex,s,"groupByFieldsForStatistics contains missing fields");for(const s of t){const{onStatisticField:t,statisticType:r}=s;if("percentile_disc"!==r&&"percentile_cont"!==r||!("statisticParameters"in s)){if("count"!==r&&t&&(0,f.G3)(t,this.fieldsIndex))throw new i.Z(ee,"outStatistics contains non-numeric fields",{definition:s,query:e})}else{const{statisticParameters:t}=s;if(!t)throw new i.Z(ee,"statisticParamters should be set for percentile type",{definition:s,query:e})}}}}async _getQueryEngineResultForStats(e={},t,s){let i;e=(0,r.d9)(e);try{e=await this._schedule((()=>(0,I.Up)(e,this.definitionExpression,this.spatialReference)),s),e=await this._reschedule((()=>this._checkStatisticsSupport(e,t)),s),i=await this._reschedule((()=>this._executeGeometryQuery(e,s)),s),i=await this._reschedule((()=>i.executeAggregateIdsQuery(e)),s),i=await this._reschedule((()=>i.executeObjectIdsQuery(e)),s),i=await this._reschedule((()=>i.executeTimeQuery(e)),s),i=await this._reschedule((()=>i.executeAttributesQuery(e)),s)}catch(e){if(e!==I.vF)throw e;i=new g.y([],null,this)}return i}}const ne=(0,h.Ue)(),ae=(0,h.Ue)()},61159:(e,t,s)=>{s.d(t,{g:()=>i});const i={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCacheHint:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}},10402:(e,t,s)=>{s.d(t,{hN:()=>T,P0:()=>S,cW:()=>b});var i=s(20102),r=s(54102),n=s(87416),a=s(33955),o=s(8744);function h(e,t){return e?t?4:3:t?3:2}function u(e,t,s,i,r,n){const a=h(r,n),{coords:o,lengths:u}=i;if(!u)return!1;for(let i=0,r=0;i<u.length;i++,r+=a)if(!l(e,t,s,o[r],o[r+1]))return!1;return!0}function l(e,t,s,i,r){if(!e)return!1;const n=h(t,s),{coords:a,lengths:o}=e;let u=!1,l=0;for(const e of o)u=c(u,a,n,l,e,i,r),l+=e*n;return u}function c(e,t,s,i,r,n,a){let o=e,h=i;for(let e=i,u=i+r*s;e<u;e+=s){h=e+s,h===u&&(h=i);const r=t[e],l=t[e+1],c=t[h],d=t[h+1];(l<a&&d>=a||d<a&&l>=a)&&r+(a-l)/(d-l)*(c-r)<n&&(o=!o)}return o}var d=s(98732),_=s(5428),f=s(37427),p=s(11490);const m="feature-store:unsupported-query",g={esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"intersects",esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:null},y={esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},E={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},I={esriGeometryPoint:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1};function b(e,t,i,o,h){if((0,a.oU)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,d.Uy)(new _.Z,t,!1,!1);return Promise.resolve((t=>function(e,t,s,i){return l(e,!1,!1,i.coords[0],i.coords[1])}(e,0,0,t)))}if((0,a.oU)(t)&&"esriGeometryMultipoint"===i){const s=(0,d.Uy)(new _.Z,t,!1,!1);if("esriSpatialRelContains"===e)return Promise.resolve((e=>u(s,!1,!1,e,o,h)))}if((0,a.YX)(t)&&"esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return Promise.resolve((e=>(0,r.aV)(t,(0,p.Op)(i,o,h,e))));if((0,a.YX)(t)&&"esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return Promise.resolve((e=>(0,r.lQ)(t,(0,p.Op)(i,o,h,e))));if((0,a.YX)(t)&&"esriSpatialRelIntersects"===e){const e=function(e){return"mesh"===e?n.h_:(0,n.IY)(e)}(i);return Promise.resolve((s=>e(t,(0,p.Op)(i,o,h,s))))}return Promise.all([s.e(5837),s.e(247)]).then(s.bind(s,30247)).then((s=>{const r=s[g[e]].bind(null,t.spatialReference,t);return e=>r((0,p.Op)(i,o,h,e))}))}async function S(e,t,s){const{spatialRel:r,geometry:n}=e;if(n){if(!function(e){return!0===y[e]}(r))throw new i.Z(m,"Unsupported query spatial relationship",{query:e});if((0,o.JY)(n.spatialReference)&&(0,o.JY)(s)){if(!function(e){return!0===E[(0,a.Ji)(e)]}(n))throw new i.Z(m,"Unsupported query geometry type",{query:e});if(!function(e){return!0===I[e]}(t))throw new i.Z(m,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,f._W)(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function T(e){if((0,a.YX)(e))return!0;if((0,a.oU)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},99514:(e,t,s)=>{s.d(t,{Z:()=>a});var i=s(35671);function r(e){return"oid"===e.type||"esriFieldTypeOID"===e.type}function n(e){return"global-id"===e.type||"esriFieldTypeGlobalID"===e.type}class a{constructor(e){if(this.fields=e,this._fieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!e)return;const t=[];for(const a of e){const e=a&&a.name;if(e){const h=o(e);this._fieldsMap.set(e,a),this._fieldsMap.set(h,a),t.push(h),"date"===(s=a).type||"esriFieldTypeDate"===s.type?(this.dateFields.push(a),this._dateFieldsSet.add(a)):(0,i.H7)(a)&&(this._numericFieldsSet.add(a),this.numericFields.push(a)),r(a)||n(a)||(a.editable=null==a.editable||!!a.editable,a.nullable=null==a.nullable||!!a.nullable)}}var s;t.sort(),this.uid=t.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)r(e)||n(e)||e.nullable||void 0!==(0,i.os)(e)||this._requiredFields.push(e)}return this._requiredFields}has(e){return null!=this.get(e)}get(e){return null!=e?this._fieldsMap.get(e)||this._fieldsMap.get(o(e)):void 0}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){const t=this.get(e);if(t)return t.name}}function o(e){return e.toLowerCase().trim()}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1938],{43090:(e,t,i)=>{function l(e){return 32+e.length}function r(e){if(!e)return 0;let t=32;for(const i in e)if(e.hasOwnProperty(i)){const r=e[i];switch(typeof r){case"string":t+=l(r);break;case"number":t+=16;break;case"boolean":t+=4}}return t}function s(e,t){return 32+e.length*t}var o;i.d(t,{Y8:()=>o,do:()=>s,f2:()=>r}),function(e){e[e.KILOBYTES=1024]="KILOBYTES",e[e.MEGABYTES=1048576]="MEGABYTES",e[e.GIGABYTES=1073741824]="GIGABYTES"}(o||(o={}))},16859:(e,t,i)=>{i.d(t,{I:()=>b});var l=i(43697),r=i(40330),s=i(3172),o=i(66643),a=i(20102),n=i(92604),h=i(70586),c=i(95330),p=i(17452),u=i(5600),d=(i(67676),i(80442),i(75215),i(71715)),f=i(52011),m=i(30556),v=i(65587),y=i(15235),g=i(86082);const w=n.Z.getLogger("esri.layers.mixins.PortalLayer"),b=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,i){if(t.itemId)return new y.default({id:t.itemId,portal:i&&i.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const l=await i.e(8062).then(i.bind(i,18062));return(0,c.k_)(t),await l.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,c.D_)(e)||w.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,c.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==r.id?void 0:r.id.findCredential(this.url):null;if(!t)return!0;const i=_.credential===t?_.user:await this._fetchEditingUser(e);return _.credential=t,_.user=i,(0,h.Wi)(i)||null==i.privileges||i.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,i;const l=null==(t=this.portalItem)||null==(i=t.portal)?void 0:i.user;if(l)return l;const a=r.id.findServerInfo(this.url);if(null==a||!a.owningSystemUrl)return null;const n=`${a.owningSystemUrl}/sharing/rest`,c=v.Z.getDefault();if(c&&c.loaded&&(0,p.Fv)(c.restUrl)===(0,p.Fv)(n))return c.user;const u=`${n}/community/self`,d=(0,h.pC)(e)?e.signal:null,f=await(0,o.q6)((0,s.default)(u,{authMode:"no-prompt",query:{f:"json"},signal:d}));return f.ok?g.default.fromJSON(f.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const i=t&&t.portal,l=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||v.Z.getDefault());return i&&l&&!(0,p.tm)(l.restUrl,i.restUrl)?(t.messages&&t.messages.push(new a.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,l._)([(0,u.Cb)({type:y.default})],t.prototype,"portalItem",null),(0,l._)([(0,d.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,l._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,l._)([(0,u.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,l._)([(0,u.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,l._)([(0,f.j)("esri.layers.mixins.PortalLayer")],t),t},_={credential:null,user:null}},39450:(e,t,i)=>{i.d(t,{Z:()=>c});var l,r=i(43697),s=i(96674),o=i(5600),a=(i(67676),i(80442),i(75215)),n=i(52011);let h=l=class extends s.wq{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new l({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"cols",void 0),(0,r._)([(0,o.Cb)({type:a.z8,json:{write:!0}})],h.prototype,"level",void 0),(0,r._)([(0,o.Cb)({type:String,json:{write:!0}})],h.prototype,"levelValue",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"origin",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"resolution",void 0),(0,r._)([(0,o.Cb)({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],h.prototype,"rows",void 0),(0,r._)([(0,o.Cb)({type:Number,json:{write:!0}})],h.prototype,"scale",void 0),h=l=(0,r._)([(0,n.j)("esri.layers.support.LOD")],h);const c=h},11145:(e,t,i)=>{i.d(t,{Z:()=>T});var l,r=i(43697),s=i(35454),o=i(96674),a=i(70586),n=i(67900),h=i(5600),c=(i(67676),i(80442),i(75215)),p=i(71715),u=i(52011),d=i(30556),f=i(13473),m=i(82971),v=i(24470),y=i(8744),g=i(40488),w=i(39450);const b=new s.X({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let _=l=class extends o.wq{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:r=256,spatialReference:s=m.Z.WebMercator,numLODs:o=24}=e;if(!(0,y.JY)(s)){const e=[];if(i)for(let t=0;t<i.length;t++){const l=i[t];e.push({level:t,scale:l,resolution:l})}else{let t=5e-4;for(let i=o-1;i>=0;i--)e.unshift({level:i,scale:t,resolution:t}),t*=2}return new l({dpi:96,lods:e,origin:new f.Z(0,0,s),size:[r,r],spatialReference:s})}const a=(0,y.C5)(s),h=e.origin?new f.Z({x:e.origin.x,y:e.origin.y,spatialReference:s}):new f.Z(a?{x:a.origin[0],y:a.origin[1],spatialReference:s}:{x:0,y:0,spatialReference:s}),c=1/(39.37*(0,n.c9)(s)*96),p=[];if(i)for(let e=0;e<i.length;e++){const t=i[e],l=t*c;p.push({level:e,scale:t,resolution:l})}else{let e=(0,y.sT)(s)?512/r*591657527.5917094:256/r*591657527.591555;const i=Math.ceil(o/t);p.push({level:0,scale:e,resolution:e*c});for(let l=1;l<i;l++){const i=e/2**t,r=i*c;p.push({level:l,scale:i,resolution:r}),e=i}}return new l({dpi:96,lods:p,origin:h,size:[r,r],spatialReference:s})}get isWrappable(){const{spatialReference:e,origin:t}=this;if(e&&t){const i=(0,y.C5)(e);return e.isWrappable&&Math.abs(i.origin[0]-t.x)<=i.dx}return!1}readOrigin(e,t){return f.Z.fromJSON({spatialReference:t.spatialReference,...e})}set lods(e){let t=0,i=0;const l=[];this._levelToLOD={},e&&(t=-1/0,i=1/0,e.forEach((e=>{l.push(e.scale),t=e.scale>t?e.scale:t,i=e.scale<i?e.scale:i,this._levelToLOD[e.level]=e}))),this._set("scales",l),this._set("minScale",t),this._set("maxScale",i),this._set("lods",e),this._initializeUpsampleLevels()}readSize(e,t){return[t.cols,t.rows]}writeSize(e,t){t.cols=e[0],t.rows=e[1]}zoomToScale(e){const t=this.scales;if(e<=0)return t[0];if(e>=t.length-1)return t[t.length-1];{const i=Math.floor(e),l=i+1;return t[i]/(t[i]/t[l])**(e-i)}}scaleToZoom(e){const t=this.scales,i=t.length-1;let l=0;for(;l<i;l++){const i=t[l],r=t[l+1];if(i<=e)return l;if(r===e)return l+1;if(i>e&&r<e)return l+Math.log(i/e)/Math.log(i/r)}return l}snapScale(e,t=.95){const i=this.scaleToZoom(e);return i%Math.floor(i)>=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,l){const r=this.lodAt(e);if(!r)return null;let s,o;if("number"==typeof t)s=t,o=i;else if((0,y.fS)(t.spatialReference,this.spatialReference))s=t.x,o=t.y,l=i;else{const e=(0,g.iV)(t,this.spatialReference);if((0,a.Wi)(e))return null;s=e.x,o=e.y,l=i}const n=r.resolution*this.size[0],h=r.resolution*this.size[1];return l||(l={id:null,level:0,row:0,col:0,extent:(0,v.Ue)()}),l.level=e,l.row=Math.floor((this.origin.y-o)/h+.001),l.col=Math.floor((s-this.origin.x)/n+.001),this.updateTileInfo(l),l}updateTileInfo(e,t=l.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===l.ExtrapolateOptions.POWER_OF_TWO){const t=this.lods[this.lods.length-1];t.level<e.level&&(i=t)}if(!i)return;const r=e.level-i.level,s=i.resolution*this.size[0]/2**r,o=i.resolution*this.size[1]/2**r;e.id=`${e.level}/${e.row}/${e.col}`,e.extent||(e.extent=(0,v.Ue)()),e.extent[0]=this.origin.x+e.col*s,e.extent[1]=this.origin.y-(e.row+1)*o,e.extent[2]=e.extent[0]+s,e.extent[3]=e.extent[1]+o}upsampleTile(e){const t=this._upsampleLevels[e.level];return!(!t||-1===t.parentLevel||(e.level=t.parentLevel,e.row=Math.floor(e.row/t.factor+.001),e.col=Math.floor(e.col/t.factor+.001),this.updateTileInfo(e),0))}getTileBounds(e,t){const{resolution:i}=this.lodAt(t.level),l=i*this.size[0],r=i*this.size[1];return e[0]=this.origin.x+t.col*l,e[1]=this.origin.y-(t.row+1)*r,e[2]=e[0]+l,e[3]=e[1]+r,e}lodAt(e){return this._levelToLOD&&this._levelToLOD[e]||null}clone(){return l.fromJSON(this.write({}))}getOrCreateCompatible(e,t){if(256===this.size[0]&&256===this.size[1])return 256===e?this:null;const i=[],r=this.lods.length;for(let e=0;e<r;e++){const l=this.lods[e],r=l.resolution*t;i.push(new w.Z({level:l.level,scale:l.scale,resolution:r}))}return new l({size:[e,e],dpi:this.dpi,format:this.format,compressionQuality:this.compressionQuality,origin:this.origin,spatialReference:this.spatialReference,lods:i})}_initializeUpsampleLevels(){const e=this.lods;this._upsampleLevels=[];let t=null;for(let i=0;i<e.length;i++){const l=e[i];this._upsampleLevels[l.level]={parentLevel:t?t.level:-1,factor:t?t.resolution/l.resolution:0},t=l}}};var S,O;(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],_.prototype,"compressionQuality",void 0),(0,r._)([(0,h.Cb)({type:Number,json:{write:!0}})],_.prototype,"dpi",void 0),(0,r._)([(0,h.Cb)({type:String,json:{read:b.read,write:b.write,origins:{"web-scene":{read:!1,write:!1}}}})],_.prototype,"format",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"isWrappable",null),(0,r._)([(0,h.Cb)({type:f.Z,json:{write:!0}})],_.prototype,"origin",void 0),(0,r._)([(0,p.r)("origin")],_.prototype,"readOrigin",null),(0,r._)([(0,h.Cb)({type:[w.Z],value:null,json:{write:!0}})],_.prototype,"lods",null),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"minScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"maxScale",void 0),(0,r._)([(0,h.Cb)({readOnly:!0})],_.prototype,"scales",void 0),(0,r._)([(0,h.Cb)({cast:e=>Array.isArray(e)?e:"number"==typeof e?[e,e]:[256,256]})],_.prototype,"size",void 0),(0,r._)([(0,p.r)("size",["rows","cols"])],_.prototype,"readSize",null),(0,r._)([(0,d.c)("size",{cols:{type:c.z8},rows:{type:c.z8}})],_.prototype,"writeSize",null),(0,r._)([(0,h.Cb)({type:m.Z,json:{write:!0}})],_.prototype,"spatialReference",void 0),_=l=(0,r._)([(0,u.j)("esri.layers.support.TileInfo")],_),(O=(S=_||(_={})).ExtrapolateOptions||(S.ExtrapolateOptions={}))[O.NONE=0]="NONE",O[O.POWER_OF_TWO=1]="POWER_OF_TWO";const T=_},56608:(e,t,i)=>{i.d(t,{y:()=>z});var l,r=i(43697),s=i(3172),o=i(15923),a=i(43090),n=i(20102),h=i(3920),c=i(92604),p=i(13867),u=i(44553),d=i(95330),f=i(17445),m=i(1654),v=i(17452),y=i(5600),g=i(67676),w=(i(80442),i(90578)),b=i(52011),_=i(22974);class S{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(e,t){if("unknown"!==this._allAvailability)return this._allAvailability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),l=i%8,r=i>>3,s=this._tileAvailabilityBitSet;return r<0||r>s.length?"unknown":s[r]&1<<l?"available":"unavailable"}_updateFromData(e){const t=this.location.width,i=this.location.height;let l=!0,r=!0;const s=Math.ceil(t*i/8),o=new Uint8Array(s);let a=0;for(let t=0;t<e.length;t++){const i=t%8;e[t]?(r=!1,o[a]|=1<<i):l=!1,7===i&&++a}r?this._allAvailability="unavailable":l?this._allAvailability="available":(this._allAvailability="unknown",this._tileAvailabilityBitSet=o,this.byteSize+=o.length)}static fromDefinition(e,t){const i=e.service.request||s.default,{row:l,col:r,width:o,height:a}=e,h={query:{f:"json"}};return t=t?{...h,...t}:h,i(function(e){let t;if("vector-tile"===e.service.type)t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then((e=>e.data)).catch((e=>{if(e&&e.details&&422===e.details.httpStatus)return{location:{top:l,left:r,width:o,height:a},valid:!0,data:(0,g.a9)(o*a,0)};throw e})).then((e=>{if(e.location&&(e.location.top!==l||e.location.left!==r||e.location.width!==o||e.location.height!==a))throw new n.Z("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:l,left:r,width:o,height:a}});return S.fromJSON(e)}))}static fromJSON(e){S._validateJSON(e);const t=new S;return t.location=Object.freeze((0,_.d9)(e.location)),t._updateFromData(e.data),Object.freeze(t)}static _validateJSON(e){if(!e||!e.location)throw new n.Z("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new n.Z("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new n.Z("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new n.Z("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new n.Z("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function O(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const T=c.Z.getLogger("esri.layers.support.TilemapCache");let z=l=class extends((0,h.p)(o.Z)){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*a.Y8.MEGABYTES,this.request=s.default,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new p.Z(this.cacheByteSize),this.handles.add([this.watch(["layer.parsedUrl","layer.tileServers?","layer.apiKey?","layer.customParameters?"],(()=>this._initializeTilemapDefinition())),(0,f.YP)((()=>{var e,t;return null==(e=this.layer)||null==(t=e.tileInfo)?void 0:t.lods}),(e=>this._initializeAvailableLevels(e)),f.tX)]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(T.error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<<this.levels}fetchTilemap(e,t,i,l){if(!this._availableLevels[e])return Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,s=this._tilemapFromCache(e,t,i,r);if(s)return Promise.resolve(s);const o=l&&l.signal;return l={...l,signal:null},new Promise(((e,t)=>{(0,d.fu)(o,(()=>t((0,d.zE)())));const i=O(r);let s=this._pendingTilemapRequests[i];if(!s){s=S.fromDefinition(r,l).then((e=>(this._tilemapCache.put(i,e,e.byteSize),e)));const e=()=>delete this._pendingTilemapRequests[i];this._pendingTilemapRequests[i]=s,s.then(e,e)}s.then(e,t)}))}getAvailability(e,t,i){if(!this._availableLevels[e])return"unavailable";const l=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return l?l.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,l){return this._availableLevels[e]?this.fetchTilemap(e,t,i,l).catch((e=>e)).then((l=>{if(l instanceof S){const r=l.getAvailability(t,i);if("unavailable"===r)throw new n.Z("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i});return r}if((0,d.D_)(l))throw l;return"unknown"})):Promise.reject(new n.Z("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,t,i,l,r){l.level=e,l.row=t,l.col=i;const s=this.layer.tileInfo;s.updateTileInfo(l);const o=this.fetchAvailability(e,t,i,r).catch((e=>{if((0,d.D_)(e))throw e;if(s.upsampleTile(l))return this.fetchAvailabilityUpsample(l.level,l.row,l.col,l);throw e}));return this._fetchAvailabilityUpsamplePrefetch(l.id,e,t,i,r,o),o}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,s,o){if(!this._prefetchingEnabled)return;const a=`prefetch-${e}`;if(this.handles.has(a))return;const n=new AbortController;o.then((()=>n.abort()),(()=>n.abort()));let h=!1;const c={remove(){h||(h=!0,n.abort())}};if(this.handles.add(c,a),await(0,m.MU)(10,n.signal).catch((()=>{})),h||(h=!0,this.handles.remove(a)),(0,d.Hc)(n))return;const p={id:e,level:t,row:i,col:r},u={...s,signal:n.signal},f=this.layer.tileInfo;for(let e=0;l._prefetches.length<l._maxPrefetch&&f.upsampleTile(p);++e){const e=this.fetchAvailability(p.level,p.row,p.col,u);l._prefetches.push(e);const t=()=>{l._prefetches.removeUnordered(e)};e.then(t,t)}}_initializeTilemapDefinition(){var e;if(!this.layer.parsedUrl)return;const{parsedUrl:t,apiKey:i,customParameters:l}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:t.path,query:(0,v.B7)({...t.query,...l,token:null!=i?i:null==(e=t.query)?void 0:e.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,l){l.level=e,l.row=t-t%this.size,l.col=i-i%this.size;const r=O(l);return this._tilemapCache.get(r)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach((e=>this._availableLevels[e.level]=!0))}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(t){e._prefetchingEnabled=t},hasTilemap:(t,i,l)=>!!e._tilemapFromCache(t,i,l,e._tmpTilemapDefinition)}}};z._maxPrefetch=4,z._prefetches=new u.Z({initialSize:l._maxPrefetch}),(0,r._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"levels",void 0),(0,r._)([(0,w.p)("levels")],z.prototype,"castLevels",null),(0,r._)([(0,y.Cb)({readOnly:!0,type:Number})],z.prototype,"size",null),(0,r._)([(0,y.Cb)({constructOnly:!0,type:Number})],z.prototype,"cacheByteSize",void 0),(0,r._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"layer",void 0),(0,r._)([(0,y.Cb)({constructOnly:!0})],z.prototype,"request",void 0),z=l=(0,r._)([(0,b.j)("esri.layers.support.TilemapCache")],z)},45322:(e,t,i)=>{i.d(t,{d:()=>s,h:()=>r});var l=i(11145);const r={type:l.Z,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:s}}}}};function s(e,t,i,r){if(!e)return null;const{minScale:s,maxScale:o,minLOD:a,maxLOD:n}=t;if(null!=a&&null!=n)return r&&r.ignoreMinMaxLOD?l.Z.fromJSON(e):l.Z.fromJSON({...e,lods:e.lods.filter((({level:e})=>null!=e&&e>=a&&e<=n))});if(0!==s&&0!==o){const t=e=>Math.round(1e4*e)/1e4,i=s?t(s):1/0,r=o?t(o):-1/0;return l.Z.fromJSON({...e,lods:e.lods.filter((e=>{const l=t(e.scale);return l<=i&&l>=r}))})}return l.Z.fromJSON(e)}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4133,7873],{65845:(e,t,r)=>{r.d(t,{D:()=>a});var i=r(81153);function a(e){e&&e.writtenProperties&&e.writtenProperties.forEach((e=>{const t=e.target;e.newOrigin&&e.oldOrigin!==e.newOrigin&&(0,i.l)(t)&&t.updateOrigin(e.propName,e.newOrigin)}))}},81153:(e,t,r)=>{function i(e){return e&&"getAtOrigin"in e&&"originOf"in e}r.d(t,{l:()=>i})},41123:(e,t,r)=>{r.d(t,{D:()=>a});const i="randomUUID"in crypto;function a(){if(i)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=t=>e[t].toString(16);return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}},54295:(e,t,r)=>{r.d(t,{V:()=>o});var i=r(43697),a=r(5600),s=(r(67676),r(80442),r(75215),r(52011));const o=e=>{let t=class extends e{get apiKey(){var e;return this._isOverridden("apiKey")?this._get("apiKey"):function(e){return"portalItem"in e}(this)?null==(e=this.portalItem)?void 0:e.apiKey:null}set apiKey(e){null!=e?this._override("apiKey",e):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return(0,i._)([(0,a.Cb)({type:String})],t.prototype,"apiKey",null),t=(0,i._)([(0,s.j)("esri.layers.mixins.APIKeyMixin")],t),t}},17287:(e,t,r)=>{r.d(t,{Y:()=>p});var i=r(43697),a=r(92604),s=r(70586),o=r(5600),n=(r(67676),r(80442),r(75215),r(52011)),l=r(66677);const p=e=>{let t=class extends e{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,l.Qc)(this.url);if((0,s.pC)(e)&&e.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,l.Nm)(e,a.Z.getLogger(this.declaredClass)))}};return(0,i._)([(0,o.Cb)()],t.prototype,"title",null),(0,i._)([(0,o.Cb)({type:String})],t.prototype,"url",null),t=(0,i._)([(0,n.j)("esri.layers.mixins.ArcGISService")],t),t}},16859:(e,t,r)=>{r.d(t,{I:()=>I});var i=r(43697),a=r(40330),s=r(3172),o=r(66643),n=r(20102),l=r(92604),p=r(70586),u=r(95330),d=r(17452),c=r(5600),h=(r(67676),r(80442),r(75215),r(71715)),y=r(52011),m=r(30556),f=r(65587),g=r(15235),v=r(86082);const w=l.Z.getLogger("esri.layers.mixins.PortalLayer"),I=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){var e;null==(e=this.portalItem)||e.destroy(),this.portalItem=null}set portalItem(e){e!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",e))}readPortalItem(e,t,r){if(t.itemId)return new g.default({id:t.itemId,portal:r&&r.portal})}writePortalItem(e,t){e&&e.id&&(t.itemId=e.id)}async loadFromPortal(e,t){if(this.portalItem&&this.portalItem.id)try{const i=await r.e(8062).then(r.bind(r,18062));return(0,u.k_)(t),await i.load({instance:this,supportedTypes:e.supportedTypes,validateItem:e.validateItem,supportsData:e.supportsData},t)}catch(e){throw(0,u.D_)(e)||w.warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id})\n ${e}`),e}}async finishLoadEditablePortalLayer(e){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(e).catch((e=>((0,u.r9)(e),!0))))}async _fetchUserHasEditingPrivileges(e){const t=this.url?null==a.id?void 0:a.id.findCredential(this.url):null;if(!t)return!0;const r=S.credential===t?S.user:await this._fetchEditingUser(e);return S.credential=t,S.user=r,(0,p.Wi)(r)||null==r.privileges||r.privileges.includes("features:user:edit")}async _fetchEditingUser(e){var t,r;const i=null==(t=this.portalItem)||null==(r=t.portal)?void 0:r.user;if(i)return i;const n=a.id.findServerInfo(this.url);if(null==n||!n.owningSystemUrl)return null;const l=`${n.owningSystemUrl}/sharing/rest`,u=f.Z.getDefault();if(u&&u.loaded&&(0,d.Fv)(u.restUrl)===(0,d.Fv)(l))return u.user;const c=`${l}/community/self`,h=(0,p.pC)(e)?e.signal:null,y=await(0,o.q6)((0,s.default)(c,{authMode:"no-prompt",query:{f:"json"},signal:h}));return y.ok?v.default.fromJSON(y.value.data):null}read(e,t){t&&(t.layer=this),super.read(e,t)}write(e,t){const r=t&&t.portal,i=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||f.Z.getDefault());return r&&i&&!(0,d.tm)(i.restUrl,r.restUrl)?(t.messages&&t.messages.push(new n.Z("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(e,{...t,layer:this})}};return(0,i._)([(0,c.Cb)({type:g.default})],t.prototype,"portalItem",null),(0,i._)([(0,h.r)("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),(0,i._)([(0,m.c)("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),(0,i._)([(0,c.Cb)({clonable:!1})],t.prototype,"resourceReferences",void 0),(0,i._)([(0,c.Cb)({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=(0,i._)([(0,y.j)("esri.layers.mixins.PortalLayer")],t),t},S={credential:null,user:null}},32271:(e,t,r)=>{r.d(t,{xp:()=>q,Vt:()=>E});var i=r(43697),a=r(3172),s=r(20102),o=(r(80442),r(92604)),n=r(70586),l=r(95330),p=r(17452),u=r(5600),d=(r(67676),r(75215),r(71715)),c=r(52011),h=r(30556),y=r(65845),m=r(6570),f=r(79235),g=r(82971),v=r(66677),w=r(21506),I=r(61064),S=r(65587),_=r(15235),b=r(66643),x=r(41123),P=r(97873);async function R(e,t,r){if(!t||!t.resources)return;const i=t.portalItem===e.portalItem?new Set(e.paths):new Set;e.paths.length=0,e.portalItem=t.portalItem;const a=new Set(t.resources.toKeep.map((e=>e.resource.path))),o=new Set,n=[];a.forEach((t=>{i.delete(t),e.paths.push(t)}));for(const s of t.resources.toUpdate)if(i.delete(s.resource.path),a.has(s.resource.path)||o.has(s.resource.path)){const{resource:t,content:i,finish:a,error:o}=s,l=(0,P.getSiblingOfSameTypeI)(t,(0,x.D)());e.paths.push(l.path),n.push(U({resource:l,content:i,finish:a,error:o},r))}else e.paths.push(s.resource.path),n.push(O(s,r)),o.add(s.resource.path);for(const i of t.resources.toAdd)n.push(U(i,r)),e.paths.push(i.resource.path);if(i.forEach((e=>{const r=t.portalItem.resourceFromPath(e);n.push(r.portalItem.removeResource(r).catch((()=>{})))})),0===n.length)return;const p=await(0,l.as)(n);(0,l.k_)(r);const u=p.filter((e=>"error"in e)).map((e=>e.error));if(u.length>0)throw new s.Z("save:resources","Failed to save one or more resources",{errors:u})}async function U(e,t){const r=await(0,b.q6)(e.resource.portalItem.addResource(e.resource,e.content,t));if(!0!==r.ok)throw e.error&&e.error(r.error),r.error;e.finish&&e.finish(e.resource)}async function O(e,t){const r=await(0,b.q6)(e.resource.update(e.content,t));if(!0!==r.ok)throw e.error(r.error),r.error;e.finish(e.resource)}const C=o.Z.getLogger("esri.layers.mixins.SceneService"),E=e=>{let t=class extends e{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=(0,l.Ds)((async(e,t,r)=>{switch(e){case q.SAVE:return this._save(t);case q.SAVE_AS:return this._saveAs(r,t)}}))}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(null!=e.spatialReference)return g.Z.fromJSON(e.spatialReference);{const t=e.store,r=t.indexCRS||t.geographicCRS,i=r&&parseInt(r.substring(r.lastIndexOf("/")+1,r.length),10);return null!=i?new g.Z(i):null}}readFullExtent(e,t,r){if(null!=e&&"object"==typeof e){const i=null==e.spatialReference?{...e,spatialReference:this._readSpatialReference(t)}:e;return m.Z.fromJSON(i,r)}const i=t.store,a=this._readSpatialReference(t);return null==a||null==i||null==i.extent||!Array.isArray(i.extent)||i.extent.some((e=>e<T))?null:new m.Z({xmin:i.extent[0],ymin:i.extent[1],xmax:i.extent[2],ymax:i.extent[3],spatialReference:a})}parseVersionString(e){const t={major:Number.NaN,minor:Number.NaN,versionString:e},r=e.split(".");return r.length>=2&&(t.major=parseInt(r[0],10),t.minor=parseInt(r[1],10)),t}readVersion(e,t){const r=t.store,i=null!=r.version?r.version.toString():"";return this.parseVersionString(i)}readTitlePortalItem(e){return"item-title"!==this.sublayerTitleMode?void 0:e}readTitleService(e,t){const r=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return(0,v.a7)(this.url,t.name);let i=t.name;if(!i&&this.url){const e=(0,v.Qc)(this.url);(0,n.pC)(e)&&(i=e.title)}return"item-title-and-service-name"===this.sublayerTitleMode&&r&&(i=r+" - "+i),(0,v.ld)(i)}set url(e){const t=(0,v.XG)({layer:this,url:e,nonStandardUrlAllowed:!1,logger:C});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){(0,v.wH)(this,e,"layers",t,i)}get parsedUrl(){const e=this._get("url");if(!e)return null;const t=(0,p.mN)(e);return null!=this.layerId&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=(0,I.T)(this.parsedUrl.path,this.rootNode,e,this.apiKey,C,t),null==this.fullExtent||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){if("page"===(null==e?void 0:e.type)){var t,r;const i=e.rootIndex%e.pageSize,a=null==(t=e.rootPage)||null==(r=t.nodes)?void 0:r[i];if(null==a||null==a.obb||null==a.obb.center||null==a.obb.halfSize)throw new s.Z("sceneservice:invalid-node-page","Invalid node page.");if(a.obb.center[0]<T||null==this.fullExtent||this.fullExtent.hasZ)return;const o=a.obb.halfSize,n=a.obb.center[2],l=Math.sqrt(o[0]*o[0]+o[1]*o[1]+o[2]*o[2]);this.fullExtent.zmin=n-l,this.fullExtent.zmax=n+l}else if("node"===(null==e?void 0:e.type)){var i;const t=null==(i=e.rootNode)?void 0:i.mbs;if(!Array.isArray(t)||4!==t.length||t[0]<T)return;const r=t[2],a=t[3];this.fullExtent.zmin=r-a,this.fullExtent.zmax=r+a}}async _fetchService(e){if(null==this.url)throw new s.Z("sceneservice:url-not-set","Scene service can not be loaded without valid portal item or url");if(null==this.layerId&&/SceneServer\/*$/i.test(this.url)){const t=await this._fetchFirstLayerId(e);null!=t&&(this.layerId=t)}return this._fetchServiceLayer(e)}async _fetchFirstLayerId(e){const t=await(0,a.default)(this.url,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});if(t.data&&Array.isArray(t.data.layers)&&t.data.layers.length>0)return t.data.layers[0].id}async _fetchServiceLayer(e){const t=await(0,a.default)(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let r=!1;if(t.data.layerType&&"Voxel"===t.data.layerType&&(r=!0),r)return this._fetchVoxelServiceLayer();const i=t.data;this.read(i,{origin:"service",url:this.parsedUrl}),this.validateLayer(i)}async _fetchVoxelServiceLayer(e){const t=(await(0,a.default)(this.parsedUrl.path+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl}),this.validateLayer(t)}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&"function"==typeof this.beforeSave&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,r){e.typeKeywords||(e.typeKeywords=[]);const i=t.getTypeKeywords();for(const t of i)e.typeKeywords.push(t);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter(((e,t,r)=>r.indexOf(e)===t)),r===N.newItem&&(e.typeKeywords=e.typeKeywords.filter((e=>"Hosted Service"!==e))))}async _saveAs(e,t){const r={...Z,...t};let i=_.default.from(e);i||(C.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new s.Z("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),i.id&&(i=i.clone(),i.id=null);const a=i.portal||S.Z.getDefault();await this._ensureLoadBeforeSave(),i.type=j,i.portal=a;const o={origin:"portal-item",url:null,messages:[],portal:a,portalItem:i,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},n={layers:[this.write({},o)]};return await Promise.all(o.resources.pendingOperations),await this._validateAgainstJSONSchema(n,o,r),i.url=this.url,i.title||(i.title=this.title),this._updateTypeKeywords(i,r,N.newItem),await a._signIn(),await a.user.addItem({item:i,folder:r&&r.folder,data:n}),await R(this.resourceReferences,o,null),this.portalItem=i,(0,y.D)(o),o.portalItem=i,i}async _save(e){const t={...Z,...e};this.portalItem||(C.error("_save(): requires the .portalItem property to be set"),await Promise.reject(new s.Z("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService"))),this.portalItem.type!==j&&(C.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+j),await Promise.reject(new s.Z("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${j}"`))),await this._ensureLoadBeforeSave();const r={origin:"portal-item",url:this.portalItem.itemUrl&&(0,p.mN)(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||S.Z.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},i={layers:[this.write({},r)]};return await Promise.all(r.resources.pendingOperations),await this._validateAgainstJSONSchema(i,r,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,N.existingItem),await this.portalItem.update({data:i}),await R(this.resourceReferences,r,null),(0,y.D)(r),this.portalItem}async _validateAgainstJSONSchema(e,t,i){let a=t.messages.filter((e=>"error"===e.type)).map((e=>new s.Z(e.name,e.message,e.details)));if(i&&i.validationOptions.ignoreUnsupported&&(a=a.filter((e=>"layer:unsupported"!==e.name&&"symbol:unsupported"!==e.name&&"symbol-layer:unsupported"!==e.name&&"property:unsupported"!==e.name&&"url:unsupported"!==e.name&&"scenemodification:unsupported"!==e.name))),i.validationOptions.enabled||A){const t=(await r.e(7572).then(r.bind(r,87572))).validate(e,i.portalItemLayerType);if(t.length>0){const e=`Layer item did not validate:\n${t.join("\n")}`;if(C.error(`_validateAgainstJSONSchema(): ${e}`),"throw"===i.validationOptions.failPolicy){const e=t.map((e=>new s.Z("sceneservice:schema-validation",e))).concat(a);throw new s.Z("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:e})}}}if(a.length>0)throw new s.Z("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:a})}};return(0,i._)([(0,u.Cb)(w.id)],t.prototype,"id",void 0),(0,i._)([(0,u.Cb)({type:g.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,d.r)("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readSpatialReference",null),(0,i._)([(0,u.Cb)({type:m.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,d.r)("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],t.prototype,"readFullExtent",null),(0,i._)([(0,u.Cb)({readOnly:!0,type:f.Z})],t.prototype,"heightModelInfo",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],t.prototype,"minScale",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],t.prototype,"maxScale",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,d.r)("version",["store.version"])],t.prototype,"readVersion",null),(0,i._)([(0,u.Cb)({type:String,json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:!1}})],t.prototype,"sublayerTitleMode",void 0),(0,i._)([(0,u.Cb)({type:String})],t.prototype,"title",void 0),(0,i._)([(0,d.r)("portal-item","title")],t.prototype,"readTitlePortalItem",null),(0,i._)([(0,d.r)("service","title",["name"])],t.prototype,"readTitleService",null),(0,i._)([(0,u.Cb)({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],t.prototype,"layerId",void 0),(0,i._)([(0,u.Cb)(w.HQ)],t.prototype,"url",null),(0,i._)([(0,h.c)("url")],t.prototype,"writeUrl",null),(0,i._)([(0,u.Cb)()],t.prototype,"parsedUrl",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"store",void 0),(0,i._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],t.prototype,"rootNode",void 0),t=(0,i._)([(0,c.j)("esri.layers.mixins.SceneService")],t),t},T=-1e38,A=!1;var N,K;(K=N||(N={}))[K.existingItem=0]="existingItem",K[K.newItem=1]="newItem";const j="Scene Service",Z={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var q;!function(e){e[e.SAVE=0]="SAVE",e[e.SAVE_AS=1]="SAVE_AS"}(q||(q={}))},61064:(e,t,r)=>{r.d(t,{T:()=>o});var i=r(3172),a=r(20102),s=r(70586);async function o(e,t,r,o,n,l){let p=null;if((0,s.pC)(r)){const t=`${e}/nodepages/`,a=t+Math.floor(r.rootIndex/r.nodesPerPage);try{return{type:"page",rootPage:(await(0,i.default)(a,{query:{f:"json",token:o},responseType:"json",signal:l})).data,rootIndex:r.rootIndex,pageSize:r.nodesPerPage,lodMetric:r.lodSelectionMetricType,urlPrefix:t}}catch(e){(0,s.pC)(n)&&n.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",a,e),p=e}}if(!t)return null;const u=`${e}/nodes/`,d=u+(t&&t.split("/").pop());try{return{type:"node",rootNode:(await(0,i.default)(d,{query:{f:"json",token:o},responseType:"json",signal:l})).data,urlPrefix:u}}catch(e){throw new a.Z("sceneservice:root-node-missing","Root node missing.",{pageError:p,nodeError:e,url:d})}}},97873:(e,t,r)=>{r.r(t),r.d(t,{addOrUpdateResource:()=>l,contentToBlob:()=>h,fetchResources:()=>n,getSiblingOfSameType:()=>y,getSiblingOfSameTypeI:()=>m,removeAllResources:()=>u,removeResource:()=>p,splitPrefixFileNameAndExtension:()=>c});var i=r(3172),a=r(20102),s=r(70586),o=r(17452);async function n(e,t={},r){await e.load(r);const i=(0,o.v_)(e.itemUrl,"resources"),{start:a=1,num:n=10,sortOrder:l="asc",sortField:p="created"}=t,u={query:{start:a,num:n,sortOrder:l,sortField:p,token:e.apiKey},signal:(0,s.U2)(r,"signal")},d=await e.portal._request(i,u);return{total:d.total,nextStart:d.nextStart,resources:d.resources.map((({created:t,size:r,resource:i})=>({created:new Date(t),size:r,resource:e.resourceFromPath(i)})))}}async function l(e,t,r,i){if(!e.hasPath())throw new a.Z(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const n=e.portalItem;await n.load(i);const l=(0,o.v_)(n.userItemUrl,"add"===t?"addResources":"updateResources"),[p,u]=d(e.path),c=await h(r),y=new FormData;return p&&"."!==p&&y.append("resourcesPrefix",p),y.append("fileName",u),y.append("file",c,u),y.append("f","json"),(0,s.pC)(i)&&i.access&&y.append("access",i.access),await n.portal._request(l,{method:"post",body:y,signal:(0,s.U2)(i,"signal")}),e}async function p(e,t,r){if(!t.hasPath())throw new a.Z("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const i=(0,o.v_)(e.userItemUrl,"removeResources");await e.portal._request(i,{method:"post",query:{resource:t.path},signal:(0,s.U2)(r,"signal")}),t.portalItem=null}async function u(e,t){await e.load(t);const r=(0,o.v_)(e.userItemUrl,"removeResources");return e.portal._request(r,{method:"post",query:{deleteAll:!0},signal:(0,s.U2)(t,"signal")})}function d(e){const t=e.lastIndexOf("/");return-1===t?[".",e]:[e.slice(0,t),e.slice(t+1)]}function c(e){const[t,r]=function(e){const t=(0,o.Ml)(e);return(0,s.Wi)(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}(e),[i,a]=d(t);return[i,a,r]}async function h(e){return e instanceof Blob?e:(await(0,i.default)(e.url,{responseType:"blob"})).data}function y(e,t){if(!e.hasPath())return null;const[r,,i]=c(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}function m(e,t){if(!e.hasPath())return null;const[r,,i]=c(e.path);return e.portalItem.resourceFromPath((0,o.v_)(r,t+i))}}}]);
|